@@ -36,24 +36,24 @@ |
||
36 | 36 | private $filterManager; |
37 | 37 | |
38 | 38 | public function __construct( |
39 | - $formManager, |
|
40 | - $repositories, |
|
41 | - $filterManager |
|
39 | + $formManager, |
|
40 | + $repositories, |
|
41 | + $filterManager |
|
42 | 42 | ) |
43 | 43 | { |
44 | - $this->formManager = $formManager; |
|
45 | - $this->repositories = $repositories; |
|
46 | - $this->filterManager = $filterManager; |
|
44 | + $this->formManager = $formManager; |
|
45 | + $this->repositories = $repositories; |
|
46 | + $this->filterManager = $filterManager; |
|
47 | 47 | } |
48 | 48 | |
49 | - static public function factory(ContainerInterface $container) |
|
50 | - { |
|
51 | - return new self( |
|
52 | - $container->get('FormElementManager'), |
|
53 | - $container->get('repositories'), |
|
54 | - $container->get('FilterManager') |
|
55 | - ); |
|
56 | - } |
|
49 | + static public function factory(ContainerInterface $container) |
|
50 | + { |
|
51 | + return new self( |
|
52 | + $container->get('FormElementManager'), |
|
53 | + $container->get('repositories'), |
|
54 | + $container->get('FilterManager') |
|
55 | + ); |
|
56 | + } |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Register the default events for this controller |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | $events->attach( |
77 | 77 | MvcEvent::EVENT_DISPATCH, |
78 | - function ($event) { |
|
78 | + function($event) { |
|
79 | 79 | $routeMatch = $event->getRouteMatch(); |
80 | 80 | $action = $routeMatch->getParam('action'); |
81 | 81 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | $events->attach( |
97 | 97 | MvcEvent::EVENT_DISPATCH, |
98 | - function ($event) { |
|
98 | + function($event) { |
|
99 | 99 | $model = $event->getResult(); |
100 | 100 | if (!$model instanceof ViewModel || $model->terminate()) { |
101 | 101 | return; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $users = $repository->findByQuery($query); |
224 | 224 | |
225 | 225 | $userFilter = $this->filterManager->get('Auth/Entity/UserToSearchResult'); |
226 | - $filterFunc = function ($user) use ($userFilter) { |
|
226 | + $filterFunc = function($user) use ($userFilter) { |
|
227 | 227 | return $userFilter->filter($user); |
228 | 228 | }; |
229 | 229 | $result = array_values(array_map($filterFunc, $users->toArray())); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | class SocialProfiles extends AbstractPlugin |
18 | 18 | { |
19 | - protected $hybridAuth; |
|
19 | + protected $hybridAuth; |
|
20 | 20 | |
21 | 21 | protected $adapterMap = array( |
22 | 22 | 'facebook' => '\\Auth\\Controller\\Plugin\\SocialProfiles\\Facebook', |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | |
26 | 26 | ); |
27 | 27 | |
28 | - /** |
|
29 | - * @var RequestInterface |
|
30 | - */ |
|
28 | + /** |
|
29 | + * @var RequestInterface |
|
30 | + */ |
|
31 | 31 | protected $request; |
32 | 32 | |
33 | 33 | public function __construct($hybridAuth,RequestInterface $request,array $adapters = array()) |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | protected $request; |
32 | 32 | |
33 | - public function __construct($hybridAuth,RequestInterface $request,array $adapters = array()) |
|
33 | + public function __construct($hybridAuth, RequestInterface $request, array $adapters = array()) |
|
34 | 34 | { |
35 | 35 | $this->hybridAuth = $hybridAuth; |
36 | 36 | $this->request = $request; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | throw new \InvalidArgumentException( |
71 | 71 | sprintf( |
72 | 72 | 'Adapter must be either a string or an instance of \Auth\Controller\Plugin\SocialProfiles\AbstractAdapter, but received %s', |
73 | - is_object($adapter) ? get_class($adapter) : '(' . gettype($adapter) . ')' |
|
73 | + is_object($adapter) ? get_class($adapter) : '('.gettype($adapter).')' |
|
74 | 74 | ) |
75 | 75 | ); |
76 | 76 | } |
@@ -16,12 +16,12 @@ |
||
16 | 16 | |
17 | 17 | class SocialProfilesFactory implements FactoryInterface |
18 | 18 | { |
19 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
20 | - { |
|
21 | - $request = $container->get('request'); |
|
22 | - $hybridAuth = $container->get('HybridAuth'); |
|
23 | - $plugin = new SocialProfiles($hybridAuth,$request); |
|
19 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
20 | + { |
|
21 | + $request = $container->get('request'); |
|
22 | + $hybridAuth = $container->get('HybridAuth'); |
|
23 | + $plugin = new SocialProfiles($hybridAuth,$request); |
|
24 | 24 | |
25 | - return $plugin; |
|
26 | - } |
|
25 | + return $plugin; |
|
26 | + } |
|
27 | 27 | } |
@@ -16,11 +16,11 @@ |
||
16 | 16 | |
17 | 17 | class SocialProfilesFactory implements FactoryInterface |
18 | 18 | { |
19 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
19 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
20 | 20 | { |
21 | 21 | $request = $container->get('request'); |
22 | 22 | $hybridAuth = $container->get('HybridAuth'); |
23 | - $plugin = new SocialProfiles($hybridAuth,$request); |
|
23 | + $plugin = new SocialProfiles($hybridAuth, $request); |
|
24 | 24 | |
25 | 25 | return $plugin; |
26 | 26 | } |
@@ -37,14 +37,14 @@ |
||
37 | 37 | $this->options['allowName'] = isset($options['allowName']) ? $options['allowName'] : null; |
38 | 38 | } |
39 | 39 | |
40 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
41 | - { |
|
42 | - $auth = $container->get('AuthenticationService'); |
|
43 | - $user = $auth->getUser(); |
|
44 | - $options = $this->options; |
|
45 | - $options['user'] = $user; |
|
46 | - $validator = new UniqueGroupName($options); |
|
40 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
41 | + { |
|
42 | + $auth = $container->get('AuthenticationService'); |
|
43 | + $user = $auth->getUser(); |
|
44 | + $options = $this->options; |
|
45 | + $options['user'] = $user; |
|
46 | + $validator = new UniqueGroupName($options); |
|
47 | 47 | |
48 | - return $validator; |
|
49 | - } |
|
48 | + return $validator; |
|
49 | + } |
|
50 | 50 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $this->options['allowName'] = isset($options['allowName']) ? $options['allowName'] : null; |
38 | 38 | } |
39 | 39 | |
40 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
40 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
41 | 41 | { |
42 | 42 | $auth = $container->get('AuthenticationService'); |
43 | 43 | $user = $auth->getUser(); |
@@ -55,8 +55,8 @@ |
||
55 | 55 | { |
56 | 56 | /* @var $options \Applications\Options\ModuleOptions */ |
57 | 57 | $form->get($this->fileName)->setViewHelper('formImageUpload') |
58 | - ->setMaxSize($options->getContactImageMaxSize()) |
|
59 | - ->setAllowedTypes($options->getContactImageMimeType()) |
|
60 | - ->setForm($form); |
|
58 | + ->setMaxSize($options->getContactImageMaxSize()) |
|
59 | + ->setAllowedTypes($options->getContactImageMimeType()) |
|
60 | + ->setForm($form); |
|
61 | 61 | } |
62 | 62 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | 'info' => array( |
63 | 63 | 'type' => 'Auth/UserInfo', |
64 | 64 | 'property' => true, |
65 | - 'use_post_array' => true |
|
65 | + 'use_post_array' => true |
|
66 | 66 | ), |
67 | 67 | 'image' => array( |
68 | 68 | 'type' => 'Auth/UserImage', |
@@ -56,6 +56,6 @@ |
||
56 | 56 | $form = new static(); |
57 | 57 | $form->forms = $forms->get('FormElementManager'); |
58 | 58 | |
59 | - return $form; |
|
59 | + return $form; |
|
60 | 60 | } |
61 | 61 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function setBirthDay($birthDay) |
140 | 140 | { |
141 | - $this->birthDay=$birthDay; |
|
141 | + $this->birthDay = $birthDay; |
|
142 | 142 | return $this; |
143 | 143 | } |
144 | 144 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function setBirthMonth($birthMonth) |
161 | 161 | { |
162 | - $this->birthMonth=$birthMonth; |
|
162 | + $this->birthMonth = $birthMonth; |
|
163 | 163 | return $this; |
164 | 164 | } |
165 | 165 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function setBirthYear($birthYear) |
182 | 182 | { |
183 | - $this->birthYear=$birthYear; |
|
183 | + $this->birthYear = $birthYear; |
|
184 | 184 | return $this; |
185 | 185 | } |
186 | 186 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function setEmail($email) |
203 | 203 | { |
204 | - $this->email = trim((String)$email); |
|
204 | + $this->email = trim((String) $email); |
|
205 | 205 | return $this; |
206 | 206 | } |
207 | 207 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | public function setFirstName($firstName) |
246 | 246 | { |
247 | - $this->firstName = trim((String)$firstName); |
|
247 | + $this->firstName = trim((String) $firstName); |
|
248 | 248 | return $this; |
249 | 249 | } |
250 | 250 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | */ |
267 | 267 | public function setGender($gender) |
268 | 268 | { |
269 | - $this->gender = trim((String)$gender); |
|
269 | + $this->gender = trim((String) $gender); |
|
270 | 270 | return $this; |
271 | 271 | } |
272 | 272 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | */ |
288 | 288 | public function setHouseNumber($houseNumber) |
289 | 289 | { |
290 | - $this->houseNumber=$houseNumber; |
|
290 | + $this->houseNumber = $houseNumber; |
|
291 | 291 | return $this; |
292 | 292 | } |
293 | 293 | |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | if (!$this->lastName) { |
333 | 333 | return $emailIfEmpty ? $this->email : ''; |
334 | 334 | } |
335 | - return ($this->firstName ? $this->firstName . ' ' : '') . $this->lastName; |
|
335 | + return ($this->firstName ? $this->firstName.' ' : '').$this->lastName; |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | */ |
427 | 427 | public function setStreet($street) |
428 | 428 | { |
429 | - $this->street=$street; |
|
429 | + $this->street = $street; |
|
430 | 430 | return $this; |
431 | 431 | } |
432 | 432 | |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | */ |
448 | 448 | public function setCountry($country) |
449 | 449 | { |
450 | - $this->country=$country; |
|
450 | + $this->country = $country; |
|
451 | 451 | return $this; |
452 | 452 | } |
453 | 453 |
@@ -138,14 +138,14 @@ |
||
138 | 138 | if (!$this->test($resource, $privilege)) { |
139 | 139 | $msg = null === $privilege |
140 | 140 | ? sprintf( |
141 | - 'You are not allowed to access resource "%s"', |
|
142 | - is_object($resource) ? $resource->getResourceId() : $resource |
|
143 | - ) |
|
141 | + 'You are not allowed to access resource "%s"', |
|
142 | + is_object($resource) ? $resource->getResourceId() : $resource |
|
143 | + ) |
|
144 | 144 | : sprintf( |
145 | - 'You are not allowed to execute operation "%s" on resource "%s"', |
|
146 | - $privilege, |
|
147 | - is_object($resource) ? $resource->getResourceId() : $resource |
|
148 | - ); |
|
145 | + 'You are not allowed to execute operation "%s" on resource "%s"', |
|
146 | + $privilege, |
|
147 | + is_object($resource) ? $resource->getResourceId() : $resource |
|
148 | + ); |
|
149 | 149 | |
150 | 150 | if ($resource instanceof FileInterface && 0 == strpos($resource->getType(), 'image/')) { |
151 | 151 | throw new UnauthorizedImageAccessException(str_replace('resource', 'image', $msg)); |