Passed
Pull Request — main (#557)
by Johan
10:46 queued 05:30
created
ApiBundle/Identity/Value/AuthorizedInstitutionCollection.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,18 +45,18 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
ManagementBundle/Controller/InstitutionConfigurationController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
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'];
Please login to merge, or discard this patch.
ApiBundle/Identity/Repository/VettedSecondFactorRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/AuditLogProjector.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
StepupMiddleware/ApiBundle/Identity/Repository/RaListingRepository.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
ApiBundle/Identity/Repository/UnverifiedSecondFactorRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
ApiBundle/Identity/Repository/VerifiedSecondFactorRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Surfnet/StepupMiddleware/ApiBundle/Identity/Entity/AuditLogEntry.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -168,18 +168,18 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SecondFactorStatusType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.