@@ -41,7 +41,7 @@ |
||
| 41 | 41 | * Image specifications. |
| 42 | 42 | */ |
| 43 | 43 | protected array $images = [ |
| 44 | - ImageSetInterface::THUMBNAIL => [100,100], |
|
| 44 | + ImageSetInterface::THUMBNAIL => [100, 100], |
|
| 45 | 45 | ]; |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | 'entity' => $snapshot |
| 126 | 126 | ]); |
| 127 | 127 | $this->dm->getEventManager() |
| 128 | - ->dispatchEvent(DoctrineMongoODM\Event\RepositoryEventsSubscriber::postCreate, $eventArgs); |
|
| 128 | + ->dispatchEvent(DoctrineMongoODM\Event\RepositoryEventsSubscriber::postCreate, $eventArgs); |
|
| 129 | 129 | |
| 130 | 130 | $this->copy($source, $snapshot); |
| 131 | 131 | |
@@ -201,12 +201,12 @@ discard block |
||
| 201 | 201 | public function findLatest($sourceId, $isDraft = false) |
| 202 | 202 | { |
| 203 | 203 | $entity = $this->createQueryBuilder() |
| 204 | - ->field('snapshotEntity')->equals(new ObjectId($sourceId)) |
|
| 205 | - ->field('snapshotMeta.isDraft')->equals($isDraft) |
|
| 206 | - ->sort('snapshotMeta.dateCreated.date', 'desc') |
|
| 207 | - ->limit(1) |
|
| 208 | - ->getQuery() |
|
| 209 | - ->getSingleResult() |
|
| 204 | + ->field('snapshotEntity')->equals(new ObjectId($sourceId)) |
|
| 205 | + ->field('snapshotMeta.isDraft')->equals($isDraft) |
|
| 206 | + ->sort('snapshotMeta.dateCreated.date', 'desc') |
|
| 207 | + ->limit(1) |
|
| 208 | + ->getQuery() |
|
| 209 | + ->getSingleResult() |
|
| 210 | 210 | ; |
| 211 | 211 | if ($entity) { |
| 212 | 212 | $this->dm->getEventManager()->dispatchEvent( |
@@ -69,11 +69,11 @@ |
||
| 69 | 69 | $proxyDir = $config->getProxyDir(); |
| 70 | 70 | $hydratorDir = $config->getHydratorDir(); |
| 71 | 71 | |
| 72 | - if(!is_dir($proxyDir)){ |
|
| 72 | + if (!is_dir($proxyDir)) { |
|
| 73 | 73 | mkdir($proxyDir, 0777, true); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if(!is_dir($hydratorDir)){ |
|
| 76 | + if (!is_dir($hydratorDir)) { |
|
| 77 | 77 | mkdir($hydratorDir, 0777, true); |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | $timezone = $value->getTimezone()->getName(); |
| 57 | 57 | $timestamp = $value->getTimestamp(); |
| 58 | - $date = new UTCDateTime($timestamp*1000); |
|
| 58 | + $date = new UTCDateTime($timestamp * 1000); |
|
| 59 | 59 | |
| 60 | 60 | return array( |
| 61 | 61 | 'date' => $date, |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | public function closureToDatabase() |
| 73 | 73 | { |
| 74 | 74 | return ' |
| 75 | - /* CODE FROM: ' . __METHOD__ . ' */ |
|
| 75 | + /* CODE FROM: ' . __METHOD__.' */ |
|
| 76 | 76 | if (!$value instanceOf \DateTime) return null; |
| 77 | 77 | $return = array( |
| 78 | 78 | "date" => new UTCDateTime($value->getTimestamp()), |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | public function closureToPhp(): string |
| 115 | 115 | { |
| 116 | 116 | return ' |
| 117 | - /* CODE FROM: ' . __METHOD__ . ' */ |
|
| 117 | + /* CODE FROM: ' . __METHOD__.' */ |
|
| 118 | 118 | if (!is_array($value) |
| 119 | 119 | || !isset($value["date"]) |
| 120 | 120 | || is_null($value["date"]) |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $properties = $refl->getProperties(); |
| 50 | 50 | |
| 51 | 51 | foreach ($properties as $property) { |
| 52 | - $name = $property->getName(); |
|
| 52 | + $name = $property->getName(); |
|
| 53 | 53 | |
| 54 | 54 | // @TODO: check if '-' check is necessary |
| 55 | 55 | if ( |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | continue; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - $value = $rating->{'get' . $name}(); |
|
| 62 | + $value = $rating->{'get'.$name}(); |
|
| 63 | 63 | $input = array( |
| 64 | 64 | 'type' => 'Core/Rating', |
| 65 | 65 | 'name' => $name, |
@@ -90,12 +90,12 @@ discard block |
||
| 90 | 90 | </a> |
| 91 | 91 | <div class="fu-errors input-error"> |
| 92 | 92 | <ul class="errors"> |
| 93 | - <li class="fu-error-size">' . $translator->translate('The file is too big', $textDomain) . '</li> |
|
| 94 | - <li class="fu-error-type">' . $translator->translate('The file type is not supported', $textDomain) . '</li> |
|
| 93 | + <li class="fu-error-size">' . $translator->translate('The file is too big', $textDomain).'</li> |
|
| 94 | + <li class="fu-error-type">' . $translator->translate('The file type is not supported', $textDomain).'</li> |
|
| 95 | 95 | <li class="fu-error-count">' . sprintf( |
| 96 | 96 | $translator->translate('You may only upload %d files', $textDomain), |
| 97 | 97 | $element->getAttribute('data-maxfilecount') |
| 98 | -) . '</li><li class="fu-error-general">' . $translator->translate('An unknown error occured.') . '</li> |
|
| 98 | +).'</li><li class="fu-error-general">'.$translator->translate('An unknown error occured.').'</li> |
|
| 99 | 99 | </ul> |
| 100 | 100 | </div> |
| 101 | 101 | </li>'; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | /* @var $basepath \Laminas\View\Helper\BasePath */ |
| 104 | 104 | $renderer = $this->getView(); |
| 105 | 105 | $basepath = $renderer->plugin('basepath'); |
| 106 | - $createFileDisplay = function ($file) use ($template, $basepath) { |
|
| 106 | + $createFileDisplay = function($file) use ($template, $basepath) { |
|
| 107 | 107 | /* @var $file \Core\Entity\FileInterface */ |
| 108 | 108 | $uri = $basepath($file->getUri()); |
| 109 | 109 | $name = $file->getMetadata()->getName(); |
@@ -137,11 +137,11 @@ discard block |
||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | $nonemptynotice = |
| 140 | - '<div class="fu-nonempty-notice"' . ('' == trim($preview) ? ' style="display:none;"' : '') . '>' |
|
| 141 | - . $this->getNonEmptyNotice() . '</div>'; |
|
| 140 | + '<div class="fu-nonempty-notice"'.('' == trim($preview) ? ' style="display:none;"' : '').'>' |
|
| 141 | + . $this->getNonEmptyNotice().'</div>'; |
|
| 142 | 142 | $emptynotice = '<div class="fu-empty-notice"' |
| 143 | - . ('' == trim($preview) ? '' : ' style="display: none;"') . '> |
|
| 144 | - ' . $this->getEmptyNotice() . ' |
|
| 143 | + . ('' == trim($preview) ? '' : ' style="display: none;"').'> |
|
| 144 | + ' . $this->getEmptyNotice().' |
|
| 145 | 145 | </div>'; |
| 146 | 146 | |
| 147 | 147 | $markup = ' |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | */ |
| 289 | 289 | protected function getDefaultNotice() |
| 290 | 290 | { |
| 291 | - return '<small>' . $this->getTranslator()->translate('Click here to add files or use drag and drop.') . '</small>'; |
|
| 291 | + return '<small>'.$this->getTranslator()->translate('Click here to add files or use drag and drop.').'</small>'; |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /** |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | public function setAllowRemove($allowRemove) |
| 300 | 300 | { |
| 301 | - $this->allowRemove = (bool)$allowRemove; |
|
| 301 | + $this->allowRemove = (bool) $allowRemove; |
|
| 302 | 302 | |
| 303 | 303 | return $this; |
| 304 | 304 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | public function setAllowClickableDropZone($allowClickableDropZone) |
| 312 | 312 | { |
| 313 | - $this->allowClickableDropZone = (bool)$allowClickableDropZone; |
|
| 313 | + $this->allowClickableDropZone = (bool) $allowClickableDropZone; |
|
| 314 | 314 | |
| 315 | 315 | return $this; |
| 316 | 316 | } |
@@ -33,15 +33,15 @@ |
||
| 33 | 33 | if ($file && !is_null($file->getMetadata())) { |
| 34 | 34 | $metadata = $file->getMetadata(); |
| 35 | 35 | if (0 === strpos($metadata->getContentType(), 'image/')) { |
| 36 | - $basepath = $this->getView()->plugin('basepath'); |
|
| 37 | - $preview = '<img src="' . $basepath($file->getUri()) . '" class="img-polaroid" />'; |
|
| 36 | + $basepath = $this->getView()->plugin('basepath'); |
|
| 37 | + $preview = '<img src="'.$basepath($file->getUri()).'" class="img-polaroid" />'; |
|
| 38 | 38 | } else { |
| 39 | - $preview = '<span>' . $file->getName() . '(' . $file->getPrettySize() . ')</span>'; |
|
| 39 | + $preview = '<span>'.$file->getName().'('.$file->getPrettySize().')</span>'; |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | $notice = '<div class="iu-empty-notice" style="padding: 10px; color: #d3d3d3;"> |
| 43 | 43 | <div style="padding: 0px 20px 5px;"><span class="yk-icon fa-file-image-o fa-5x"></span></div> |
| 44 | - <small>' . $translator->translate('Click here to add an image or use drag and drop.') . '</small> |
|
| 44 | + <small>' . $translator->translate('Click here to add an image or use drag and drop.').'</small> |
|
| 45 | 45 | |
| 46 | 46 | </div>'; |
| 47 | 47 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $renderer->headscript()->appendFile($renderer->basepath('modules/Core/js/jquery.summary-form.js')); |
| 68 | 68 | |
| 69 | 69 | $label = $form->getLabel(); |
| 70 | - $labelContent = $label ? '<div class="sf-headline"><h3>' . $this->getView()->translate($label) . '</h3></div>' : ''; |
|
| 70 | + $labelContent = $label ? '<div class="sf-headline"><h3>'.$this->getView()->translate($label).'</h3></div>' : ''; |
|
| 71 | 71 | $formContent = $this->renderForm($form, $layout, $parameter); |
| 72 | 72 | $summaryContent = $this->renderSummary($form); |
| 73 | 73 | |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | public function renderForm(SummaryFormInterface $form, $layout = Form::LAYOUT_HORIZONTAL, $parameter = array()) |
| 133 | 133 | { |
| 134 | 134 | /* @var $form SummaryFormInterface|\Core\Form\SummaryForm */ |
| 135 | - $renderer = $this->getView(); /* @var $renderer \Laminas\View\Renderer\PhpRenderer */ |
|
| 136 | - $formHelper = $renderer->plugin('form'); /* @var $formHelper \Core\Form\View\Helper\Form */ |
|
| 135 | + $renderer = $this->getView(); /* @var $renderer \Laminas\View\Renderer\PhpRenderer */ |
|
| 136 | + $formHelper = $renderer->plugin('form'); /* @var $formHelper \Core\Form\View\Helper\Form */ |
|
| 137 | 137 | $fieldset = $form->getBaseFieldset(); |
| 138 | 138 | $resetPartial = false; |
| 139 | 139 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $form->prepare(); |
| 168 | 168 | $baseFieldset = $form->getBaseFieldset(); |
| 169 | 169 | if (!isset($baseFieldset)) { |
| 170 | - throw new \InvalidArgumentException('For the Form ' . get_class($form) . ' there is no Basefieldset'); |
|
| 170 | + throw new \InvalidArgumentException('For the Form '.get_class($form).' there is no Basefieldset'); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | $dataAttributesMarkup = ''; |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - $markup = '<div class="panel panel-default" style="min-height: 100px;"' . $dataAttributesMarkup . '> |
|
| 181 | + $markup = '<div class="panel panel-default" style="min-height: 100px;"'.$dataAttributesMarkup.'> |
|
| 182 | 182 | <div class="panel-body"><div class="sf-controls">%s</div>%s</div></div>'; |
| 183 | 183 | |
| 184 | 184 | $view = $this->getView(); |
@@ -190,9 +190,9 @@ discard block |
||
| 190 | 190 | . '</button>'; |
| 191 | 191 | |
| 192 | 192 | if (($controlButtons = $form->getOption('control_buttons')) !== null) { |
| 193 | - $buttonMarkup .= PHP_EOL . implode(PHP_EOL, array_map(function (array $buttonSpec) use ($view) { |
|
| 194 | - return '<button type="button" class="btn btn-default btn-xs' . (isset($buttonSpec['class']) ? ' ' . $buttonSpec['class'] : '') . '">' |
|
| 195 | - . (isset($buttonSpec['icon']) ? '<span class="yk-icon yk-icon-' . $buttonSpec['icon'] . '"></span> ' : '') |
|
| 193 | + $buttonMarkup .= PHP_EOL.implode(PHP_EOL, array_map(function(array $buttonSpec) use ($view) { |
|
| 194 | + return '<button type="button" class="btn btn-default btn-xs'.(isset($buttonSpec['class']) ? ' '.$buttonSpec['class'] : '').'">' |
|
| 195 | + . (isset($buttonSpec['icon']) ? '<span class="yk-icon yk-icon-'.$buttonSpec['icon'].'"></span> ' : '') |
|
| 196 | 196 | . $view->translate($buttonSpec['label']) |
| 197 | 197 | . '</button>'; |
| 198 | 198 | }, $controlButtons)); |
@@ -232,10 +232,10 @@ discard block |
||
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | if ($element instanceof ViewPartialProviderInterface) { |
| 235 | - $renderer = $this->getView(); /* @var $renderer \Laminas\View\Renderer\PhpRenderer */ |
|
| 235 | + $renderer = $this->getView(); /* @var $renderer \Laminas\View\Renderer\PhpRenderer */ |
|
| 236 | 236 | $origPartial = $element->getViewPartial(); |
| 237 | 237 | $partial = "$origPartial.view"; |
| 238 | - $partialParams = array( |
|
| 238 | + $partialParams = array( |
|
| 239 | 239 | 'element' => $element |
| 240 | 240 | ); |
| 241 | 241 | if (!$renderer->resolver($partial)) { |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | if ($element instanceof FieldsetInterface) { |
| 253 | 253 | if (!$element instanceof FormInterface && $label) { |
| 254 | - $markup .= '<h4>' . $label . '</h4>'; |
|
| 254 | + $markup .= '<h4>'.$label.'</h4>'; |
|
| 255 | 255 | } |
| 256 | 256 | foreach ($element as $el) { |
| 257 | 257 | $markup .= $this->renderSummaryElement($el); |
@@ -283,11 +283,11 @@ discard block |
||
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | $optGroupLabel = isset($optVal['label']) ? $translator->translate($optVal['label']) : $optKey; |
| 286 | - $multiOptions[] = $optGroupLabel . ' | ' . $translator->translate($optVal['options'][$optionKey]); |
|
| 286 | + $multiOptions[] = $optGroupLabel.' | '.$translator->translate($optVal['options'][$optionKey]); |
|
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - $elementValue = '<ul><li>' . join('</li><li>', $multiOptions) . '</li></ul>'; |
|
| 290 | + $elementValue = '<ul><li>'.join('</li><li>', $multiOptions).'</li></ul>'; |
|
| 291 | 291 | } else { |
| 292 | 292 | $elementValue = $translator->translate($options[$elementValue]); |
| 293 | 293 | } |
@@ -301,13 +301,13 @@ discard block |
||
| 301 | 301 | $markup .= '<div class="row">'; |
| 302 | 302 | $col = 12; |
| 303 | 303 | if ($label) { |
| 304 | - $markup .= '<div class="col-md-3 yk-label"><label>' . $label . '</label></div>'; |
|
| 304 | + $markup .= '<div class="col-md-3 yk-label"><label>'.$label.'</label></div>'; |
|
| 305 | 305 | $col = 9; |
| 306 | 306 | } |
| 307 | - if(is_array($elementValue)){ |
|
| 307 | + if (is_array($elementValue)) { |
|
| 308 | 308 | $elementValue = implode(",", $elementValue); |
| 309 | 309 | } |
| 310 | - $markup .= '<div class="col-md-' . $col . '">' . $elementValue . '</div>' |
|
| 310 | + $markup .= '<div class="col-md-'.$col.'">'.$elementValue.'</div>' |
|
| 311 | 311 | . '</div>'; |
| 312 | 312 | return $markup; |
| 313 | 313 | } |
@@ -195,7 +195,7 @@ |
||
| 195 | 195 | ->method('isValid') |
| 196 | 196 | ->willReturn(true); |
| 197 | 197 | |
| 198 | - $result = $this->controller->dispatch($request); |
|
| 198 | + $result = $this->controller->dispatch($request); |
|
| 199 | 199 | |
| 200 | 200 | $expected = array( |
| 201 | 201 | 'form' => $this->formMock |