@@ -45,18 +45,18 @@ |
||
| 45 | 45 | |
| 46 | 46 | /** @var Institution $institution */ |
| 47 | 47 | foreach ($raInstitutions as $institution) { |
| 48 | - $collection->authorizations[(string)$institution][] = AuthorityRole::ROLE_RA; |
|
| 48 | + $collection->authorizations[(string) $institution][] = AuthorityRole::ROLE_RA; |
|
| 49 | 49 | } |
| 50 | 50 | if ($raaInstitutions instanceof InstitutionCollection) { |
| 51 | 51 | /** @var Institution $institution */ |
| 52 | 52 | foreach ($raaInstitutions as $institution) { |
| 53 | 53 | // Override existing lower role |
| 54 | - if (isset($collection->authorizations[(string)$institution]) |
|
| 55 | - && in_array(AuthorityRole::ROLE_RA, $collection->authorizations[(string)$institution]) |
|
| 54 | + if (isset($collection->authorizations[(string) $institution]) |
|
| 55 | + && in_array(AuthorityRole::ROLE_RA, $collection->authorizations[(string) $institution]) |
|
| 56 | 56 | ) { |
| 57 | - $collection->authorizations[(string)$institution] = []; |
|
| 57 | + $collection->authorizations[(string) $institution] = []; |
|
| 58 | 58 | } |
| 59 | - $collection->authorizations[(string)$institution][] = AuthorityRole::ROLE_RAA; |
|
| 59 | + $collection->authorizations[(string) $institution][] = AuthorityRole::ROLE_RAA; |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | return $collection; |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | foreach ($configuration as $institution => $options) { |
| 130 | 130 | assert(is_array($options)); |
| 131 | 131 | $command = new ReconfigureInstitutionConfigurationOptionsCommand(); |
| 132 | - $command->UUID = (string)Uuid::uuid4(); |
|
| 132 | + $command->UUID = (string) Uuid::uuid4(); |
|
| 133 | 133 | $command->institution = $institution; |
| 134 | 134 | $command->useRaLocationsOption = $options['use_ra_locations']; |
| 135 | 135 | $command->showRaaContactInformationOption = $options['show_raa_contact_information']; |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | if ($query->identityId instanceof IdentityId) { |
| 51 | 51 | $queryBuilder |
| 52 | 52 | ->andWhere('sf.identityId = :identityId') |
| 53 | - ->setParameter('identityId', (string)$query->identityId); |
|
| 53 | + ->setParameter('identityId', (string) $query->identityId); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $queryBuilder->getQuery(); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | $metadata = $domainMessage->getMetadata()->serialize(); |
| 84 | 84 | $entry = new AuditLogEntry(); |
| 85 | - $entry->id = (string)Uuid::uuid4(); |
|
| 85 | + $entry->id = (string) Uuid::uuid4(); |
|
| 86 | 86 | |
| 87 | 87 | if (isset($metadata['actorId'])) { |
| 88 | 88 | $actor = $this->identityRepository->find($metadata['actorId']); |
@@ -106,36 +106,36 @@ discard block |
||
| 106 | 106 | $entry->actorInstitution = new Institution($metadata['actorInstitution']); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $entry->identityId = (string)$auditLogMetadata->identityId; |
|
| 109 | + $entry->identityId = (string) $auditLogMetadata->identityId; |
|
| 110 | 110 | $entry->identityInstitution = $auditLogMetadata->identityInstitution; |
| 111 | 111 | $entry->event = $event::class; |
| 112 | 112 | $entry->recordedOn = new DateTime(new CoreDateTime($domainMessage->getRecordedOn()->toString())); |
| 113 | 113 | |
| 114 | 114 | if ($auditLogMetadata->secondFactorId instanceof SecondFactorId) { |
| 115 | - $entry->secondFactorId = (string)$auditLogMetadata->secondFactorId; |
|
| 115 | + $entry->secondFactorId = (string) $auditLogMetadata->secondFactorId; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if ($auditLogMetadata->secondFactorType instanceof SecondFactorType) { |
| 119 | - $entry->secondFactorType = (string)$auditLogMetadata->secondFactorType; |
|
| 119 | + $entry->secondFactorType = (string) $auditLogMetadata->secondFactorType; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (!$event instanceof RecoveryTokenRevokedEvent |
| 123 | 123 | && !$event instanceof CompliedWithRecoveryCodeRevocationEvent |
| 124 | 124 | && $auditLogMetadata->recoveryTokenId |
| 125 | 125 | ) { |
| 126 | - $entry->recoveryTokenIdentifier = (string)$auditLogMetadata->recoveryTokenId; |
|
| 126 | + $entry->recoveryTokenIdentifier = (string) $auditLogMetadata->recoveryTokenId; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if ($auditLogMetadata->recoveryTokenType instanceof RecoveryTokenType) { |
| 130 | - $entry->recoveryTokenType = (string)$auditLogMetadata->recoveryTokenType; |
|
| 130 | + $entry->recoveryTokenType = (string) $auditLogMetadata->recoveryTokenType; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if ($auditLogMetadata->secondFactorIdentifier instanceof SecondFactorIdentifier) { |
| 134 | - $entry->secondFactorIdentifier = (string)$auditLogMetadata->secondFactorIdentifier; |
|
| 134 | + $entry->secondFactorIdentifier = (string) $auditLogMetadata->secondFactorIdentifier; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if ($auditLogMetadata->raInstitution instanceof Institution) { |
| 138 | - $entry->raInstitution = (string)$auditLogMetadata->raInstitution; |
|
| 138 | + $entry->raInstitution = (string) $auditLogMetadata->raInstitution; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $this->auditLogRepository->save($entry); |
@@ -45,14 +45,14 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | public function findByIdentityId(IdentityId $identityId): ?array |
| 47 | 47 | { |
| 48 | - return parent::findBy(['identityId' => (string)$identityId]); |
|
| 48 | + return parent::findBy(['identityId' => (string) $identityId]); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function findByIdentityIdAndRaInstitution(IdentityId $identityId, Institution $raInstitution): ?RaListing |
| 52 | 52 | { |
| 53 | 53 | return parent::findOneBy([ |
| 54 | - 'identityId' => (string)$identityId, |
|
| 55 | - 'raInstitution' => (string)$raInstitution, |
|
| 54 | + 'identityId' => (string) $identityId, |
|
| 55 | + 'raInstitution' => (string) $raInstitution, |
|
| 56 | 56 | ]); |
| 57 | 57 | } |
| 58 | 58 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ->where('r.identityId = :identityId') |
| 66 | 66 | ->andWhere('r.raInstitution = :raInstitution') |
| 67 | 67 | ->setParameter('identityId', $identityId) |
| 68 | - ->setParameter('raInstitution', (string)$raInstitution) |
|
| 68 | + ->setParameter('raInstitution', (string) $raInstitution) |
|
| 69 | 69 | ->orderBy('r.raInstitution'); |
| 70 | 70 | |
| 71 | 71 | // Modify query to filter on authorization: |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | public function findByIdentityIdAndInstitution(IdentityId $identityId, Institution $institution): array |
| 89 | 89 | { |
| 90 | 90 | return parent::findBy([ |
| 91 | - 'identityId' => (string)$identityId, |
|
| 92 | - 'institution' => (string)$institution, |
|
| 91 | + 'identityId' => (string) $identityId, |
|
| 92 | + 'institution' => (string) $institution, |
|
| 93 | 93 | ]); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | if ($query->identityId instanceof IdentityId) { |
| 117 | 117 | $queryBuilder |
| 118 | 118 | ->andWhere('r.identityId = :identityId') |
| 119 | - ->setParameter('identityId', (string)$query->identityId); |
|
| 119 | + ->setParameter('identityId', (string) $query->identityId); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if ($query->name) { |
@@ -240,6 +240,6 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | public function contains(IdentityId $identityId): bool |
| 242 | 242 | { |
| 243 | - return count(parent::findBy(['identityId' => (string)$identityId])) > 0; |
|
| 243 | + return count(parent::findBy(['identityId' => (string) $identityId])) > 0; |
|
| 244 | 244 | } |
| 245 | 245 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | if ($query->identityId instanceof IdentityId) { |
| 54 | 54 | $queryBuilder |
| 55 | 55 | ->andWhere('sf.identityId = :identityId') |
| 56 | - ->setParameter('identityId', (string)$query->identityId); |
|
| 56 | + ->setParameter('identityId', (string) $query->identityId); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | if ($query->verificationNonce) { |
@@ -76,13 +76,13 @@ discard block |
||
| 76 | 76 | if ($query->identityId instanceof IdentityId) { |
| 77 | 77 | $queryBuilder |
| 78 | 78 | ->andWhere('sf.identityId = :identityId') |
| 79 | - ->setParameter('identityId', (string)$query->identityId); |
|
| 79 | + ->setParameter('identityId', (string) $query->identityId); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | if ($query->secondFactorId instanceof SecondFactorId) { |
| 83 | 83 | $queryBuilder |
| 84 | 84 | ->andWhere('sf.id = :secondFactorId') |
| 85 | - ->setParameter('secondFactorId', (string)$query->secondFactorId); |
|
| 85 | + ->setParameter('secondFactorId', (string) $query->secondFactorId); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | if (is_string($query->registrationCode)) { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | $queryBuilder |
| 111 | 111 | ->andWhere('sf.identityId = :identityId') |
| 112 | - ->setParameter('identityId', (string)$query->identityId); |
|
| 112 | + ->setParameter('identityId', (string) $query->identityId); |
|
| 113 | 113 | |
| 114 | 114 | return $queryBuilder->getQuery(); |
| 115 | 115 | } |
@@ -168,18 +168,18 @@ |
||
| 168 | 168 | { |
| 169 | 169 | return [ |
| 170 | 170 | 'actor_id' => $this->actorId, |
| 171 | - 'actor_institution' => $this->actorInstitution instanceof Institution ? (string)$this->actorInstitution : null, |
|
| 172 | - 'actor_common_name' => (string)$this->actorCommonName, |
|
| 171 | + 'actor_institution' => $this->actorInstitution instanceof Institution ? (string) $this->actorInstitution : null, |
|
| 172 | + 'actor_common_name' => (string) $this->actorCommonName, |
|
| 173 | 173 | 'identity_id' => $this->identityId, |
| 174 | - 'identity_institution' => (string)$this->identityInstitution, |
|
| 175 | - 'ra_institution' => (string)$this->raInstitution, |
|
| 174 | + 'identity_institution' => (string) $this->identityInstitution, |
|
| 175 | + 'ra_institution' => (string) $this->raInstitution, |
|
| 176 | 176 | 'second_factor_id' => $this->secondFactorId, |
| 177 | 177 | 'second_factor_type' => $this->secondFactorType ?: null, |
| 178 | 178 | 'second_factor_identifier' => $this->secondFactorIdentifier, |
| 179 | 179 | 'recovery_token_type' => $this->recoveryTokenType, |
| 180 | 180 | 'recovery_token_identifier' => $this->recoveryTokenIdentifier, |
| 181 | 181 | 'action' => $this->mapEventToAction($this->event), |
| 182 | - 'recorded_on' => (string)$this->recordedOn, |
|
| 182 | + 'recorded_on' => (string) $this->recordedOn, |
|
| 183 | 183 | ]; |
| 184 | 184 | } |
| 185 | 185 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | sprintf( |
| 52 | 52 | "Encountered illegal second factor status of type %s '%s', expected a SecondFactorStatus instance", |
| 53 | 53 | get_debug_type($value), |
| 54 | - is_scalar($value) ? (string)$value : '', |
|
| 54 | + is_scalar($value) ? (string) $value : '', |
|
| 55 | 55 | ), |
| 56 | 56 | ); |
| 57 | 57 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | return 40; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - throw new ConversionException(sprintf("Encountered inconvertible second factor status '%s'", (string)$value)); |
|
| 71 | + throw new ConversionException(sprintf("Encountered inconvertible second factor status '%s'", (string) $value)); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | public function convertToPHPValue(mixed $value, AbstractPlatform $platform): SecondFactorStatus |
| 78 | 78 | { |
| 79 | 79 | if (is_scalar($value)) { |
| 80 | - $value = (string)$value; |
|
| 80 | + $value = (string) $value; |
|
| 81 | 81 | } |
| 82 | 82 | if ($value === '0') { |
| 83 | 83 | return SecondFactorStatus::unverified(); |