@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | protected function attachDefaultListeners() |
| 58 | 58 | { |
| 59 | - $this->getEventManager()->attach(static::EVENT_REMOVE_ITEMS, function (EventInterface $event) { |
|
| 59 | + $this->getEventManager()->attach(static::EVENT_REMOVE_ITEMS, function(EventInterface $event) { |
|
| 60 | 60 | $user = $event->getParam('user'); |
| 61 | 61 | foreach ($this->getLists() as $list) { |
| 62 | 62 | foreach ($list->getEntities($user) as $entity) { |
@@ -98,12 +98,12 @@ discard block |
||
| 98 | 98 | </a> |
| 99 | 99 | <div class="fu-errors input-error"> |
| 100 | 100 | <ul class="errors"> |
| 101 | - <li class="fu-error-size">' . $translator->translate('The file is too big', $textDomain) . '</li> |
|
| 102 | - <li class="fu-error-type">' . $translator->translate('The file type is not supported', $textDomain) . '</li> |
|
| 101 | + <li class="fu-error-size">' . $translator->translate('The file is too big', $textDomain).'</li> |
|
| 102 | + <li class="fu-error-type">' . $translator->translate('The file type is not supported', $textDomain).'</li> |
|
| 103 | 103 | <li class="fu-error-count">' . sprintf( |
| 104 | 104 | $translator->translate('You may only upload %d files', $textDomain), |
| 105 | 105 | $element->getAttribute('data-maxfilecount') |
| 106 | -) . '</li><li class="fu-error-general">' . $translator->translate('An unknown error occured.') . '</li> |
|
| 106 | +).'</li><li class="fu-error-general">'.$translator->translate('An unknown error occured.').'</li> |
|
| 107 | 107 | </ul> |
| 108 | 108 | </div> |
| 109 | 109 | </li>'; |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | /* @var $basepath \Zend\View\Helper\BasePath */ |
| 112 | 112 | $renderer = $this->getView(); |
| 113 | 113 | $basepath = $renderer->plugin('basepath'); |
| 114 | - $createFileDisplay = function ($file) use ($template, $basepath) { |
|
| 114 | + $createFileDisplay = function($file) use ($template, $basepath) { |
|
| 115 | 115 | /* @var $file \Core\Entity\FileInterface */ |
| 116 | 116 | $uri = $basepath($file->getUri()); |
| 117 | 117 | $name = $file->getName(); |
@@ -146,11 +146,11 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | $nonemptynotice = |
| 149 | - '<div class="fu-nonempty-notice"' . ('' == trim($preview) ? ' style="display:none;"' : '') . '>' |
|
| 150 | - . $this->getNonEmptyNotice() . '</div>'; |
|
| 149 | + '<div class="fu-nonempty-notice"'.('' == trim($preview) ? ' style="display:none;"' : '').'>' |
|
| 150 | + . $this->getNonEmptyNotice().'</div>'; |
|
| 151 | 151 | $emptynotice = '<div class="fu-empty-notice"' |
| 152 | - . ('' == trim($preview) ? '' : ' style="display: none;"') . '> |
|
| 153 | - ' . $this->getEmptyNotice() . ' |
|
| 152 | + . ('' == trim($preview) ? '' : ' style="display: none;"').'> |
|
| 153 | + ' . $this->getEmptyNotice().' |
|
| 154 | 154 | </div>'; |
| 155 | 155 | |
| 156 | 156 | $markup = ' |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | protected function getDefaultNotice() |
| 300 | 300 | { |
| 301 | - return '<small>' . $this->getTranslator()->translate('Click here to add files or use drag and drop.') . '</small>'; |
|
| 301 | + return '<small>'.$this->getTranslator()->translate('Click here to add files or use drag and drop.').'</small>'; |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | /** |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | public function setAllowRemove($allowRemove) |
| 310 | 310 | { |
| 311 | - $this->allowRemove = (bool)$allowRemove; |
|
| 311 | + $this->allowRemove = (bool) $allowRemove; |
|
| 312 | 312 | |
| 313 | 313 | return $this; |
| 314 | 314 | } |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | public function setAllowClickableDropZone($allowClickableDropZone) |
| 322 | 322 | { |
| 323 | - $this->allowClickableDropZone = (bool)$allowClickableDropZone; |
|
| 323 | + $this->allowClickableDropZone = (bool) $allowClickableDropZone; |
|
| 324 | 324 | |
| 325 | 325 | return $this; |
| 326 | 326 | } |
@@ -146,18 +146,18 @@ |
||
| 146 | 146 | $size = $this->getLength(); |
| 147 | 147 | |
| 148 | 148 | if ($size >= 1073741824) { |
| 149 | - return round($size / 1073741824, 2) . ' GB'; |
|
| 149 | + return round($size / 1073741824, 2).' GB'; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if ($size >= 1048576) { |
| 153 | - return round($size / 1048576, 2) . ' MB'; |
|
| 153 | + return round($size / 1048576, 2).' MB'; |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | if ($size >= 1024) { |
| 157 | - return round($size / 1024, 2) . ' kB'; |
|
| 157 | + return round($size / 1024, 2).' kB'; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - return (string)$size; |
|
| 160 | + return (string) $size; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | // try get image from repository |
| 67 | 67 | $image = $this->repository->find($id); |
| 68 | 68 | |
| 69 | - if (! $image) { |
|
| 69 | + if (!$image) { |
|
| 70 | 70 | // abort if image does not exist |
| 71 | 71 | return; |
| 72 | 72 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function matchUri($uri) |
| 86 | 86 | { |
| 87 | - $pattern = '#^' . preg_quote($this->options->getUriPath(), '#') . '/[0-9a-z]/[0-9a-z]/([0-9a-z]+)\.[a-zA-Z]{3,4}$#'; |
|
| 87 | + $pattern = '#^'.preg_quote($this->options->getUriPath(), '#').'/[0-9a-z]/[0-9a-z]/([0-9a-z]+)\.[a-zA-Z]{3,4}$#'; |
|
| 88 | 88 | $matches = []; |
| 89 | 89 | preg_match($pattern, $uri, $matches); |
| 90 | 90 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | $dir = rtrim($dir, '/\\'); |
| 122 | 122 | |
| 123 | - if (! is_dir($dir)) { |
|
| 123 | + if (!is_dir($dir)) { |
|
| 124 | 124 | $this->createDirectoryRecursively(dirname($dir)); |
| 125 | 125 | |
| 126 | 126 | $oldUmask = umask(0); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function getSubscribedEvents() |
| 50 | 50 | { |
| 51 | - if (! $this->manager->isEnabled()) { |
|
| 51 | + if (!$this->manager->isEnabled()) { |
|
| 52 | 52 | return []; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -66,19 +66,19 @@ discard block |
||
| 66 | 66 | $organization = $eventArgs->getDocument(); |
| 67 | 67 | |
| 68 | 68 | // check for a organization instance |
| 69 | - if (! $organization instanceof Organization) { |
|
| 69 | + if (!$organization instanceof Organization) { |
|
| 70 | 70 | return; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // check if the image has been changed |
| 74 | - if (! $eventArgs->hasChangedField('image')) { |
|
| 74 | + if (!$eventArgs->hasChangedField('image')) { |
|
| 75 | 75 | return; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $image = $eventArgs->getOldValue('image'); |
| 79 | 79 | |
| 80 | 80 | // check if any image existed |
| 81 | - if (! $image instanceof OrganizationImage) { |
|
| 81 | + if (!$image instanceof OrganizationImage) { |
|
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | */ |
| 46 | 46 | public function __construct($options = null) |
| 47 | 47 | { |
| 48 | - $this->filePath = __DIR__ . '/../../../../../public' . $this->uriPath; |
|
| 48 | + $this->filePath = __DIR__.'/../../../../../public'.$this->uriPath; |
|
| 49 | 49 | |
| 50 | 50 | parent::__construct($options); |
| 51 | 51 | } |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | */ |
| 92 | 92 | protected function injectAttachableEntityManager(AttachableEntityInterface $entity) |
| 93 | 93 | { |
| 94 | - if (! isset($this->attachableEntityManagerPrototype)) { |
|
| 94 | + if (!isset($this->attachableEntityManagerPrototype)) { |
|
| 95 | 95 | $this->attachableEntityManagerPrototype = new AttachableEntityManager($this->services->get('repositories')); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -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 | } |