@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | public function prepareElement(FormInterface $form) |
| 146 | 146 | { |
| 147 | - $form->setAttribute('class', ($this->isMultiple() ? 'multi' : 'single') . '-file-upload'); |
|
| 147 | + $form->setAttribute('class', ($this->isMultiple() ? 'multi' : 'single').'-file-upload'); |
|
| 148 | 148 | $form->setAttribute('data-is-empty', null === $this->getValue()); |
| 149 | 149 | parent::prepareElement($form); |
| 150 | 150 | } |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $entityName = $this->getName(); |
| 248 | 248 | |
| 249 | 249 | try { |
| 250 | - $fileEntity = $object->{"get" . $entityName}(); |
|
| 250 | + $fileEntity = $object->{"get".$entityName}(); |
|
| 251 | 251 | } catch (\OutOfBoundsException $e) { |
| 252 | 252 | return null; |
| 253 | 253 | } |
@@ -80,12 +80,12 @@ |
||
| 80 | 80 | $collection[] = $this->newEntry; |
| 81 | 81 | $form = $this->buildForm($key, $this->newEntry); |
| 82 | 82 | $eventManager = $form->getEventManager(); |
| 83 | - $eventManager->attach(CoreForm::EVENT_IS_VALID, function (Event $event) use ($collection) { |
|
| 83 | + $eventManager->attach(CoreForm::EVENT_IS_VALID, function(Event $event) use ($collection) { |
|
| 84 | 84 | if (!$event->getParam('isValid')) { |
| 85 | 85 | $collection->removeElement($this->newEntry); |
| 86 | 86 | } |
| 87 | 87 | }); |
| 88 | - $eventManager->attach(CoreForm::EVENT_PREPARE, function (Event $event) use ($collection) { |
|
| 88 | + $eventManager->attach(CoreForm::EVENT_PREPARE, function(Event $event) use ($collection) { |
|
| 89 | 89 | $this->setupForm($event->getTarget(), $collection->indexOf($this->newEntry)); |
| 90 | 90 | }); |
| 91 | 91 | |
@@ -167,7 +167,7 @@ |
||
| 167 | 167 | 'label' => $label, |
| 168 | 168 | ], |
| 169 | 169 | 'attributes' => [ |
| 170 | - 'class' => 'btn btn-' . ('submit' == $type ? 'primary' : 'default'), |
|
| 170 | + 'class' => 'btn btn-'.('submit' == $type ? 'primary' : 'default'), |
|
| 171 | 171 | 'type' => $type, |
| 172 | 172 | ], |
| 173 | 173 | ] |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | public function getEmptySummaryNotice() |
| 52 | 52 | { |
| 53 | - if (! isset($this->emptySummaryNotice) && property_exists($this, 'defaultEmptySummaryNotice')) { |
|
| 53 | + if (!isset($this->emptySummaryNotice) && property_exists($this, 'defaultEmptySummaryNotice')) { |
|
| 54 | 54 | $this->emptySummaryNotice = $this->defaultEmptySummaryNotice; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -79,13 +79,13 @@ |
||
| 79 | 79 | 'name' => [ |
| 80 | 80 | 'required' => true, |
| 81 | 81 | 'filters' => [ |
| 82 | - [ 'name' => 'StringTrim' ], |
|
| 82 | + ['name' => 'StringTrim'], |
|
| 83 | 83 | ], |
| 84 | 84 | ], |
| 85 | 85 | 'value' => [ |
| 86 | 86 | 'required' => false, |
| 87 | 87 | 'filters' => [ |
| 88 | - [ 'name' => 'StringTrim' ], |
|
| 88 | + ['name' => 'StringTrim'], |
|
| 89 | 89 | ], |
| 90 | 90 | ], |
| 91 | 91 | ]; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | * |
| 36 | 36 | * @var array |
| 37 | 37 | */ |
| 38 | - protected $scripts = [ 'modules/Core/js/html.sortable.min.js', 'modules/Core/js/forms.tree-management.js' ]; |
|
| 38 | + protected $scripts = ['modules/Core/js/html.sortable.min.js', 'modules/Core/js/forms.tree-management.js']; |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * Attributes. |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | $formAction = $formInstance->getAttribute('action'); |
| 325 | 325 | |
| 326 | 326 | if (empty($formAction)) { |
| 327 | - $formInstance->setAttribute('action', '?form=' . $formName); |
|
| 327 | + $formInstance->setAttribute('action', '?form='.$formName); |
|
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | // @TODO: [ZF3] which one is correct? $form[options][label] or $form[options] |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | $spec->setParent($this); |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | - $spec = [ '__instance__' => $spec, 'name' => $key, 'entity' => '*' ]; |
|
| 399 | + $spec = ['__instance__' => $spec, 'name' => $key, 'entity' => '*']; |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | if (!is_array($spec)) { |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | } |
| 516 | 516 | $this->activeForms = array_filter( |
| 517 | 517 | $this->activeForms, |
| 518 | - function ($item) use ($key) { |
|
| 518 | + function($item) use ($key) { |
|
| 519 | 519 | return !in_array($item, $key); |
| 520 | 520 | } |
| 521 | 521 | ); |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | * @throws \InvalidArgumentException |
| 530 | 530 | * @return Container |
| 531 | 531 | */ |
| 532 | - public function setEntity($entity, $key='*') |
|
| 532 | + public function setEntity($entity, $key = '*') |
|
| 533 | 533 | { |
| 534 | 534 | if (!$entity instanceof EntityInterface) { |
| 535 | 535 | throw new \InvalidArgumentException(sprintf('$entity must be instance of %s', EntityInterface::class)); |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | * |
| 552 | 552 | * @return \Core\Entity\EntityInterface |
| 553 | 553 | */ |
| 554 | - public function getEntity($key='*') |
|
| 554 | + public function getEntity($key = '*') |
|
| 555 | 555 | { |
| 556 | 556 | return isset($this->entities[$key]) ? $this->entities[$key] : null; |
| 557 | 557 | } |
@@ -753,10 +753,10 @@ discard block |
||
| 753 | 753 | $actualKey = $this->getActiveFormActual(); |
| 754 | 754 | if (isset($actualKey)) { |
| 755 | 755 | $forms = array_keys($this->forms); |
| 756 | - $formsFlip = array_flip($forms); |
|
| 756 | + $formsFlip = array_flip($forms); |
|
| 757 | 757 | $index = $formsFlip[$actualKey]; |
| 758 | 758 | if (0 < $index) { |
| 759 | - $key = $forms[$index-1]; |
|
| 759 | + $key = $forms[$index - 1]; |
|
| 760 | 760 | } |
| 761 | 761 | } |
| 762 | 762 | return $key; |
@@ -773,10 +773,10 @@ discard block |
||
| 773 | 773 | $actualKey = $this->getActiveFormActual(); |
| 774 | 774 | if (isset($actualKey)) { |
| 775 | 775 | $forms = array_keys($this->forms); |
| 776 | - $formsFlip = array_flip($forms); |
|
| 776 | + $formsFlip = array_flip($forms); |
|
| 777 | 777 | $index = $formsFlip[$actualKey]; |
| 778 | 778 | if ($index < count($forms) - 1) { |
| 779 | - $key = $forms[$index+1]; |
|
| 779 | + $key = $forms[$index + 1]; |
|
| 780 | 780 | } |
| 781 | 781 | } |
| 782 | 782 | return $key; |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | */ |
| 791 | 791 | public function formatAction($name) |
| 792 | 792 | { |
| 793 | - return sprintf('%s%s', $this->hasParent() ? $this->getName() . '.' : '', $name); |
|
| 793 | + return sprintf('%s%s', $this->hasParent() ? $this->getName().'.' : '', $name); |
|
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | /** |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | public function getActionFor($key) |
| 801 | 801 | { |
| 802 | 802 | if (isset($this->forms[$key])) { |
| 803 | - return '?form=' . $this->formatAction($this->forms[$key]['name']); |
|
| 803 | + return '?form='.$this->formatAction($this->forms[$key]['name']); |
|
| 804 | 804 | } |
| 805 | 805 | } |
| 806 | 806 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @var string |
| 48 | 48 | */ |
| 49 | - protected $language="de"; |
|
| 49 | + protected $language = "de"; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * @var |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public function render(ElementInterface $element) |
| 62 | 62 | { |
| 63 | - $name = $element->getName(); |
|
| 63 | + $name = $element->getName(); |
|
| 64 | 64 | if (empty($name) && $name !== 0) { |
| 65 | 65 | throw new \DomainException( |
| 66 | 66 | sprintf( |
@@ -84,10 +84,10 @@ discard block |
||
| 84 | 84 | //$headscript->prependFile($basepath('/assets/jquery/jquery.min.js')); |
| 85 | 85 | |
| 86 | 86 | $headscript->offsetSetScript( |
| 87 | - '1000_tinymce_' . $this->getTheme(), |
|
| 87 | + '1000_tinymce_'.$this->getTheme(), |
|
| 88 | 88 | ' |
| 89 | 89 | $(document).ready(function() { |
| 90 | - tinyMCE.init({' . $this->additionalOptions() . ', |
|
| 90 | + tinyMCE.init({' . $this->additionalOptions().', |
|
| 91 | 91 | skin_url: "'.$this->skinUrl.'", |
| 92 | 92 | setup: function(editor) { |
| 93 | 93 | |
@@ -135,15 +135,15 @@ discard block |
||
| 135 | 135 | $content = ''; |
| 136 | 136 | } |
| 137 | 137 | if (is_string($content)) { |
| 138 | - $class = array_key_exists('class', $attributes)?$attributes['class']:''; |
|
| 139 | - $class .= (empty($class)?:' ') . ' tinymce_' . $this->getTheme(); |
|
| 138 | + $class = array_key_exists('class', $attributes) ? $attributes['class'] : ''; |
|
| 139 | + $class .= (empty($class) ?: ' ').' tinymce_'.$this->getTheme(); |
|
| 140 | 140 | $attributes['class'] = $class; |
| 141 | 141 | $placeHolder = ''; |
| 142 | 142 | $elementOptions = $element->getOptions(); |
| 143 | 143 | if (array_key_exists('placeholder', $elementOptions) && !empty($elementOptions['placeholder'])) { |
| 144 | - $placeHolder = '<div id="placeholder-' . $name . '" style="border: 0 none; position: relative; top: 0ex; left: 10px; color: #aaa; height: 0px; overflow: visible;' . |
|
| 145 | - (empty($content)?'':'display:none;') . |
|
| 146 | - '">' . $this->translator->translate($elementOptions['placeholder']) . '</div>'; |
|
| 144 | + $placeHolder = '<div id="placeholder-'.$name.'" style="border: 0 none; position: relative; top: 0ex; left: 10px; color: #aaa; height: 0px; overflow: visible;'. |
|
| 145 | + (empty($content) ? '' : 'display:none;'). |
|
| 146 | + '">'.$this->translator->translate($elementOptions['placeholder']).'</div>'; |
|
| 147 | 147 | } |
| 148 | 148 | return |
| 149 | 149 | $placeHolder |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | public function setLanguage($language) |
| 183 | 183 | { |
| 184 | - $this->language=$language; |
|
| 184 | + $this->language = $language; |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | /** |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | public function setLanguagePath($languagePath) |
| 193 | 193 | { |
| 194 | - $this->languagePath=$languagePath; |
|
| 194 | + $this->languagePath = $languagePath; |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | if (!$elementId) { |
| 70 | 70 | $elementId = preg_replace( |
| 71 | 71 | array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'), |
| 72 | - array('-' , '-' , '' ), |
|
| 72 | + array('-', '-', ''), |
|
| 73 | 73 | $element->getName() |
| 74 | 74 | ); |
| 75 | 75 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | if (!$elementOrFieldsetId) { |
| 105 | 105 | $elementOrFieldsetId = preg_replace( |
| 106 | 106 | array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'), |
| 107 | - array('-' , '-' , '' ), |
|
| 107 | + array('-', '-', ''), |
|
| 108 | 108 | $elementOrFieldset->getName() |
| 109 | 109 | ); |
| 110 | 110 | } |