Skip to content

Commit 38807f1

Browse files
committed
fix CS
1 parent ef6f249 commit 38807f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+127
-30
lines changed

Command/RequestUserPassword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class RequestUserPassword
1414
public $userId;
1515
public $token;
1616

17-
public function __construct(UserId $userId, string $token = null)
17+
public function __construct(UserId $userId, ?string $token = null)
1818
{
1919
$this->userId = $userId;
2020
$this->token = $token;

Event/Domain/RequestPassword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class RequestPassword implements DomainEvent
1313
{
1414
public $token;
1515

16-
public function __construct(string $token = null)
16+
public function __construct(?string $token = null)
1717
{
1818
$this->token = $token;
1919
}

Infrastructure/Doctrine/Event/UsernameListener.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class UsernameListener
2020
private $factory;
2121
/** @var array<class-string, array<string, string>> */
2222
private $mapping;
23-
/** @var array<int, string|null> */
23+
/** @var array<int, null|string> */
2424
private $removals = [];
2525
/** @var array<int, array{0:User,1:string}> */
2626
private $insertions = [];
@@ -71,17 +71,17 @@ public function preUpdate(object $entity, PreUpdateEventArgs $event): void
7171
continue;
7272
}
7373

74-
/** @var string|null $oldUsername */
74+
/** @var null|string $oldUsername */
7575
$oldUsername = $event->getOldValue($field);
76-
/** @var string|null $newUsername */
76+
/** @var null|string $newUsername */
7777
$newUsername = $event->getNewValue($field);
7878

7979
if (null !== $oldUsername) {
8080
$this->removals[] = $oldUsername;
8181
}
8282

8383
if (null !== $newUsername) {
84-
/** @var User|null $user */
84+
/** @var null|User $user */
8585
$user = null === $mappedBy ? $entity : $em->getClassMetadata(\get_class($entity))->getFieldValue($entity, $mappedBy);
8686

8787
if (null !== $user) {
@@ -124,7 +124,7 @@ private function createUsernames(object $entity, EntityManagerInterface $em): it
124124
}
125125

126126
/**
127-
* @return array<string, string|null>
127+
* @return array<string, null|string>
128128
*/
129129
private function getMapping(object $entity, EntityManagerInterface $em): array
130130
{

Infrastructure/Doctrine/Repository/UserRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ final class UserRepository implements BaseUserRepository
2323
/** @use DomainEntityRepositoryTrait<T> */
2424
use DomainEntityRepositoryTrait;
2525

26-
/** @var string|null */
26+
/** @var null|string */
2727
private $usernameField;
28-
/** @var UsernameRepository|null */
28+
/** @var null|UsernameRepository */
2929
private $usernameRepository;
3030

3131
/**
3232
* @param class-string $class
3333
*/
34-
public function __construct(string $class, EntityManagerInterface $em, string $usernameField = null, UsernameRepository $usernameRepository = null)
34+
public function __construct(string $class, EntityManagerInterface $em, ?string $usernameField = null, ?UsernameRepository $usernameRepository = null)
3535
{
3636
$this->class = $class;
3737
$this->em = $em;

Infrastructure/Form/Extension/UserExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
4848
if (!isset($data[$sourceField])) {
4949
continue;
5050
}
51+
5152
try {
5253
$data[$targetField] = $this->repository->findByUsername($data[$sourceField]);
5354
} catch (EntityNotFound $e) {

Infrastructure/Form/Type/HashedPasswordType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private static function withConstraint(array $options, Constraint $constraint):
144144
final class Password
145145
{
146146
public $hashing;
147-
/** @var string|null */
147+
/** @var null|string */
148148
public $hash;
149149

150150
public function __construct(PasswordEncoderInterface $hashing)

Infrastructure/Security/DataCollector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@
2828
*/
2929
final class DataCollector extends BaseDataCollector
3030
{
31-
/** @var UserRepository|null */
31+
/** @var null|UserRepository */
3232
private $repository;
3333

34-
public function __construct(TokenStorageInterface $tokenStorage = null, RoleHierarchyInterface $roleHierarchy = null, LogoutUrlGenerator $logoutUrlGenerator = null, AccessDecisionManagerInterface $accessDecisionManager = null, FirewallMapInterface $firewallMap = null, TraceableFirewallListener $firewall = null, UserRepository $repository = null)
34+
public function __construct(?TokenStorageInterface $tokenStorage = null, ?RoleHierarchyInterface $roleHierarchy = null, ?LogoutUrlGenerator $logoutUrlGenerator = null, ?AccessDecisionManagerInterface $accessDecisionManager = null, ?FirewallMapInterface $firewallMap = null, ?TraceableFirewallListener $firewall = null, ?UserRepository $repository = null)
3535
{
3636
parent::__construct($tokenStorage, $roleHierarchy, $logoutUrlGenerator, $accessDecisionManager, $firewallMap, $firewall);
3737

3838
$this->repository = $repository;
3939
}
4040

41-
public function collect(Request $request, Response $response, \Exception $exception = null): void
41+
public function collect(Request $request, Response $response, ?\Exception $exception = null): void
4242
{
4343
/** @psalm-suppress TooManyArguments */
4444
parent::collect($request, $response, $exception);

Infrastructure/Security/Jwt/UserIdentityProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(BaseUserIdentityProvider $provider, UserRepository $
3131
}
3232

3333
/**
34-
* @inheritDoc
34+
* {@inheritdoc}
3535
*
3636
* @return UserIdentity
3737
*/
@@ -47,7 +47,7 @@ public function loadUserByUsernameAndPayload($username, array $payload): UserInt
4747
}
4848

4949
/**
50-
* @inheritDoc
50+
* {@inheritdoc}
5151
*
5252
* @return UserIdentity
5353
*/
@@ -57,7 +57,7 @@ public function loadUserByUsername($username): UserInterface
5757
}
5858

5959
/**
60-
* @inheritDoc
60+
* {@inheritdoc}
6161
*
6262
* @return UserIdentity
6363
*/

Infrastructure/Security/UserIdentity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ final class UserIdentity implements UserInterface, EquatableInterface, EncoderAw
1818
{
1919
/** @var UserId */
2020
private $id;
21-
/** @var string|null */
21+
/** @var null|string */
2222
private $originUsername;
2323
/** @var array<int, string> */
2424
private $roles;
25-
/** @var string|null */
25+
/** @var null|string */
2626
private $password;
2727
/** @var string */
2828
private $hashing;
2929

3030
/**
3131
* @param array<int, string> $roles
3232
*/
33-
public function __construct(User $user, string $originUsername = null, array $roles = [], string $hashing = null)
33+
public function __construct(User $user, ?string $originUsername = null, array $roles = [], ?string $hashing = null)
3434
{
3535
$this->id = $user->getId();
3636

Infrastructure/Security/UserIdentityProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ final class UserIdentityProvider implements UserProviderInterface
2121
private $repository;
2222
private $roleProvider;
2323

24-
public function __construct(UserRepository $repository, RoleProvider $roleProvider = null)
24+
public function __construct(UserRepository $repository, ?RoleProvider $roleProvider = null)
2525
{
2626
$this->repository = $repository;
2727
$this->roleProvider = $roleProvider;
2828
}
2929

3030
/**
31-
* @inheritDoc
31+
* {@inheritdoc}
3232
*
3333
* @return UserIdentity
3434
*/
@@ -44,7 +44,7 @@ public function loadUserByUsername($username): UserInterface
4444
}
4545

4646
/**
47-
* @inheritDoc
47+
* {@inheritdoc}
4848
*
4949
* @return UserIdentity
5050
*/
@@ -68,7 +68,7 @@ public function supportsClass($class): bool
6868
return UserIdentity::class === $class;
6969
}
7070

71-
public function fromUser(User $user, string $originUsername = null): UserIdentity
71+
public function fromUser(User $user, ?string $originUsername = null): UserIdentity
7272
{
7373
return new UserIdentity($user, $originUsername, $this->roleProvider ? $this->roleProvider->getRoles($user) : []);
7474
}

0 commit comments

Comments
 (0)