Passed
Pull Request — main (#557)
by Johan
10:46 queued 05:30
created
src/Surfnet/Stepup/Identity/Collection/InstitutionCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
 
123 123
     public function serialize(): array
124 124
     {
125
-        return array_map(fn(Institution $institution): string => (string)$institution, $this->elements);
125
+        return array_map(fn(Institution $institution): string => (string) $institution, $this->elements);
126 126
     }
127 127
 
128 128
     /**
Please login to merge, or discard this patch.
StepupMiddleware/ApiBundle/Identity/Service/AbstractSearchService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      * @return Pagerfanta<T>
36 36
      */
37 37
     protected function createPaginatorFrom(
38
-        QueryBuilder|Query $doctrineQuery,
38
+        QueryBuilder | Query $doctrineQuery,
39 39
         AbstractQuery $query,
40 40
         bool $fetchCollection = true,
41 41
     ): Pagerfanta {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $results = $doctrineQuery->getArrayResult();
72 72
         foreach ($results as $options) {
73 73
             foreach ($options as $key => $value) {
74
-                $val = (string)$value;
74
+                $val = (string) $value;
75 75
                 $filters[$key][$val] = $val;
76 76
             }
77 77
         }
Please login to merge, or discard this patch.
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.