Passed
Push — feature/updates-nov25 ( 88ec4d...7756b8 )
by Johan
05:21
created
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.
StepupMiddleware/ApiBundle/Doctrine/Type/RecoveryTokenStatusType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                 sprintf(
46 46
                     "Encountered illegal recovery token status of type %s '%s', expected a RecoveryTokenStatus instance",
47 47
                     get_debug_type($value),
48
-                    is_scalar($value) ? (string)$value : '',
48
+                    is_scalar($value) ? (string) $value : '',
49 49
                 ),
50 50
             );
51 51
         }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             return 20;
59 59
         }
60 60
 
61
-        throw new ConversionException(sprintf("Encountered inconvertible second factor status '%s'", (string)$value));
61
+        throw new ConversionException(sprintf("Encountered inconvertible second factor status '%s'", (string) $value));
62 62
     }
63 63
 
64 64
     /**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     public function convertToPHPValue(mixed $value, AbstractPlatform $platform): RecoveryTokenStatus
68 68
     {
69 69
         if (is_scalar($value)) {
70
-            $value = (string)$value;
70
+            $value = (string) $value;
71 71
         }
72 72
 
73 73
         if ($value === '0') {
Please login to merge, or discard this patch.
ManagementBundle/Validator/ReconfigureInstitutionRequestValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         }
236 236
 
237 237
         $this->whitelistedInstitutions = array_map(
238
-            fn(WhitelistEntry $whitelistEntry): string => (string)$whitelistEntry->institution,
238
+            fn(WhitelistEntry $whitelistEntry): string => (string) $whitelistEntry->institution,
239 239
             $this->whitelistService->getAllEntries()->toArray(),
240 240
         );
241 241
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
         return array_filter(
258 258
             $institutions,
259
-            function ($institution) use ($normalizedConfiguredInstitutions): bool {
259
+            function($institution) use ($normalizedConfiguredInstitutions): bool {
260 260
                 $normalizedInstitution = strtolower($institution);
261 261
 
262 262
                 return !in_array($normalizedInstitution, $normalizedConfiguredInstitutions);
Please login to merge, or discard this patch.