@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | */ |
41 | 41 | protected $acl; |
42 | 42 | |
43 | - public function __construct(RepositoryService $repositoryService,AuthenticationService $auth, Acl $acl) { |
|
44 | - $this->repositoryService=$repositoryService; |
|
45 | - $this->auth=$auth; |
|
46 | - $this->acl=$acl; |
|
43 | + public function __construct(RepositoryService $repositoryService, AuthenticationService $auth, Acl $acl) { |
|
44 | + $this->repositoryService = $repositoryService; |
|
45 | + $this->auth = $auth; |
|
46 | + $this->acl = $acl; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | public function __invoke() |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | * @throws UnauthorizedAccessException |
60 | 60 | * @throws \Doctrine\ODM\MongoDB\LockException |
61 | 61 | */ |
62 | - public function process(Params $params,$allowDraft = true) |
|
62 | + public function process(Params $params, $allowDraft = true) |
|
63 | 63 | { |
64 | - $repositories = $this->repositoryService; |
|
64 | + $repositories = $this->repositoryService; |
|
65 | 65 | /* @var \Organizations\Repository\Organization $organizationRepository */ |
66 | 66 | $organizationRepository = $this->repositoryService->get('Organizations/Organization'); |
67 | 67 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $user = $this->auth->getUser(); /* @var $user \Auth\Entity\UserInterface */ |
71 | 71 | |
72 | 72 | /* @var $organizationId string */ |
73 | - $organizationId = empty($idFromRoute)?$idFromSubForm:$idFromRoute; |
|
73 | + $organizationId = empty($idFromRoute) ? $idFromSubForm : $idFromRoute; |
|
74 | 74 | |
75 | 75 | $editOwnOrganization = '__my__' === $organizationId; |
76 | 76 | |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | return $organization; |
106 | 106 | } |
107 | 107 | |
108 | - $organization = $organizationRepository->find($organizationId); |
|
108 | + $organization = $organizationRepository->find($organizationId); |
|
109 | 109 | if (!$organization) { |
110 | - throw new \RuntimeException('No Organization found with id "' . $organizationId . '"'); |
|
110 | + throw new \RuntimeException('No Organization found with id "'.$organizationId.'"'); |
|
111 | 111 | } |
112 | 112 | return $organization; |
113 | 113 | } |
@@ -127,12 +127,12 @@ discard block |
||
127 | 127 | try { |
128 | 128 | /* @var $handler \Organizations\Controller\Plugin\GetOrganizationHandler */ |
129 | 129 | $handler = $this->plugin('Organizations/GetOrganizationHandler'); |
130 | - $org = $handler->process($this->params(), true); |
|
130 | + $org = $handler->process($this->params(), true); |
|
131 | 131 | } catch (\RuntimeException $e) { |
132 | 132 | return $this->getErrorViewModel('no-parent'); |
133 | 133 | } |
134 | 134 | |
135 | - $container = $this->getFormular($org); |
|
135 | + $container = $this->getFormular($org); |
|
136 | 136 | |
137 | 137 | if (isset($formIdentifier) && $request->isPost()) { |
138 | 138 | /* @var $form \Zend\Form\FormInterface */ |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $form = $container->get($formIdentifier); |
158 | 158 | $form->setData(array_merge($postData, $filesData)); |
159 | 159 | if (!isset($form)) { |
160 | - throw new \RuntimeException('No form found for "' . $formIdentifier . '"'); |
|
160 | + throw new \RuntimeException('No form found for "'.$formIdentifier.'"'); |
|
161 | 161 | } |
162 | 162 | $isValid = $form->isValid(); |
163 | 163 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function getConfig() |
27 | 27 | { |
28 | - return ModuleConfigLoader::load(__DIR__ . '/config'); |
|
28 | + return ModuleConfigLoader::load(__DIR__.'/config'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | return array( |
40 | 40 | 'Zend\Loader\StandardAutoloader' => array( |
41 | 41 | 'namespaces' => array( |
42 | - __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, |
|
43 | - 'OrganizationsTest' => __DIR__ . '/test/' . 'OrganizationsTest' |
|
42 | + __NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__, |
|
43 | + 'OrganizationsTest' => __DIR__.'/test/'.'OrganizationsTest' |
|
44 | 44 | ), |
45 | 45 | ), |
46 | 46 | ); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @license MIT |
13 | 13 | */ |
14 | 14 | |
15 | -$doctrineConfig = include __DIR__ . '/doctrine.config.php'; |
|
15 | +$doctrineConfig = include __DIR__.'/doctrine.config.php'; |
|
16 | 16 | |
17 | 17 | |
18 | 18 | return array( |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | 'name' => 'stream', |
37 | 37 | 'priority' => 1000, |
38 | 38 | 'options' => array( |
39 | - 'stream' => __DIR__ .'/../../../log/yawik.log', |
|
39 | + 'stream' => __DIR__.'/../../../log/yawik.log', |
|
40 | 40 | ), |
41 | 41 | ), |
42 | 42 | ), |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | 'name' => 'stream', |
48 | 48 | 'priority' => 1000, |
49 | 49 | 'options' => array( |
50 | - 'stream' => __DIR__ .'/../../../log/mails.log', |
|
50 | + 'stream' => __DIR__.'/../../../log/mails.log', |
|
51 | 51 | ), |
52 | 52 | ), |
53 | 53 | ), |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | 'ErrorLogger' => array( |
56 | 56 | 'service' => 'Core/ErrorLogger', |
57 | 57 | 'config' => array( |
58 | - 'stream' => __DIR__ . '/../../../log/error.log', |
|
58 | + 'stream' => __DIR__.'/../../../log/error.log', |
|
59 | 59 | 'log_errors' => true, |
60 | 60 | 'log_exceptions' => true, |
61 | 61 | ), |
@@ -216,17 +216,17 @@ discard block |
||
216 | 216 | 'translation_file_patterns' => array( |
217 | 217 | [ |
218 | 218 | 'type' => 'gettext', |
219 | - 'base_dir' => __DIR__ . '/../language', |
|
219 | + 'base_dir' => __DIR__.'/../language', |
|
220 | 220 | 'pattern' => '%s.mo', |
221 | 221 | ], |
222 | 222 | [ |
223 | 223 | 'type' => 'phparray', |
224 | - 'base_dir' => __DIR__ . '/../language', |
|
224 | + 'base_dir' => __DIR__.'/../language', |
|
225 | 225 | 'pattern' => 'Zend_Validate.%s.php', |
226 | 226 | ], |
227 | 227 | [ |
228 | 228 | 'type' => 'phparray', |
229 | - 'base_dir' => __DIR__ . '/../language', |
|
229 | + 'base_dir' => __DIR__.'/../language', |
|
230 | 230 | 'pattern' => 'Zend_Captcha.%s.php', |
231 | 231 | ] |
232 | 232 | ), |
@@ -291,29 +291,29 @@ discard block |
||
291 | 291 | 'exception_template' => 'error/index', |
292 | 292 | // Map template to files. Speeds up the lookup through the template stack. |
293 | 293 | 'template_map' => array( |
294 | - 'noscript-notice' => __DIR__ . '/../view/layout/_noscript-notice.phtml', |
|
295 | - 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', |
|
296 | - 'error/404' => __DIR__ . '/../view/error/404.phtml', |
|
297 | - 'error/403' => __DIR__ . '/../view/error/403.phtml', |
|
298 | - 'error/index' => __DIR__ . '/../view/error/index.phtml', |
|
299 | - 'main-navigation' => __DIR__ . '/../view/partial/main-navigation.phtml', |
|
300 | - 'pagination-control' => __DIR__ . '/../view/partial/pagination-control.phtml', |
|
301 | - 'core/loading-popup' => __DIR__ . '/../view/partial/loading-popup.phtml', |
|
302 | - 'core/notifications' => __DIR__ . '/../view/partial/notifications.phtml', |
|
303 | - 'form/core/buttons' => __DIR__ . '/../view/form/buttons.phtml', |
|
304 | - 'core/social-buttons' => __DIR__ . '/../view/partial/social-buttons.phtml', |
|
305 | - 'form/core/privacy' => __DIR__ . '/../view/form/privacy.phtml', |
|
306 | - 'core/form/permissions-fieldset' => __DIR__ . '/../view/form/permissions-fieldset.phtml', |
|
307 | - 'core/form/permissions-collection' => __DIR__ . '/../view/form/permissions-collection.phtml', |
|
308 | - 'core/form/container-view' => __DIR__ . '/../view/form/container.view.phtml', |
|
309 | - 'mail/header' => __DIR__ . '/../view/mail/header.phtml', |
|
310 | - 'mail/footer' => __DIR__ . '/../view/mail/footer.phtml', |
|
311 | - 'mail/footer.en' => __DIR__ . '/../view/mail/footer.en.phtml', |
|
294 | + 'noscript-notice' => __DIR__.'/../view/layout/_noscript-notice.phtml', |
|
295 | + 'layout/layout' => __DIR__.'/../view/layout/layout.phtml', |
|
296 | + 'error/404' => __DIR__.'/../view/error/404.phtml', |
|
297 | + 'error/403' => __DIR__.'/../view/error/403.phtml', |
|
298 | + 'error/index' => __DIR__.'/../view/error/index.phtml', |
|
299 | + 'main-navigation' => __DIR__.'/../view/partial/main-navigation.phtml', |
|
300 | + 'pagination-control' => __DIR__.'/../view/partial/pagination-control.phtml', |
|
301 | + 'core/loading-popup' => __DIR__.'/../view/partial/loading-popup.phtml', |
|
302 | + 'core/notifications' => __DIR__.'/../view/partial/notifications.phtml', |
|
303 | + 'form/core/buttons' => __DIR__.'/../view/form/buttons.phtml', |
|
304 | + 'core/social-buttons' => __DIR__.'/../view/partial/social-buttons.phtml', |
|
305 | + 'form/core/privacy' => __DIR__.'/../view/form/privacy.phtml', |
|
306 | + 'core/form/permissions-fieldset' => __DIR__.'/../view/form/permissions-fieldset.phtml', |
|
307 | + 'core/form/permissions-collection' => __DIR__.'/../view/form/permissions-collection.phtml', |
|
308 | + 'core/form/container-view' => __DIR__.'/../view/form/container.view.phtml', |
|
309 | + 'mail/header' => __DIR__.'/../view/mail/header.phtml', |
|
310 | + 'mail/footer' => __DIR__.'/../view/mail/footer.phtml', |
|
311 | + 'mail/footer.en' => __DIR__.'/../view/mail/footer.en.phtml', |
|
312 | 312 | //'startpage' => __DIR__ . '/../view/layout/startpage.phtml', |
313 | 313 | ), |
314 | 314 | // Where to look for view templates not mapped above |
315 | 315 | 'template_path_stack' => array( |
316 | - __DIR__ . '/../view', |
|
316 | + __DIR__.'/../view', |
|
317 | 317 | ), |
318 | 318 | ), |
319 | 319 | 'view_helpers' => array( |
@@ -20,16 +20,16 @@ |
||
20 | 20 | */ |
21 | 21 | trait EntityTrait |
22 | 22 | { |
23 | - public function notEmpty($property, array $args=[]) |
|
23 | + public function notEmpty($property, array $args = []) |
|
24 | 24 | { |
25 | 25 | $method = "get$property"; |
26 | 26 | |
27 | 27 | if (!method_exists($this, $method)) { |
28 | - throw new OutOfBoundsException("'$property' is not a valid property of '" . get_class($this) . "'"); |
|
28 | + throw new OutOfBoundsException("'$property' is not a valid property of '".get_class($this)."'"); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | $value = count($args) |
32 | - ? call_user_func_array([ $this, $method ], $args) |
|
32 | + ? call_user_func_array([$this, $method], $args) |
|
33 | 33 | : $this->$method(); |
34 | 34 | |
35 | 35 | if (null === $value) { // is_scalar does not consider 'null' to be scalar value. |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $setterMethods = $object->getSetters(); |
44 | 44 | } |
45 | 45 | foreach ($data as $key => $value) { |
46 | - $setter = 'set' . ucfirst($key); |
|
46 | + $setter = 'set'.ucfirst($key); |
|
47 | 47 | if (in_array($setter, $setterMethods)) { |
48 | 48 | $object->$setter($value); |
49 | 49 | } else { |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | |
33 | 33 | $getters = array_filter( |
34 | 34 | get_class_methods($object), |
35 | - function ($methodName) use ($object) { |
|
35 | + function($methodName) use ($object) { |
|
36 | 36 | return "get" === substr($methodName, 0, 3) |
37 | - && method_exists($object, 's' . substr($methodName, 1)); |
|
37 | + && method_exists($object, 's'.substr($methodName, 1)); |
|
38 | 38 | } |
39 | 39 | ); |
40 | 40 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | $setters = array_filter( |
63 | 63 | get_class_methods($object), |
64 | - function ($methodName) { |
|
64 | + function($methodName) { |
|
65 | 65 | return "set" === substr($methodName, 0, 3); |
66 | 66 | } |
67 | 67 | ); |
@@ -149,21 +149,21 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | if (preg_match('~^is(View|Change|None|All)Granted$~', $method, $match)) { |
152 | - $permission = constant('self::PERMISSION_' . strtoupper($match[1])); |
|
152 | + $permission = constant('self::PERMISSION_'.strtoupper($match[1])); |
|
153 | 153 | return $this->isGranted($params[0], $permission); |
154 | 154 | } |
155 | 155 | |
156 | 156 | if (preg_match('~^grant(View|Change|None|All)$~', $method, $match)) { |
157 | - $permission = constant('self::PERMISSION_' . strtoupper($match[1])); |
|
157 | + $permission = constant('self::PERMISSION_'.strtoupper($match[1])); |
|
158 | 158 | return $this->grant($params[0], $permission); |
159 | 159 | } |
160 | 160 | |
161 | 161 | if (preg_match('~^revoke(View|Change|None|All)$~', $method, $match)) { |
162 | - $permission = constant('self::PERMISSION_' . strtoupper($match[1])); |
|
162 | + $permission = constant('self::PERMISSION_'.strtoupper($match[1])); |
|
163 | 163 | return $this->revoke($params[0], $permission); |
164 | 164 | } |
165 | 165 | |
166 | - throw new \BadMethodCallException('Unknown method "' . $method . '"'); |
|
166 | + throw new \BadMethodCallException('Unknown method "'.$method.'"'); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | if ($build) { |
312 | 312 | $this->build(); |
313 | 313 | } |
314 | - $this->hasChanged= true; |
|
314 | + $this->hasChanged = true; |
|
315 | 315 | |
316 | 316 | // restore orginial permissions type |
317 | 317 | $this->type = $oldType; |
@@ -444,10 +444,10 @@ discard block |
||
444 | 444 | } |
445 | 445 | |
446 | 446 | if ($resource instanceof UserInterface) { |
447 | - return 'user:' . $resource->getId(); |
|
447 | + return 'user:'.$resource->getId(); |
|
448 | 448 | } |
449 | 449 | |
450 | - return 'user:' . $resource; |
|
450 | + return 'user:'.$resource; |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | /** |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | ); |
468 | 468 | if (!in_array($permission, $perms)) { |
469 | 469 | throw new \InvalidArgumentException( |
470 | - 'Invalid permission. Must be one of ' . implode(', ', $perms) |
|
470 | + 'Invalid permission. Must be one of '.implode(', ', $perms) |
|
471 | 471 | ); |
472 | 472 | } |
473 | 473 | } |
@@ -141,15 +141,15 @@ |
||
141 | 141 | $size = $this->getLength(); |
142 | 142 | |
143 | 143 | if ($size >= 1073741824) { |
144 | - return round($size / 1073741824, 2) . ' GB'; |
|
144 | + return round($size / 1073741824, 2).' GB'; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | if ($size >= 1048576) { |
148 | - return round($size / 1048576, 2) . ' MB'; |
|
148 | + return round($size / 1048576, 2).' MB'; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | if ($size >= 1024) { |
152 | - return round($size / 1024, 2) . ' kB'; |
|
152 | + return round($size / 1024, 2).' kB'; |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | return $size; |