@@ -14,10 +14,10 @@ |
||
14 | 14 | protected $validator; |
15 | 15 | |
16 | 16 | /** |
17 | - * Get a validator if none has been set. |
|
18 | - * https://github.com/posabsolute/jQuery-Validation-Engine/issues/265 |
|
19 | - * @return RegexValidator |
|
20 | - */ |
|
17 | + * Get a validator if none has been set. |
|
18 | + * https://github.com/posabsolute/jQuery-Validation-Engine/issues/265 |
|
19 | + * @return RegexValidator |
|
20 | + */ |
|
21 | 21 | public function getValidator() |
22 | 22 | { |
23 | 23 | if (null === $this->validator) { |
@@ -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 | ] |
@@ -83,7 +83,7 @@ |
||
83 | 83 | { |
84 | 84 | /* @var $formElementManager \Zend\Form\FormElementManager\FormElementManagerV3Polyfill */ |
85 | 85 | $formElementManager = $container->get('FormElementManager'); |
86 | - $options=null; |
|
86 | + $options = null; |
|
87 | 87 | if ($this->options) { |
88 | 88 | $options = $container->get($this->options); |
89 | 89 | } |
@@ -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. |
@@ -50,7 +50,7 @@ |
||
50 | 50 | |
51 | 51 | public function init() |
52 | 52 | { |
53 | - $this->setName('items'); |
|
53 | + $this->setName('items'); |
|
54 | 54 | $this->add([ |
55 | 55 | 'type' => 'Collection', |
56 | 56 | 'name' => 'items', |
@@ -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 | } |