@@ -27,13 +27,13 @@ |
||
27 | 27 | * |
28 | 28 | * @var int |
29 | 29 | */ |
30 | - const JOBS_VIEW = 16; // 10000 |
|
31 | - const JOBS_CREATE = 24; // 11000 # Create w/o View makes no sense |
|
32 | - const JOBS_CHANGE = 20; // 10100 # Change w/o view makes no sense |
|
33 | - const APPLICATIONS_VIEW = 2; // 00010 |
|
34 | - const APPLICATIONS_CHANGE = 3; // 00011 # change w/o view makes no sense |
|
35 | - const ALL = 31; // 11111 |
|
36 | - const NONE = 0; // 00000 |
|
30 | + const JOBS_VIEW = 16; // 10000 |
|
31 | + const JOBS_CREATE = 24; // 11000 # Create w/o View makes no sense |
|
32 | + const JOBS_CHANGE = 20; // 10100 # Change w/o view makes no sense |
|
33 | + const APPLICATIONS_VIEW = 2; // 00010 |
|
34 | + const APPLICATIONS_CHANGE = 3; // 00011 # change w/o view makes no sense |
|
35 | + const ALL = 31; // 11111 |
|
36 | + const NONE = 0; // 00000 |
|
37 | 37 | /**#@- */ |
38 | 38 | |
39 | 39 | /** |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | |
47 | 47 | /* todo: WRITE own Hydrator strategy class */ |
48 | 48 | $strategy = new ClosureStrategy( |
49 | - function ($object) use ($users) { |
|
49 | + function($object) use ($users) { |
|
50 | 50 | |
51 | 51 | if (is_string($object)) { |
52 | 52 | return $users->find($object); |
53 | 53 | } |
54 | 54 | return $object; |
55 | 55 | }, |
56 | - function ($data) use ($users) { |
|
56 | + function($data) use ($users) { |
|
57 | 57 | |
58 | 58 | if (is_string($data)) { |
59 | 59 | $data = $users->find($data); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | /* todo: write own strategy class */ |
66 | 66 | $permStrategy = new ClosureStrategy( |
67 | 67 | // extract |
68 | - function ($object) { |
|
68 | + function($object) { |
|
69 | 69 | /* @var $object \Organizations\Entity\EmployeePermissionsInterface */ |
70 | 70 | $values = array(); |
71 | 71 | foreach (array( |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | |
81 | 81 | return $values; |
82 | 82 | }, |
83 | - function ($data) { |
|
83 | + function($data) { |
|
84 | 84 | $permissions = array_reduce( |
85 | 85 | $data, |
86 | - function ($c, $i) { |
|
86 | + function($c, $i) { |
|
87 | 87 | return $c | $i; |
88 | 88 | }, |
89 | 89 | 0 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $repositories = $services->get('repositories'); |
45 | 45 | $users = $repositories->get('Auth/User'); /* @var $users \Auth\Repository\User */ |
46 | 46 | |
47 | - /* todo: WRITE own Hydrator strategy class */ |
|
47 | + /* todo: WRITE own Hydrator strategy class */ |
|
48 | 48 | $strategy = new ClosureStrategy( |
49 | 49 | function ($object) use ($users) { |
50 | 50 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | foreach (array( |
72 | 72 | Perms::JOBS_VIEW, Perms::JOBS_CHANGE, PERMS::JOBS_CREATE, |
73 | 73 | Perms::APPLICATIONS_VIEW, Perms::APPLICATIONS_CHANGE) |
74 | - as $perm) { |
|
74 | + as $perm) { |
|
75 | 75 | if ($object->isAllowed($perm)) { |
76 | 76 | $values[] = $perm; |
77 | 77 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | public function getHydrator() |
25 | 25 | { |
26 | 26 | if (!$this->hydrator) { |
27 | - $hydrator = new EntityHydrator(); |
|
27 | + $hydrator = new EntityHydrator(); |
|
28 | 28 | $this->setHydrator($hydrator); |
29 | 29 | } |
30 | 30 | return $this->hydrator; |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | if ($document instanceof UserInterface) { |
42 | 42 | $repository = $args->getDocumentManager()->getRepository('Organizations\Entity\Organization'); |
43 | - $userId = $document->getId(); |
|
43 | + $userId = $document->getId(); |
|
44 | 44 | $reference = new OrganizationReference($userId, $repository); |
45 | 45 | |
46 | 46 | $document->setOrganization($reference); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @var String |
26 | 26 | */ |
27 | - protected $repositoryName="Organizations/Organization"; |
|
27 | + protected $repositoryName = "Organizations/Organization"; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Sortable fields |
@@ -51,7 +51,7 @@ |
||
51 | 51 | * @see \Core\Repository\Filter\AbstractPaginationQuery::createQuery() |
52 | 52 | * @param $params |
53 | 53 | * @param \Doctrine\ODM\MongoDB\Query\Builder $queryBuilder |
54 | - * @return mixed |
|
54 | + * @return \Doctrine\ODM\MongoDB\Query\Builder |
|
55 | 55 | */ |
56 | 56 | public function createQuery($params, $queryBuilder) |
57 | 57 | { |
@@ -102,7 +102,7 @@ |
||
102 | 102 | $fieldset->setLabel(ucfirst($label)); |
103 | 103 | } |
104 | 104 | $fieldset->setName($name) |
105 | - ->setObject($child); |
|
105 | + ->setObject($child); |
|
106 | 106 | |
107 | 107 | |
108 | 108 | $this->add($fieldset); |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | |
75 | 75 | $inputLabel = isset($this->labelMap[$inputName]) ? $this->labelMap[$inputName] : $inputName; |
76 | 76 | |
77 | - if (is_array($inputLabel)){ |
|
78 | - $priority = isset($inputLabel[1])?$inputLabel[1]:0; |
|
77 | + if (is_array($inputLabel)) { |
|
78 | + $priority = isset($inputLabel[1]) ? $inputLabel[1] : 0; |
|
79 | 79 | $inputLabel = $inputLabel[0]; |
80 | - }else{ |
|
80 | + } else { |
|
81 | 81 | $priority = 0; |
82 | 82 | } |
83 | 83 | |
@@ -89,19 +89,19 @@ discard block |
||
89 | 89 | ), |
90 | 90 | ); |
91 | 91 | if (is_bool($value)) { |
92 | - $input['type']= 'Checkbox'; |
|
92 | + $input['type'] = 'Checkbox'; |
|
93 | 93 | $input['attributes']['checked'] = $value; |
94 | 94 | } else { |
95 | 95 | $input['attributes']['value'] = $value; |
96 | 96 | } |
97 | - $this->add($input,['priority'=>$priority]); |
|
97 | + $this->add($input, ['priority'=>$priority]); |
|
98 | 98 | |
99 | 99 | } |
100 | 100 | |
101 | 101 | foreach ($children as $name => $child) { |
102 | 102 | $objectClass = ltrim(get_class($settings), '\\'); |
103 | 103 | $moduleName = substr($objectClass, 0, strpos($objectClass, '\\')); |
104 | - $fieldsetName = $moduleName . '/' . ucfirst($name) . 'SettingsFieldset'; |
|
104 | + $fieldsetName = $moduleName.'/'.ucfirst($name).'SettingsFieldset'; |
|
105 | 105 | |
106 | 106 | if ($this->formManager->has($fieldsetName)) { |
107 | 107 | $fieldset = $this->formManager->get($fieldsetName); |
@@ -77,7 +77,7 @@ |
||
77 | 77 | if (is_array($inputLabel)){ |
78 | 78 | $priority = isset($inputLabel[1])?$inputLabel[1]:0; |
79 | 79 | $inputLabel = $inputLabel[0]; |
80 | - }else{ |
|
80 | + } else{ |
|
81 | 81 | $priority = 0; |
82 | 82 | } |
83 | 83 |
@@ -30,11 +30,11 @@ |
||
30 | 30 | */ |
31 | 31 | class Module |
32 | 32 | { |
33 | - /** |
|
34 | - * Loads module specific configuration. |
|
35 | - * |
|
36 | - * @return array |
|
37 | - */ |
|
33 | + /** |
|
34 | + * Loads module specific configuration. |
|
35 | + * |
|
36 | + * @return array |
|
37 | + */ |
|
38 | 38 | public function getConfig() |
39 | 39 | { |
40 | 40 | return ModuleConfigLoader::load(__DIR__ . '/config'); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function getConfig() |
39 | 39 | { |
40 | - return ModuleConfigLoader::load(__DIR__ . '/config'); |
|
40 | + return ModuleConfigLoader::load(__DIR__.'/config'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | return array( |
51 | 51 | 'Zend\Loader\StandardAutoloader' => array( |
52 | 52 | 'namespaces' => array( |
53 | - __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, |
|
53 | + __NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__, |
|
54 | 54 | ), |
55 | 55 | ), |
56 | 56 | ); |
@@ -26,11 +26,11 @@ |
||
26 | 26 | // 'driver' => 'odm_default', |
27 | 27 | // |
28 | 28 | // 'generate_proxies' => true, |
29 | - 'proxy_dir' => 'cache/DoctrineMongoODMModule/Proxy', |
|
29 | + 'proxy_dir' => 'cache/DoctrineMongoODMModule/Proxy', |
|
30 | 30 | // 'proxy_namespace' => 'DoctrineMongoODMModule\Proxy', |
31 | 31 | // |
32 | 32 | // 'generate_hydrators' => true, |
33 | - 'hydrator_dir' => 'cache/DoctrineMongoODMModule/Hydrator', |
|
33 | + 'hydrator_dir' => 'cache/DoctrineMongoODMModule/Hydrator', |
|
34 | 34 | // 'hydrator_namespace' => 'DoctrineMongoODMModule\Hydrator', |
35 | 35 | // |
36 | 36 | // 'default_db' => '', |
@@ -131,7 +131,7 @@ |
||
131 | 131 | { |
132 | 132 | $viewModel = new ViewModel(); |
133 | 133 | $viewModel->setTemplate('error/index') |
134 | - ->setVariable('message', 'An unexpected error had occured. Please try again later.'); |
|
134 | + ->setVariable('message', 'An unexpected error had occured. Please try again later.'); |
|
135 | 135 | return $viewModel; |
136 | 136 | } |
137 | 137 | } |