@@ -80,7 +80,7 @@ |
||
| 80 | 80 | |
| 81 | 81 | public function __toString(): string |
| 82 | 82 | { |
| 83 | - return (string)$this->role; |
|
| 83 | + return (string) $this->role; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | public static function deserialize(array $data): self |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | { |
| 50 | 50 | return [ |
| 51 | 51 | 'type' => $this->type(), |
| 52 | - 'document_number' => (string)$this->getDocumentNumber(), |
|
| 52 | + 'document_number' => (string) $this->getDocumentNumber(), |
|
| 53 | 53 | ]; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | /** |
| 39 | 39 | * @var array |
| 40 | 40 | */ |
| 41 | - private array|null $configuration = null; |
|
| 41 | + private array | null $configuration = null; |
|
| 42 | 42 | |
| 43 | 43 | public static function create(): self |
| 44 | 44 | { |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | array_walk( |
| 50 | 50 | $institutions, |
| 51 | - function ($institution, $key) use ($institutions): void { |
|
| 51 | + function($institution, $key) use ($institutions): void { |
|
| 52 | 52 | if (!is_string($institution) || trim($institution) === '') { |
| 53 | 53 | throw InvalidArgumentException::invalidType( |
| 54 | 54 | 'string', |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | // Verify only institutions are collected in the set |
| 50 | 50 | array_walk( |
| 51 | 51 | $institutions, |
| 52 | - function ($institution, $key) use ($institutions): void { |
|
| 52 | + function($institution, $key) use ($institutions): void { |
|
| 53 | 53 | if (!$institution instanceof Institution) { |
| 54 | 54 | throw InvalidArgumentException::invalidType( |
| 55 | 55 | Institution::class, |
@@ -34,12 +34,12 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public static function from(Institution $institution): self |
| 36 | 36 | { |
| 37 | - return new self((string)Uuid::uuid5(self::UUID_NAMESPACE, $institution->getInstitution())); |
|
| 37 | + return new self((string) Uuid::uuid5(self::UUID_NAMESPACE, $institution->getInstitution())); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public static function normalizedFrom(Institution $institution): self |
| 41 | 41 | { |
| 42 | - return new self((string)Uuid::uuid5(self::UUID_NAMESPACE, strtolower($institution->getInstitution()))); |
|
| 42 | + return new self((string) Uuid::uuid5(self::UUID_NAMESPACE, strtolower($institution->getInstitution()))); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function __construct(string $institutionConfigurationId) |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | DomainMessage $domainMessage, |
| 40 | 40 | ): void { |
| 41 | 41 | $revocation = new SecondFactorRevocation(); |
| 42 | - $revocation->id = (string)Uuid::uuid4(); |
|
| 42 | + $revocation->id = (string) Uuid::uuid4(); |
|
| 43 | 43 | $revocation->institution = $event->identityInstitution; |
| 44 | 44 | $revocation->secondFactorType = $event->secondFactorType->getSecondFactorType(); |
| 45 | 45 | $revocation->revokedBy = 'self'; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | DomainMessage $domainMessage, |
| 54 | 54 | ): void { |
| 55 | 55 | $revocation = new SecondFactorRevocation(); |
| 56 | - $revocation->id = (string)Uuid::uuid4(); |
|
| 56 | + $revocation->id = (string) Uuid::uuid4(); |
|
| 57 | 57 | $revocation->institution = $event->identityInstitution; |
| 58 | 58 | $revocation->secondFactorType = $event->secondFactorType->getSecondFactorType(); |
| 59 | 59 | $revocation->revokedBy = 'ra'; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function applyIdentityRenamedEvent(IdentityRenamedEvent $event): void |
| 68 | 68 | { |
| 69 | - $secondFactors = $this->raSecondFactorRepository->findByIdentityId((string)$event->identityId); |
|
| 69 | + $secondFactors = $this->raSecondFactorRepository->findByIdentityId((string) $event->identityId); |
|
| 70 | 70 | |
| 71 | 71 | if ($secondFactors === []) { |
| 72 | 72 | return; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | public function applyIdentityEmailChangedEvent(IdentityEmailChangedEvent $event): void |
| 85 | 85 | { |
| 86 | - $secondFactors = $this->raSecondFactorRepository->findByIdentityId((string)$event->identityId); |
|
| 86 | + $secondFactors = $this->raSecondFactorRepository->findByIdentityId((string) $event->identityId); |
|
| 87 | 87 | |
| 88 | 88 | if ($secondFactors === []) { |
| 89 | 89 | return; |
@@ -100,12 +100,12 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | public function applyYubikeySecondFactorBootstrappedEvent(YubikeySecondFactorBootstrappedEvent $event): void |
| 102 | 102 | { |
| 103 | - $identity = $this->identityRepository->find((string)$event->identityId); |
|
| 103 | + $identity = $this->identityRepository->find((string) $event->identityId); |
|
| 104 | 104 | |
| 105 | 105 | $secondFactor = new RaSecondFactor( |
| 106 | - (string)$event->secondFactorId, |
|
| 106 | + (string) $event->secondFactorId, |
|
| 107 | 107 | 'yubikey', |
| 108 | - (string)$event->yubikeyPublicId, |
|
| 108 | + (string) $event->yubikeyPublicId, |
|
| 109 | 109 | $identity->id, |
| 110 | 110 | $identity->institution, |
| 111 | 111 | $event->commonName, |
@@ -119,10 +119,10 @@ discard block |
||
| 119 | 119 | public function applyYubikeyPossessionProvenEvent(YubikeyPossessionProvenEvent $event): void |
| 120 | 120 | { |
| 121 | 121 | $this->saveRaSecondFactor( |
| 122 | - (string)$event->identityId, |
|
| 123 | - (string)$event->secondFactorId, |
|
| 122 | + (string) $event->identityId, |
|
| 123 | + (string) $event->secondFactorId, |
|
| 124 | 124 | 'yubikey', |
| 125 | - (string)$event->yubikeyPublicId, |
|
| 125 | + (string) $event->yubikeyPublicId, |
|
| 126 | 126 | $event->commonName, |
| 127 | 127 | $event->email, |
| 128 | 128 | ); |
@@ -131,10 +131,10 @@ discard block |
||
| 131 | 131 | public function applyYubikeyPossessionProvenAndVerifiedEvent(YubikeyPossessionProvenAndVerifiedEvent $event): void |
| 132 | 132 | { |
| 133 | 133 | $this->saveRaSecondFactor( |
| 134 | - (string)$event->identityId, |
|
| 135 | - (string)$event->secondFactorId, |
|
| 134 | + (string) $event->identityId, |
|
| 135 | + (string) $event->secondFactorId, |
|
| 136 | 136 | 'yubikey', |
| 137 | - (string)$event->yubikeyPublicId, |
|
| 137 | + (string) $event->yubikeyPublicId, |
|
| 138 | 138 | $event->commonName, |
| 139 | 139 | $event->email, |
| 140 | 140 | ); |
@@ -143,10 +143,10 @@ discard block |
||
| 143 | 143 | public function applyPhonePossessionProvenEvent(PhonePossessionProvenEvent $event): void |
| 144 | 144 | { |
| 145 | 145 | $this->saveRaSecondFactor( |
| 146 | - (string)$event->identityId, |
|
| 147 | - (string)$event->secondFactorId, |
|
| 146 | + (string) $event->identityId, |
|
| 147 | + (string) $event->secondFactorId, |
|
| 148 | 148 | 'sms', |
| 149 | - (string)$event->phoneNumber, |
|
| 149 | + (string) $event->phoneNumber, |
|
| 150 | 150 | $event->commonName, |
| 151 | 151 | $event->email, |
| 152 | 152 | ); |
@@ -155,10 +155,10 @@ discard block |
||
| 155 | 155 | public function applyPhonePossessionProvenAndVerifiedEvent(PhonePossessionProvenAndVerifiedEvent $event): void |
| 156 | 156 | { |
| 157 | 157 | $this->saveRaSecondFactor( |
| 158 | - (string)$event->identityId, |
|
| 159 | - (string)$event->secondFactorId, |
|
| 158 | + (string) $event->identityId, |
|
| 159 | + (string) $event->secondFactorId, |
|
| 160 | 160 | 'sms', |
| 161 | - (string)$event->phoneNumber, |
|
| 161 | + (string) $event->phoneNumber, |
|
| 162 | 162 | $event->commonName, |
| 163 | 163 | $event->email, |
| 164 | 164 | ); |
@@ -167,10 +167,10 @@ discard block |
||
| 167 | 167 | public function applyGssfPossessionProvenEvent(GssfPossessionProvenEvent $event): void |
| 168 | 168 | { |
| 169 | 169 | $this->saveRaSecondFactor( |
| 170 | - (string)$event->identityId, |
|
| 171 | - (string)$event->secondFactorId, |
|
| 172 | - (string)$event->stepupProvider, |
|
| 173 | - (string)$event->gssfId, |
|
| 170 | + (string) $event->identityId, |
|
| 171 | + (string) $event->secondFactorId, |
|
| 172 | + (string) $event->stepupProvider, |
|
| 173 | + (string) $event->gssfId, |
|
| 174 | 174 | $event->commonName, |
| 175 | 175 | $event->email, |
| 176 | 176 | ); |
@@ -179,10 +179,10 @@ discard block |
||
| 179 | 179 | public function applyGssfPossessionProvenAndVerifiedEvent(GssfPossessionProvenAndVerifiedEvent $event): void |
| 180 | 180 | { |
| 181 | 181 | $this->saveRaSecondFactor( |
| 182 | - (string)$event->identityId, |
|
| 183 | - (string)$event->secondFactorId, |
|
| 184 | - (string)$event->stepupProvider, |
|
| 185 | - (string)$event->gssfId, |
|
| 182 | + (string) $event->identityId, |
|
| 183 | + (string) $event->secondFactorId, |
|
| 184 | + (string) $event->stepupProvider, |
|
| 185 | + (string) $event->gssfId, |
|
| 186 | 186 | $event->commonName, |
| 187 | 187 | $event->email, |
| 188 | 188 | ); |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | public function applyU2fDevicePossessionProvenEvent(U2fDevicePossessionProvenEvent $event): void |
| 195 | 195 | { |
| 196 | 196 | $this->saveRaSecondFactor( |
| 197 | - (string)$event->identityId, |
|
| 198 | - (string)$event->secondFactorId, |
|
| 197 | + (string) $event->identityId, |
|
| 198 | + (string) $event->secondFactorId, |
|
| 199 | 199 | 'u2f', |
| 200 | 200 | $event->keyHandle->getValue(), |
| 201 | 201 | $event->commonName, |
@@ -209,8 +209,8 @@ discard block |
||
| 209 | 209 | public function applyU2fDevicePossessionProvenAndVerifiedEvent(U2fDevicePossessionProvenAndVerifiedEvent $event,): void |
| 210 | 210 | { |
| 211 | 211 | $this->saveRaSecondFactor( |
| 212 | - (string)$event->identityId, |
|
| 213 | - (string)$event->secondFactorId, |
|
| 212 | + (string) $event->identityId, |
|
| 213 | + (string) $event->secondFactorId, |
|
| 214 | 214 | 'u2f', |
| 215 | 215 | $event->keyHandle->getValue(), |
| 216 | 216 | $event->commonName, |
@@ -263,13 +263,13 @@ discard block |
||
| 263 | 263 | */ |
| 264 | 264 | public function applySecondFactorMigratedEvent(SecondFactorMigratedEvent $event): void |
| 265 | 265 | { |
| 266 | - $oldSecondFactor = $this->raSecondFactorRepository->find((string)$event->secondFactorId); |
|
| 266 | + $oldSecondFactor = $this->raSecondFactorRepository->find((string) $event->secondFactorId); |
|
| 267 | 267 | |
| 268 | 268 | $this->saveRaSecondFactor( |
| 269 | - (string)$event->identityId, |
|
| 270 | - (string)$event->newSecondFactorId, |
|
| 271 | - (string)$event->secondFactorType, |
|
| 272 | - (string)$event->secondFactorIdentifier, |
|
| 269 | + (string) $event->identityId, |
|
| 270 | + (string) $event->newSecondFactorId, |
|
| 271 | + (string) $event->secondFactorType, |
|
| 272 | + (string) $event->secondFactorIdentifier, |
|
| 273 | 273 | $event->commonName, |
| 274 | 274 | $event->email, |
| 275 | 275 | $oldSecondFactor->status, |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | public function applySecondFactorVettedEvent(SecondFactorVettedEvent $event): void |
| 281 | 281 | { |
| 282 | - $secondFactor = $this->raSecondFactorRepository->find((string)$event->secondFactorId); |
|
| 282 | + $secondFactor = $this->raSecondFactorRepository->find((string) $event->secondFactorId); |
|
| 283 | 283 | $secondFactor->documentNumber = $event->vettingType->getDocumentNumber(); |
| 284 | 284 | $secondFactor->status = SecondFactorStatus::vetted(); |
| 285 | 285 | |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | public function applySecondFactorVettedWithoutTokenProofOfPossession( |
| 290 | 290 | SecondFactorVettedWithoutTokenProofOfPossession $event, |
| 291 | 291 | ): void { |
| 292 | - $secondFactor = $this->raSecondFactorRepository->find((string)$event->secondFactorId); |
|
| 292 | + $secondFactor = $this->raSecondFactorRepository->find((string) $event->secondFactorId); |
|
| 293 | 293 | |
| 294 | 294 | $documentNumber = null; |
| 295 | 295 | if ($event->vettingType instanceof OnPremiseVettingType) { |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | |
| 342 | 342 | private function updateStatus(SecondFactorId $secondFactorId, SecondFactorStatus $status): void |
| 343 | 343 | { |
| 344 | - $secondFactor = $this->raSecondFactorRepository->find((string)$secondFactorId); |
|
| 344 | + $secondFactor = $this->raSecondFactorRepository->find((string) $secondFactorId); |
|
| 345 | 345 | $secondFactor->status = $status; |
| 346 | 346 | |
| 347 | 347 | $this->raSecondFactorRepository->save($secondFactor); |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | public function applyIdentityAccreditedAsRaForInstitutionEvent(IdentityAccreditedAsRaForInstitutionEvent $event,): void |
| 54 | 54 | { |
| 55 | - $identity = $this->identityRepository->find((string)$event->identityId); |
|
| 55 | + $identity = $this->identityRepository->find((string) $event->identityId); |
|
| 56 | 56 | |
| 57 | 57 | $raListing = RaListing::create( |
| 58 | - (string)$event->identityId, |
|
| 58 | + (string) $event->identityId, |
|
| 59 | 59 | $event->identityInstitution, |
| 60 | 60 | $identity->commonName, |
| 61 | 61 | $identity->email, |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | public function applyIdentityAccreditedAsRaaForInstitutionEvent(IdentityAccreditedAsRaaForInstitutionEvent $event,): void |
| 72 | 72 | { |
| 73 | - $identity = $this->identityRepository->find((string)$event->identityId); |
|
| 73 | + $identity = $this->identityRepository->find((string) $event->identityId); |
|
| 74 | 74 | |
| 75 | 75 | $raListing = RaListing::create( |
| 76 | - (string)$event->identityId, |
|
| 76 | + (string) $event->identityId, |
|
| 77 | 77 | $event->identityInstitution, |
| 78 | 78 | $identity->commonName, |
| 79 | 79 | $identity->email, |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public function applyIdentityAccreditedAsRaEvent(IdentityAccreditedAsRaEvent $event): void |
| 152 | 152 | { |
| 153 | - $identity = $this->identityRepository->find((string)$event->identityId); |
|
| 153 | + $identity = $this->identityRepository->find((string) $event->identityId); |
|
| 154 | 154 | $raListing = RaListing::create( |
| 155 | - (string)$event->identityId, |
|
| 155 | + (string) $event->identityId, |
|
| 156 | 156 | $event->identityInstitution, |
| 157 | 157 | $identity->commonName, |
| 158 | 158 | $identity->email, |
@@ -172,9 +172,9 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | public function applyIdentityAccreditedAsRaaEvent(IdentityAccreditedAsRaaEvent $event): void |
| 174 | 174 | { |
| 175 | - $identity = $this->identityRepository->find((string)$event->identityId); |
|
| 175 | + $identity = $this->identityRepository->find((string) $event->identityId); |
|
| 176 | 176 | $raListing = RaListing::create( |
| 177 | - (string)$event->identityId, |
|
| 177 | + (string) $event->identityId, |
|
| 178 | 178 | $event->identityInstitution, |
| 179 | 179 | $identity->commonName, |
| 180 | 180 | $identity->email, |