format: fix psr12 style issues

phpcbf auto-fixes: string concatenation spacing, single-line class braces, closing brace placement.
This commit is contained in:
Yisroel Baum 2026-05-16 21:34:30 +03:00
parent 9703f82788
commit 56ddba707d
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
27 changed files with 39 additions and 20 deletions

View file

@ -12,5 +12,6 @@ class CreateSessionDto
public User $user,
public DateTimeImmutable $createdAt,
public DateTimeImmutable $expiresAt,
) {}
) {
}
}

View file

@ -12,7 +12,8 @@ class Session
private User $user,
private DateTimeImmutable $createdAt,
private DateTimeImmutable $expiresAt,
) {}
) {
}
public function getToken(): string
{

View file

@ -14,7 +14,8 @@ class AuthenticateUser
public function __construct(
private UserRepository $userRepo,
private PasswordHasher $hasher,
) {}
) {
}
/**
* @throws BadRequestException

View file

@ -7,5 +7,6 @@ class AuthenticateUserRequest
public function __construct(
public ?string $email,
public ?string $password,
) {}
) {
}
}

View file

@ -17,7 +17,8 @@ class CreateSession
private SessionRepository $sessionRepo,
private TokenGenerator $tokenGenerator,
private Clock $clock,
) {}
) {
}
public function execute(User $user): Session
{

View file

@ -8,7 +8,8 @@ class Logout
{
public function __construct(
private SessionRepository $sessionRepo,
) {}
) {
}
public function execute(string $token): void
{

View file

@ -20,7 +20,8 @@ class AuthController
private AuthenticateUser $authenticateUser,
private CreateSession $createSession,
private Logout $logout,
) {}
) {
}
public function login(
ServerRequestInterface $request,

View file

@ -4,4 +4,6 @@ namespace App\Exceptions;
use DomainException;
class BadRequestException extends DomainException {}
class BadRequestException extends DomainException
{
}

View file

@ -4,4 +4,6 @@ namespace App\Exceptions;
use DomainException;
class UnauthorizedException extends DomainException {}
class UnauthorizedException extends DomainException
{
}

View file

@ -17,7 +17,8 @@ class AuthMiddleware implements MiddlewareInterface
public function __construct(
private SessionRepository $sessionRepo,
private Clock $clock,
) {}
) {
}
public function process(
ServerRequestInterface $request,

View file

@ -18,15 +18,15 @@ final readonly class EmailAddress
$trimmed = trim($email);
if ($trimmed === '' || ! str_contains($trimmed, '@')) {
throw new InvalidArgumentException(self::ERROR_MESSAGE." $email");
throw new InvalidArgumentException(self::ERROR_MESSAGE . " $email");
}
[$local, $domain] = explode('@', $trimmed, 2);
$this->domain = mb_strtolower($domain);
$normalized = $local.'@'.$this->domain;
$normalized = $local . '@' . $this->domain;
if (filter_var($normalized, FILTER_VALIDATE_EMAIL) === false) {
throw new InvalidArgumentException(self::ERROR_MESSAGE." $email");
throw new InvalidArgumentException(self::ERROR_MESSAGE . " $email");
}
$this->normalized = $normalized;

View file

@ -9,5 +9,6 @@ class CreateUserDto
public function __construct(
public EmailAddress $email,
public string $passwordHash,
) {}
) {
}
}

View file

@ -10,7 +10,8 @@ class User
private int $id,
private EmailAddress $email,
private string $passwordHash,
) {}
) {
}
public function getId(): int
{