@@ -46,7 +46,7 @@ |
||
| 46 | 46 | case ImagineOptions::LIB_GD: |
| 47 | 47 | case ImagineOptions::LIB_IMAGICK: |
| 48 | 48 | case ImagineOptions::LIB_GMAGICK: |
| 49 | - $imagineClass = '\Imagine\\' . $lib . '\Imagine'; |
|
| 49 | + $imagineClass = '\Imagine\\'.$lib.'\Imagine'; |
|
| 50 | 50 | $imagine = new $imagineClass; |
| 51 | 51 | break; |
| 52 | 52 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $defaults = [ |
| 183 | 183 | 'service' => 'EventManager', |
| 184 | 184 | 'configure' => true, |
| 185 | - 'identifiers' => [ $name ], |
|
| 185 | + 'identifiers' => [$name], |
|
| 186 | 186 | 'event' => '\Zend\EventManager\Event', |
| 187 | 187 | 'listeners' => [], |
| 188 | 188 | ]; |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | foreach ($options['attach'] as $spec) { |
| 300 | - $callback = $spec['method'] ? [ $listener, $spec['method'] ] : $listener; |
|
| 300 | + $callback = $spec['method'] ? [$listener, $spec['method']] : $listener; |
|
| 301 | 301 | $eventManager->attach($spec['event'], $callback, $spec['priority']); |
| 302 | 302 | } |
| 303 | 303 | } |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | |
| 367 | 367 | if (is_string($options)) { |
| 368 | 368 | /* Only an event name is provided in config */ |
| 369 | - $normalized['attach'] = [ [ 'event' => $options, 'method' => null, 'priority' => 1 ] ]; |
|
| 369 | + $normalized['attach'] = [['event' => $options, 'method' => null, 'priority' => 1]]; |
|
| 370 | 370 | return $normalized; |
| 371 | 371 | } |
| 372 | 372 | |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | } elseif (is_string($opt)) { |
| 392 | 392 | if (null === $event) { |
| 393 | 393 | /* first string found is assumed to be the event name */ |
| 394 | - $event = [ $opt ]; |
|
| 394 | + $event = [$opt]; |
|
| 395 | 395 | } else { |
| 396 | 396 | /* second string found must be a method name. */ |
| 397 | 397 | $method = $opt; |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | foreach ($event as &$eventSpec) { |
| 409 | - $eventSpec = [ 'event' => $eventSpec, 'method' => $method, 'priority' => $priority ]; |
|
| 409 | + $eventSpec = ['event' => $eventSpec, 'method' => $method, 'priority' => $priority]; |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | $normalized['attach'] = $event; |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | protected function normalizeEventsSpec($options) |
| 419 | 419 | { |
| 420 | 420 | $listenerPriority = isset($options['priority']) ? $options['priority'] : 1; |
| 421 | - $listenerMethod = isset($options['method']) ? $options['method'] : '__none__'; |
|
| 421 | + $listenerMethod = isset($options['method']) ? $options['method'] : '__none__'; |
|
| 422 | 422 | $events = []; |
| 423 | 423 | |
| 424 | 424 | foreach ($options['events'] as $event => $spec) { |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | } elseif (is_array($spec)) { |
| 434 | 434 | if (isset($spec['method'])) { |
| 435 | 435 | if (!is_array($spec['method'])) { |
| 436 | - $spec['method'] = [ $spec['method'] ]; |
|
| 436 | + $spec['method'] = [$spec['method']]; |
|
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | foreach ($spec['method'] as $method => $methodPriority) { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | public function getFileEntity() |
| 94 | 94 | { |
| 95 | - if (! $this->fileEntity instanceof FileInterface) { |
|
| 95 | + if (!$this->fileEntity instanceof FileInterface) { |
|
| 96 | 96 | throw new \RuntimeException('No file entity set or it does not implement \Core\Entity\FileInterface.'); |
| 97 | 97 | } |
| 98 | 98 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | public function filter($value) |
| 103 | 103 | { |
| 104 | - if (! is_array($value) || ! isset($value['tmp_name']) || ((isset($value['error']) && UPLOAD_ERR_NO_FILE == $value['error']))) { |
|
| 104 | + if (!is_array($value) || !isset($value['tmp_name']) || ((isset($value['error']) && UPLOAD_ERR_NO_FILE == $value['error']))) { |
|
| 105 | 105 | return null; |
| 106 | 106 | } |
| 107 | 107 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | : SnapshotMeta::class; |
| 38 | 38 | |
| 39 | 39 | $this->snapshotMeta = new $snapshotMetaClass(); |
| 40 | - $this->snapshotEntity = $source; |
|
| 40 | + $this->snapshotEntity = $source; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function getOriginalEntity() |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | * @throws \Core\Entity\Exception\OutOfBoundsException if the property does not exists. |
| 73 | 73 | * @since 0.25 |
| 74 | 74 | */ |
| 75 | - public function notEmpty($property, array $args=[]); |
|
| 75 | + public function notEmpty($property, array $args = []); |
|
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * Checks, if this entity has a property. |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | return $this->$method($value); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - throw new OutOfBoundsException("'$property' is not a valid property of '" . get_class($this). "'"); |
|
| 52 | + throw new OutOfBoundsException("'$property' is not a valid property of '".get_class($this)."'"); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | if (method_exists($this, $method)) { |
| 77 | 77 | return $this->$method(); |
| 78 | 78 | } |
| 79 | - throw new OutOfBoundsException("'$property' is not a valid property of '" . get_class($this) . "'"); |
|
| 79 | + throw new OutOfBoundsException("'$property' is not a valid property of '".get_class($this)."'"); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $className = get_class($entity); |
| 55 | 55 | |
| 56 | - if (! isset($key)) { |
|
| 56 | + if (!isset($key)) { |
|
| 57 | 57 | $key = $className; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $entityId = $entity->getId(); |
| 64 | 64 | |
| 65 | 65 | // check if entity is not persisted |
| 66 | - if (! $entityId) { |
|
| 66 | + if (!$entityId) { |
|
| 67 | 67 | // persist entity & retrieve its ID |
| 68 | 68 | $this->repositories->getRepository($className)->store($entity); |
| 69 | 69 | $entityId = $entity->getId(); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function getAttachedEntity($key) |
| 83 | 83 | { |
| 84 | - if (! isset($this->references[$key])) { |
|
| 84 | + if (!isset($this->references[$key])) { |
|
| 85 | 85 | return; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $entity = $this->repositories->getRepository($reference['repository']) |
| 90 | 90 | ->find($reference['id']); |
| 91 | 91 | |
| 92 | - if (! $entity) { |
|
| 92 | + if (!$entity) { |
|
| 93 | 93 | // remove reference if entity does not exists |
| 94 | 94 | unset($this->references[$key]); |
| 95 | 95 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | { |
| 29 | 29 | use EntityTrait, ClonePropertiesTrait; |
| 30 | 30 | |
| 31 | - private $cloneProperties = [ '!items' ]; |
|
| 31 | + private $cloneProperties = ['!items']; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * The leafs. |
@@ -153,7 +153,7 @@ |
||
| 153 | 153 | |
| 154 | 154 | public function getValueWithParents($withRoot = false, $useNames = false) |
| 155 | 155 | { |
| 156 | - $parts = [ ($useNames ? $this->getName() : $this->getValue()) ]; |
|
| 156 | + $parts = [($useNames ? $this->getName() : $this->getValue())]; |
|
| 157 | 157 | $item = $this; |
| 158 | 158 | |
| 159 | 159 | while ($item = $item->getParent()) { |