@@ -39,7 +39,7 @@ |
||
39 | 39 | if (!array_key_exists('path', $config)) { |
40 | 40 | throw new \RuntimeException('path is missing', 500); |
41 | 41 | } |
42 | - return $config['scheme'] . '://' . $config['host'] . '/' . $config['path']; |
|
42 | + return $config['scheme'].'://'.$config['host'].'/'.$config['path']; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | function getUri() |
48 | 48 | { |
49 | - return '/' . trim('file/Organizations.OrganizationImage/' . $this->id . "/" . urlencode($this->name),'/'); |
|
49 | + return '/'.trim('file/Organizations.OrganizationImage/'.$this->id."/".urlencode($this->name), '/'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | public function setStatus($status) |
115 | 115 | { |
116 | - if (!defined('self::STATUS_' . strtoupper($status))) { |
|
116 | + if (!defined('self::STATUS_'.strtoupper($status))) { |
|
117 | 117 | $status = self::STATUS_ASSIGNED; |
118 | 118 | } |
119 | 119 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @param $role |
135 | 135 | */ |
136 | 136 | public function setRole($role) { |
137 | - $this->role=$role; |
|
137 | + $this->role = $role; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | if (!$this->filterComposite->filter($propertyName)) { |
60 | 60 | continue; |
61 | 61 | } |
62 | - $getter = 'get' . ucfirst($propertyName); |
|
62 | + $getter = 'get'.ucfirst($propertyName); |
|
63 | 63 | $value = method_exists($object, $getter) |
64 | 64 | ? $object->$getter() |
65 | 65 | : $property->getValue($object); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | foreach ($this->data as $key => $value) { |
88 | 88 | if (isset($reflProperties[$key])) { |
89 | 89 | $value = $this->hydrateValue($key, $value); |
90 | - $setter = 'set' . ucfirst($key); |
|
90 | + $setter = 'set'.ucfirst($key); |
|
91 | 91 | if (method_exists($object, $setter)) { |
92 | 92 | $object->$setter($value); |
93 | 93 | } else { |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $organizationNameQb = $this->getDocumentManager()->createQueryBuilder('Organizations\Entity\OrganizationName'); |
226 | 226 | $organizationNameQb->hydrate(false) |
227 | 227 | ->select(array('id', 'name')) |
228 | - ->field('name')->equals(new \MongoRegex('/' . $query . '/i')) |
|
228 | + ->field('name')->equals(new \MongoRegex('/'.$query.'/i')) |
|
229 | 229 | ->sort('name') |
230 | 230 | ->limit(5); |
231 | 231 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | foreach ($result as $id => $item) { |
262 | 262 | $organizations[$id] = $item; |
263 | - $organizationNameId = (string)$organizations[$id]['organizationName']; |
|
263 | + $organizationNameId = (string) $organizations[$id]['organizationName']; |
|
264 | 264 | $organizations[$id]['organizationName'] = $organizationNames[$organizationNameId]; |
265 | 265 | } |
266 | 266 |
@@ -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 | } |