Passed
Push — main ( bdc8b9...a0d26b )
by Peter
08:37 queued 03:46
created
StepupMiddleware/ApiBundle/Identity/Projector/RaListingProjector.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,
Please login to merge, or discard this patch.
StepupMiddleware/ApiBundle/Identity/Projector/RecoveryTokenProjector.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $recoveryToken->identityId = $event->identityId->getIdentityId();
46 46
         $recoveryToken->type = RecoveryTokenType::TYPE_SMS;
47 47
         $recoveryToken->status = RecoveryTokenStatus::active();
48
-        $recoveryToken->recoveryMethodIdentifier = (string)$event->phoneNumber;
48
+        $recoveryToken->recoveryMethodIdentifier = (string) $event->phoneNumber;
49 49
         $recoveryToken->institution = $event->identityInstitution;
50 50
         $recoveryToken->email = $event->email;
51 51
         $recoveryToken->name = $event->commonName;
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $recoveryToken->identityId = $event->identityId->getIdentityId();
62 62
         $recoveryToken->type = RecoveryTokenType::TYPE_SAFE_STORE;
63 63
         $recoveryToken->status = RecoveryTokenStatus::active();
64
-        $recoveryToken->recoveryMethodIdentifier = (string)$event->secret;
64
+        $recoveryToken->recoveryMethodIdentifier = (string) $event->secret;
65 65
         $recoveryToken->institution = $event->identityInstitution;
66 66
         $recoveryToken->email = $event->email;
67 67
         $recoveryToken->name = $event->commonName;
@@ -71,14 +71,14 @@  discard block
 block discarded – undo
71 71
 
72 72
     public function applyCompliedWithRecoveryCodeRevocationEvent(CompliedWithRecoveryCodeRevocationEvent $event): void
73 73
     {
74
-        $token = $this->recoveryTokenRepository->find((string)$event->recoveryTokenId);
74
+        $token = $this->recoveryTokenRepository->find((string) $event->recoveryTokenId);
75 75
         $token->status = RecoveryTokenStatus::revoked();
76 76
         $this->recoveryTokenRepository->save($token);
77 77
     }
78 78
 
79 79
     public function applyRecoveryTokenRevokedEvent(RecoveryTokenRevokedEvent $event): void
80 80
     {
81
-        $token = $this->recoveryTokenRepository->find((string)$event->recoveryTokenId);
81
+        $token = $this->recoveryTokenRepository->find((string) $event->recoveryTokenId);
82 82
         $token->status = RecoveryTokenStatus::revoked();
83 83
         $this->recoveryTokenRepository->save($token);
84 84
     }
Please login to merge, or discard this patch.
Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/IdentityProjector.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     {
41 41
         $this->identityRepository->save(
42 42
             Identity::create(
43
-                (string)$event->identityId,
43
+                (string) $event->identityId,
44 44
                 $event->identityInstitution,
45 45
                 $event->nameId,
46 46
                 $event->email,
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
     public function applyIdentityRenamedEvent(IdentityRenamedEvent $event): void
54 54
     {
55
-        $identity = $this->identityRepository->find((string)$event->identityId);
55
+        $identity = $this->identityRepository->find((string) $event->identityId);
56 56
         $identity->commonName = $event->commonName;
57 57
 
58 58
         $this->identityRepository->save($identity);
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
     public function applyIdentityEmailChangedEvent(IdentityEmailChangedEvent $event): void
62 62
     {
63
-        $identity = $this->identityRepository->find((string)$event->identityId);
63
+        $identity = $this->identityRepository->find((string) $event->identityId);
64 64
         $identity->email = $event->email;
65 65
 
66 66
         $this->identityRepository->save($identity);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
     public function applyLocalePreferenceExpressedEvent(LocalePreferenceExpressedEvent $event): void
70 70
     {
71
-        $identity = $this->identityRepository->find((string)$event->identityId);
71
+        $identity = $this->identityRepository->find((string) $event->identityId);
72 72
         $identity->preferredLocale = $event->preferredLocale;
73 73
 
74 74
         $this->identityRepository->save($identity);
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
 
77 77
     public function applySecondFactorVettedEvent(SecondFactorVettedEvent $event): void
78 78
     {
79
-        $this->determinePossessionOfSelfAssertedToken($event->vettingType, (string)$event->identityId);
79
+        $this->determinePossessionOfSelfAssertedToken($event->vettingType, (string) $event->identityId);
80 80
     }
81 81
 
82 82
     public function applySecondFactorVettedWithoutTokenProofOfPossession(
83 83
         SecondFactorVettedWithoutTokenProofOfPossession $event,
84 84
     ): void {
85
-        $this->determinePossessionOfSelfAssertedToken($event->vettingType, (string)$event->identityId);
85
+        $this->determinePossessionOfSelfAssertedToken($event->vettingType, (string) $event->identityId);
86 86
     }
87 87
 
88 88
     private function determinePossessionOfSelfAssertedToken(VettingType $vettingType, string $identityId): void
Please login to merge, or discard this patch.
StepupMiddleware/ApiBundle/Identity/Repository/RaListingRepository.php 1 patch
Spacing   +9 added lines, -9 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) {
@@ -134,13 +134,13 @@  discard block
 block discarded – undo
134 134
         if ($query->role) {
135 135
             $queryBuilder
136 136
                 ->andWhere('r.role = :role')
137
-                ->setParameter('role', (string)$query->role);
137
+                ->setParameter('role', (string) $query->role);
138 138
         }
139 139
 
140 140
         if ($query->raInstitution) {
141 141
             $queryBuilder
142 142
                 ->andWhere('r.raInstitution = :raInstitution')
143
-                ->setParameter('raInstitution', (string)$query->raInstitution);
143
+                ->setParameter('raInstitution', (string) $query->raInstitution);
144 144
         }
145 145
 
146 146
         // Modify query to filter on authorization:
Please login to merge, or discard this patch.
StepupMiddleware/ApiBundle/Identity/Repository/WhitelistEntryRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
             ->getQuery()
100 100
             ->getSingleScalarResult();
101 101
 
102
-        return (bool)$count;
102
+        return (bool) $count;
103 103
     }
104 104
 
105 105
     /**
Please login to merge, or discard this patch.
StepupMiddleware/ApiBundle/Identity/Repository/AuthorizationRepository.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             ->where("r.identityId = :identityId AND r.role IN(:roles)")
71 71
             ->groupBy("a.institution");
72 72
 
73
-        $qb->setParameter('identityId', (string)$actorId);
73
+        $qb->setParameter('identityId', (string) $actorId);
74 74
         $qb->setParameter(
75 75
             'authorizationRoles',
76 76
             $this->getAllowedInstitutionRoles($role),
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             $this->logger->notice(
87 87
                 sprintf('Adding %s to authorized institutions', $institution['institution']),
88 88
             );
89
-            $result->add(new Institution((string)$institution['institution']));
89
+            $result->add(new Institution((string) $institution['institution']));
90 90
         }
91 91
 
92 92
         // Also get the institutions that are linked to the user via the 'institution_relation' field.
@@ -108,13 +108,13 @@  discard block
 block discarded – undo
108 108
             ->andWhere("ia.institutionRole = :role") // Only filter on use_ra and use_raa roles here.
109 109
             ->groupBy('ia.institution');
110 110
 
111
-        $qb->setParameter('identityId', (string)$actorId);
111
+        $qb->setParameter('identityId', (string) $actorId);
112 112
         $qb->setParameter('role', $this->getInstitutionRoleByRaRole($role));
113 113
         $qb->setParameter('identityRoles', $identityRoles);
114 114
 
115 115
         $institutions = $qb->getQuery()->getArrayResult();
116 116
         foreach ($institutions as $institution) {
117
-            $institutionVo = new Institution((string)$institution['institution']);
117
+            $institutionVo = new Institution((string) $institution['institution']);
118 118
             if (!$result->contains($institutionVo)) {
119 119
                 $result->add($institutionVo);
120 120
                 $this->logger->notice(
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             ->where('ia.institutionRole = :institutionRole AND ra.role = :authorizationRole')
146 146
             ->groupBy("ci.institution");
147 147
 
148
-        $qb->setParameter('identityId', (string)$actorId);
148
+        $qb->setParameter('identityId', (string) $actorId);
149 149
         // The identity requires RAA role to perform this search
150 150
         $qb->setParameter(
151 151
             'authorizationRole',
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 
162 162
         $result = new InstitutionCollection();
163 163
         foreach ($institutions as $institution) {
164
-            $result->add(new Institution((string)$institution['institution']));
164
+            $result->add(new Institution((string) $institution['institution']));
165 165
         }
166 166
 
167 167
         return $result;
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 \Surfnet\Stepup\Identity\Value\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/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 \Surfnet\Stepup\Identity\Value\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.
ApiBundle/Identity/Repository/VerifiedSecondFactorRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
         if ($query->identityId instanceof \Surfnet\Stepup\Identity\Value\IdentityId) {
79 79
             $queryBuilder
80 80
                 ->andWhere('sf.identityId = :identityId')
81
-                ->setParameter('identityId', (string)$query->identityId);
81
+                ->setParameter('identityId', (string) $query->identityId);
82 82
         }
83 83
 
84 84
         if ($query->secondFactorId instanceof \Surfnet\Stepup\Identity\Value\SecondFactorId) {
85 85
             $queryBuilder
86 86
                 ->andWhere('sf.id = :secondFactorId')
87
-                ->setParameter('secondFactorId', (string)$query->secondFactorId);
87
+                ->setParameter('secondFactorId', (string) $query->secondFactorId);
88 88
         }
89 89
 
90 90
         if (is_string($query->registrationCode)) {
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
         $queryBuilder
113 113
             ->andWhere('sf.identityId = :identityId')
114
-            ->setParameter('identityId', (string)$query->identityId);
114
+            ->setParameter('identityId', (string) $query->identityId);
115 115
 
116 116
         return $queryBuilder->getQuery();
117 117
     }
Please login to merge, or discard this patch.