@@ -57,7 +57,7 @@ |
||
57 | 57 | protected function filterArrayStrings($array, $search, $replace) |
58 | 58 | { |
59 | 59 | $return = array(); |
60 | - foreach ((array)$array as $key => $value) { |
|
60 | + foreach ((array) $array as $key => $value) { |
|
61 | 61 | $key = str_replace($search, $replace, $key); |
62 | 62 | $value = is_array($value) |
63 | 63 | ? $this->filterArrayStrings($value, $search, $replace) |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function getUri() |
35 | 35 | { |
36 | - return "/file/Cv.ContactImage/" . $this->id . "/" .urlencode($this->name); |
|
36 | + return "/file/Cv.ContactImage/".$this->id."/".urlencode($this->name); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $formAction = $formInstance->getAttribute('action'); |
322 | 322 | |
323 | 323 | if (empty($formAction)) { |
324 | - $formInstance->setAttribute('action', '?form=' . $formName); |
|
324 | + $formInstance->setAttribute('action', '?form='.$formName); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | if (isset($form['label'])) { |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | $spec->setParent($this); |
387 | 387 | } |
388 | 388 | |
389 | - $spec = [ '__instance__' => $spec, 'name' => $key, 'entity' => '*' ]; |
|
389 | + $spec = ['__instance__' => $spec, 'name' => $key, 'entity' => '*']; |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | if (!is_array($spec)) { |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | } |
506 | 506 | $this->activeForms = array_filter( |
507 | 507 | $this->activeForms, |
508 | - function ($item) use ($key) { |
|
508 | + function($item) use ($key) { |
|
509 | 509 | return !in_array($item, $key); |
510 | 510 | } |
511 | 511 | ); |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | * @throws \InvalidArgumentException |
520 | 520 | * @return Container |
521 | 521 | */ |
522 | - public function setEntity($entity, $key='*') |
|
522 | + public function setEntity($entity, $key = '*') |
|
523 | 523 | { |
524 | 524 | if (!$entity instanceof EntityInterface) |
525 | 525 | { |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | * |
543 | 543 | * @return \Core\Entity\EntityInterface |
544 | 544 | */ |
545 | - public function getEntity($key='*') |
|
545 | + public function getEntity($key = '*') |
|
546 | 546 | { |
547 | 547 | return isset($this->entities[$key]) ? $this->entities[$key] : null; |
548 | 548 | } |
@@ -745,10 +745,10 @@ discard block |
||
745 | 745 | $actualKey = $this->getActiveFormActual(); |
746 | 746 | if (isset($actualKey)) { |
747 | 747 | $forms = array_keys($this->forms); |
748 | - $formsFlip = array_flip($forms); |
|
748 | + $formsFlip = array_flip($forms); |
|
749 | 749 | $index = $formsFlip[$actualKey]; |
750 | 750 | if (0 < $index) { |
751 | - $key = $forms[$index-1]; |
|
751 | + $key = $forms[$index - 1]; |
|
752 | 752 | } |
753 | 753 | } |
754 | 754 | return $key; |
@@ -765,10 +765,10 @@ discard block |
||
765 | 765 | $actualKey = $this->getActiveFormActual(); |
766 | 766 | if (isset($actualKey)) { |
767 | 767 | $forms = array_keys($this->forms); |
768 | - $formsFlip = array_flip($forms); |
|
768 | + $formsFlip = array_flip($forms); |
|
769 | 769 | $index = $formsFlip[$actualKey]; |
770 | 770 | if ($index < count($forms) - 1) { |
771 | - $key = $forms[$index+1]; |
|
771 | + $key = $forms[$index + 1]; |
|
772 | 772 | } |
773 | 773 | } |
774 | 774 | return $key; |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | */ |
783 | 783 | public function formatAction($name) |
784 | 784 | { |
785 | - return sprintf('%s%s', $this->hasParent() ? $this->getName() . '.' : '', $name); |
|
785 | + return sprintf('%s%s', $this->hasParent() ? $this->getName().'.' : '', $name); |
|
786 | 786 | } |
787 | 787 | |
788 | 788 | /** |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | public function getActionFor($key) |
793 | 793 | { |
794 | 794 | if (isset($this->forms[$key])) { |
795 | - return '?form=' . $this->formatAction($this->forms[$key]['name']); |
|
795 | + return '?form='.$this->formatAction($this->forms[$key]['name']); |
|
796 | 796 | } |
797 | 797 | } |
798 | 798 | } |
799 | 799 | \ No newline at end of file |
@@ -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 |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function getKeys() |
118 | 118 | { |
119 | - return $this->collection->map(function ($element) { |
|
119 | + return $this->collection->map(function($element) { |
|
120 | 120 | return $this->getKey($element); |
121 | 121 | })->toArray(); |
122 | 122 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | */ |
310 | 310 | public function offsetExists($offset) |
311 | 311 | { |
312 | - return (bool)$this->getElement($offset); |
|
312 | + return (bool) $this->getElement($offset); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /** |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | { |
360 | 360 | if (!isset($this->identityExtractor)) { |
361 | 361 | // default identity extractor |
362 | - $this->identityExtractor = function ($element) { |
|
362 | + $this->identityExtractor = function($element) { |
|
363 | 363 | if (!is_callable([$element, 'getId'])) { |
364 | 364 | throw new \LogicException('$element must have getId() method'); |
365 | 365 | } |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | */ |
387 | 387 | protected function getElement($key) |
388 | 388 | { |
389 | - return $this->collection->filter(function ($element) use ($key) { |
|
389 | + return $this->collection->filter(function($element) use ($key) { |
|
390 | 390 | return $this->getKey($element) == $key; |
391 | 391 | })->first(); |
392 | 392 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | public function __construct($status = self::NONPUBLIC) |
48 | 48 | { |
49 | 49 | if (!isset(static::$orderMap[$status])) { |
50 | - throw new \DomainException('Unknown status: ' . $status); |
|
50 | + throw new \DomainException('Unknown status: '.$status); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $this->name = $status; |
@@ -16,9 +16,9 @@ |
||
16 | 16 | interface StatusInterface extends EntityInterface |
17 | 17 | { |
18 | 18 | |
19 | - const NONPUBLIC = /*@translate*/ 'private'; |
|
19 | + const NONPUBLIC = /*@translate*/ 'private'; |
|
20 | 20 | |
21 | - const PUBLIC_TO_ALL = /*@translate*/ 'public to all'; |
|
21 | + const PUBLIC_TO_ALL = /*@translate*/ 'public to all'; |
|
22 | 22 | |
23 | 23 | public function __construct($status = self::NONPUBLIC); |
24 | 24 |
@@ -90,16 +90,16 @@ |
||
90 | 90 | /* @var \Zend\Paginator\Paginator $paginator */ |
91 | 91 | /* @var CreatePaginatorEvent $event */ |
92 | 92 | $events = $this->serviceManager->get('Core/CreatePaginator/Events'); |
93 | - $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR,$this,[ |
|
93 | + $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR, $this, [ |
|
94 | 94 | 'paginatorParams' => $params, |
95 | 95 | 'paginators' => $paginators, |
96 | 96 | 'paginatorName' => $paginatorName |
97 | 97 | ]); |
98 | 98 | $events->trigger($event); |
99 | 99 | $paginator = $event->getPaginator(); |
100 | - if(!$paginator instanceof Paginator){ |
|
100 | + if (!$paginator instanceof Paginator) { |
|
101 | 101 | // no paginator created by listener, so let's create default paginator |
102 | - $paginator = $paginators->get($paginatorName,$params); |
|
102 | + $paginator = $paginators->get($paginatorName, $params); |
|
103 | 103 | } |
104 | 104 | $paginator->setCurrentPageNumber(isset($params['page']) ? $params['page'] : 1) |
105 | 105 | ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10) |
@@ -125,16 +125,16 @@ |
||
125 | 125 | |
126 | 126 | public function setParams($params) |
127 | 127 | { |
128 | - if(is_array($params)){ |
|
129 | - if(isset($params['paginatorParams'])){ |
|
128 | + if (is_array($params)) { |
|
129 | + if (isset($params['paginatorParams'])) { |
|
130 | 130 | $this->setPaginatorParams($params['paginatorParams']); |
131 | 131 | unset($params['paginatorParams']); |
132 | 132 | } |
133 | - if(isset($params['paginators'])){ |
|
133 | + if (isset($params['paginators'])) { |
|
134 | 134 | $this->setPaginators($params['paginators']); |
135 | 135 | unset($params['paginators']); |
136 | 136 | } |
137 | - if(isset($params['paginatorName'])){ |
|
137 | + if (isset($params['paginatorName'])) { |
|
138 | 138 | $this->setPaginatorName($params['paginatorName']); |
139 | 139 | unset($params['paginatorName']); |
140 | 140 | } |