@@ -31,6 +31,10 @@ discard block |
||
31 | 31 | ->end(); |
32 | 32 | } |
33 | 33 | |
34 | + /** |
|
35 | + * @param string $id |
|
36 | + * @param string $userProvider |
|
37 | + */ |
|
34 | 38 | protected function createAuthenticationProvider(ContainerBuilder $container, $id, $userProvider) |
35 | 39 | { |
36 | 40 | $providerId = 'security.authentication.provider.' . $this->key . '.' . $id; |
@@ -41,6 +45,10 @@ discard block |
||
41 | 45 | return $providerId; |
42 | 46 | } |
43 | 47 | |
48 | + /** |
|
49 | + * @param string $id |
|
50 | + * @param string $defaultEntryPoint |
|
51 | + */ |
|
44 | 52 | protected function createEntryPoint(ContainerBuilder $container, $id, $defaultEntryPoint) |
45 | 53 | { |
46 | 54 | if (null !== $defaultEntryPoint) { |
@@ -51,6 +59,9 @@ discard block |
||
51 | 59 | return $entryPointId; |
52 | 60 | } |
53 | 61 | |
62 | + /** |
|
63 | + * @param string $id |
|
64 | + */ |
|
54 | 65 | protected function createListener(ContainerBuilder $container, $id, $defaultRoles) |
55 | 66 | { |
56 | 67 | $listenerId = 'security.authentication.listener.' . $this->key . '.' . $id; |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | 'display_name' => $token->getUser()->getDisplayName(), |
160 | 160 | 'affiliation' => $token->getUser()->getAffiliation(), |
161 | 161 | 'attributes' => $token->getUser()->getAttributes(), |
162 | - 'roles' => array_map(function (RoleInterface $role) { |
|
162 | + 'roles' => array_map(function(RoleInterface $role) { |
|
163 | 163 | return $role->getRole(); |
164 | 164 | }, $token->getRoles()), |
165 | - 'inherited_roles' => array_map(function (RoleInterface $role) { |
|
165 | + 'inherited_roles' => array_map(function(RoleInterface $role) { |
|
166 | 166 | return $role->getRole(); |
167 | 167 | }, $this->findInheritedRoles($token->getRoles())), |
168 | 168 | 'supports_role_hierarchy' => null !== $this->roleHierarchy, |
@@ -188,10 +188,10 @@ discard block |
||
188 | 188 | 'source_affiliation' => $source->getUser()->getAffiliation(), |
189 | 189 | 'source_display_name' => $source->getUser()->getDisplayName(), |
190 | 190 | 'source_attributes' => $source->getUser()->getAttributes(), |
191 | - 'source_roles' => array_map(function (RoleInterface $role) { |
|
191 | + 'source_roles' => array_map(function(RoleInterface $role) { |
|
192 | 192 | return $role->getRole(); |
193 | 193 | }, $source->getRoles()), |
194 | - 'source_inherited_roles' => array_map(function (RoleInterface $role) { |
|
194 | + 'source_inherited_roles' => array_map(function(RoleInterface $role) { |
|
195 | 195 | return $role->getRole(); |
196 | 196 | }, $this->findInheritedRoles($source->getRoles())), |
197 | 197 | ]); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | throw new \Exception('Could not get person data for ' . $uid . ': ' . json_encode($decodedOutput)); |
35 | 35 | } |
36 | 36 | $user = $decodedOutput->d; |
37 | - $mainWorkAddresses = array_filter($user->WorkAddresses->results, function (\stdClass $value) { |
|
37 | + $mainWorkAddresses = array_filter($user->WorkAddresses->results, function(\stdClass $value) { |
|
38 | 38 | return $value->isMainWorkAddress; |
39 | 39 | }); |
40 | 40 | $mainWorkAddress = reset($mainWorkAddresses); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | } |
124 | 124 | foreach ($aliases as $alias) { |
125 | - $attributeDefinitions[$alias] =& $attributeDefinitions[$id]; |
|
125 | + $attributeDefinitions[$alias] = & $attributeDefinitions[$id]; |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | } |
138 | 138 | $attributeDefinitions[$id] = $attributeDefinition; |
139 | 139 | foreach ($aliases as $alias) { |
140 | - $attributeDefinitions[$alias] =& $attributeDefinitions[$id]; |
|
140 | + $attributeDefinitions[$alias] = & $attributeDefinitions[$id]; |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 |
@@ -83,7 +83,7 @@ |
||
83 | 83 | $ldapSingleResult = $ldapResults->toArray()['0']; |
84 | 84 | // Extract attributes as strings |
85 | 85 | $attributes = $ldapSingleResult->getAttributes(); |
86 | - array_walk($attributes, function (&$value) { |
|
86 | + array_walk($attributes, function(&$value) { |
|
87 | 87 | $value = (is_array($value) ? implode(';', $value) : $value); |
88 | 88 | }); |
89 | 89 | // Save to the session (cache) |
@@ -55,7 +55,7 @@ |
||
55 | 55 | } |
56 | 56 | $server = $event->getRequest()->server; |
57 | 57 | $providerPropertiesCollectionIterator = $this->providerPropertiesCollection->getIterator(); |
58 | - $providerPropertiesCollectionIterator->uasort(function ($first, $second) { |
|
58 | + $providerPropertiesCollectionIterator->uasort(function($first, $second) { |
|
59 | 59 | // Place highest priority first |
60 | 60 | if ($first['priority'] === $second['priority']) { |
61 | 61 | return 0; |
@@ -104,7 +104,9 @@ |
||
104 | 104 | */ |
105 | 105 | public function hasAttributeValue($name, $value = null) |
106 | 106 | { |
107 | - if (!$this->hasAttribute($name)) return false; |
|
107 | + if (!$this->hasAttribute($name)) { |
|
108 | + return false; |
|
109 | + } |
|
108 | 110 | return (empty($value) ? true : (array_search($value, $this->getArrayAttribute($name)) !== false)); |
109 | 111 | } |
110 | 112 |