Passed
Push — main ( 1fbbbe...fd4d73 )
by Michiel
16:27 queued 12:04
created
StepupMiddleware/ApiBundle/Identity/Repository/AuthorizationRepository.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             ->where("r.identityId = :identityId AND r.role IN(:roles)")
73 73
             ->groupBy("a.institution");
74 74
 
75
-        $qb->setParameter('identityId', (string)$actorId);
75
+        $qb->setParameter('identityId', (string) $actorId);
76 76
         $qb->setParameter(
77 77
             'authorizationRoles',
78 78
             $this->getAllowedInstitutionRoles($role)
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             $this->logger->notice(
89 89
                 sprintf('Adding %s to authorized institutions', $institution['institution'])
90 90
             );
91
-            $result->add(new Institution((string)$institution['institution']));
91
+            $result->add(new Institution((string) $institution['institution']));
92 92
         }
93 93
 
94 94
         // Also get the institutions that are linked to the user via the 'institution_relation' field.
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
             ->andWhere("ia.institutionRole = :role") // Only filter on use_ra and use_raa roles here.
106 106
             ->groupBy('ia.institution');
107 107
 
108
-        $qb->setParameter('identityId', (string)$actorId);
108
+        $qb->setParameter('identityId', (string) $actorId);
109 109
         $qb->setParameter('role', $this->getInstitutionRoleByRaRole($role));
110 110
         $qb->setParameter('identityRoles', $identityRoles);
111 111
 
112 112
         $institutions = $qb->getQuery()->getArrayResult();
113 113
         foreach ($institutions as $institution) {
114
-            $institutionVo = new Institution((string)$institution['institution']);
114
+            $institutionVo = new Institution((string) $institution['institution']);
115 115
             if (!$result->contains($institutionVo)) {
116 116
                 $result->add($institutionVo);
117 117
                 $this->logger->notice(
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             ->where('ia.institutionRole = :institutionRole AND ra.role = :authorizationRole')
139 139
             ->groupBy("ci.institution");
140 140
 
141
-        $qb->setParameter('identityId', (string)$actorId);
141
+        $qb->setParameter('identityId', (string) $actorId);
142 142
         // The identity requires RAA role to perform this search
143 143
         $qb->setParameter(
144 144
             'authorizationRole',
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
         $result = new InstitutionCollection();
156 156
         foreach ($institutions as $institution) {
157
-            $result->add(new Institution((string)$institution['institution']));
157
+            $result->add(new Institution((string) $institution['institution']));
158 158
         }
159 159
 
160 160
         return $result;
Please login to merge, or discard this patch.
ApiBundle/Authorization/Service/AuthorizationContextService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             $institutions = new InstitutionCollection();
94 94
             $configuredInstitutions = $this->institutionRepository->findAll();
95 95
             foreach ($configuredInstitutions as $institution) {
96
-                $institutions->add(new Institution((string)$institution->institution));
96
+                $institutions->add(new Institution((string) $institution->institution));
97 97
             }
98 98
         } else {
99 99
             // Get the institutions the identity is RA(A) for.
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
     private function isSraa(IdentityId $actorId)
106 106
     {
107
-        $identity = $this->identityService->find((string)$actorId);
107
+        $identity = $this->identityService->find((string) $actorId);
108 108
         if (!$identity) {
109 109
             throw new InvalidArgumentException('The provided id is not associated with any known identity');
110 110
         }
Please login to merge, or discard this patch.
tests/database/AuthorizationRepositoryMatrixTest.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
         $institutions = [];
124 124
         /** @var Institution $institution */
125
-        foreach($collection->jsonSerialize()['institutions'] as $institution)
125
+        foreach ($collection->jsonSerialize()['institutions'] as $institution)
126 126
         {
127 127
             $institutions[] = $institution->getInstitution();
128 128
         }
Please login to merge, or discard this patch.