Revert "fix: resolve PHPStan static analysis warnings"

This reverts commit 2d3e4b4a95.
This commit is contained in:
xboard
2025-04-14 21:23:08 +08:00
parent 2d3e4b4a95
commit db235c10e8
84 changed files with 1190 additions and 2330 deletions

View File

@@ -40,13 +40,7 @@ class AuthService
return $this->user->tokens()->get()->toArray();
}
public function removeSession(string $sessionId): bool
{
$this->user->tokens()->where('id', $sessionId)->delete();
return true;
}
public function removeAllSessions(): bool
public function removeSession(): bool
{
$this->user->tokens()->delete();
return true;
@@ -60,26 +54,4 @@ class AuthService
return $accessToken?->tokenable;
}
/**
* 解密认证数据
*
* @param string $authorization
* @return array|null 用户数据或null
*/
public static function decryptAuthData(string $authorization): ?array
{
$user = self::findUserByBearerToken($authorization);
if (!$user) {
return null;
}
return [
'id' => $user->id,
'email' => $user->email,
'is_admin' => (bool)$user->is_admin,
'is_staff' => (bool)$user->is_staff
];
}
}