@@ -74,6 +74,9 @@ |
||
| 74 | 74 | return $this->renderElements($fieldset, true); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | + /** |
|
| 78 | + * @return null|FormInterface |
|
| 79 | + */ |
|
| 77 | 80 | public function renderElements($fieldset, $buttonsFieldset, $colMap = null, $buttonsSpan = null) |
| 78 | 81 | { |
| 79 | 82 | if ($fieldset instanceOf ViewPartialProviderInterface) { |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | $content = $this->renderElements($elements, $buttons, $colMap, $buttonsSpan); |
| 65 | 65 | |
| 66 | 66 | return $this->openTag($form) |
| 67 | - . '<div class="row" style="padding: 0 15px;">' |
|
| 68 | - . $content . '</div>' . $this->closeTag(); |
|
| 67 | + . '<div class="row" style="padding: 0 15px;">' |
|
| 68 | + . $content . '</div>' . $this->closeTag(); |
|
| 69 | 69 | |
| 70 | 70 | } |
| 71 | 71 | |
@@ -104,15 +104,15 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | if ($fieldset instanceOf TextSearchFormFieldset && $element->getName() == $fieldset->getButtonElement()) { |
| 106 | 106 | $content.='<div class="input-group col-md-' . $cols . '">' |
| 107 | - . $formElement($element) |
|
| 108 | - . '<div class="input-group-btn search-form-buttons" style="width: 0px;">' |
|
| 109 | - . $this->renderElements($buttonsFieldset, true) . '</div>' |
|
| 110 | - . '</div>'; |
|
| 107 | + . $formElement($element) |
|
| 108 | + . '<div class="input-group-btn search-form-buttons" style="width: 0px;">' |
|
| 109 | + . $this->renderElements($buttonsFieldset, true) . '</div>' |
|
| 110 | + . '</div>'; |
|
| 111 | 111 | $buttonsRendered = true; |
| 112 | 112 | } else { |
| 113 | 113 | $content .= '<div class="input-group col-md-' . $cols . '">' |
| 114 | - . $formElement($element) |
|
| 115 | - . '</div>'; |
|
| 114 | + . $formElement($element) |
|
| 115 | + . '</div>'; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $i += 1; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $buttonsSpan = $buttonsFieldset->getSpan(); |
| 124 | 124 | } |
| 125 | 125 | $content .= '<div class="input-group search-form-buttons col-md-' . $buttonsSpan . ' text-right">' |
| 126 | - . '<div class="btn-group">' . $this->renderElements($buttonsFieldset, true) .'</div></div>'; |
|
| 126 | + . '<div class="btn-group">' . $this->renderElements($buttonsFieldset, true) .'</div></div>'; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | return $content; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * @param array $colMap |
| 34 | 34 | * @return Form|string |
| 35 | 35 | */ |
| 36 | - public function __invoke(FormInterface $form = null, $colMap=null) |
|
| 36 | + public function __invoke(FormInterface $form = null, $colMap = null) |
|
| 37 | 37 | { |
| 38 | 38 | if (!$form) { |
| 39 | 39 | return $this; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | return $this->render($form, $colMap); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public function render(FormInterface $form, $colMap=null, $buttonsSpan = null) |
|
| 45 | + public function render(FormInterface $form, $colMap = null, $buttonsSpan = null) |
|
| 46 | 46 | { |
| 47 | 47 | $headscript = $this->getView()->plugin('headscript'); |
| 48 | 48 | $basepath = $this->getView()->plugin('basepath'); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | if ($form instanceOf ViewPartialProviderInterface) { |
| 58 | - return $this->getView()->partial($form->getViewPartial(), [ 'element' => $form, 'colMap' => $colMap, 'buttonsSpan' => $buttonsSpan ]); |
|
| 58 | + return $this->getView()->partial($form->getViewPartial(), ['element' => $form, 'colMap' => $colMap, 'buttonsSpan' => $buttonsSpan]); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $elements = $form->getElements(); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | return $this->openTag($form) |
| 67 | 67 | . '<div class="row" style="padding: 0 15px;">' |
| 68 | - . $content . '</div>' . $this->closeTag(); |
|
| 68 | + . $content.'</div>'.$this->closeTag(); |
|
| 69 | 69 | |
| 70 | 70 | } |
| 71 | 71 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | public function renderElements($fieldset, $buttonsFieldset, $colMap = null, $buttonsSpan = null) |
| 78 | 78 | { |
| 79 | 79 | if ($fieldset instanceOf ViewPartialProviderInterface) { |
| 80 | - return $this->getView()->partial($fieldset->getViewPartial(), [ 'element' => $fieldset, 'colMap' => $colMap, 'buttonsSpan' => $buttonsSpan ]); |
|
| 80 | + return $this->getView()->partial($fieldset->getViewPartial(), ['element' => $fieldset, 'colMap' => $colMap, 'buttonsSpan' => $buttonsSpan]); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | if (true !== $buttonsFieldset && null === $colMap) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $formElement = $this->getView()->plugin('formElement'); |
| 88 | - $content = ''; $buttonsRendered = false; $i=0; |
|
| 88 | + $content = ''; $buttonsRendered = false; $i = 0; |
|
| 89 | 89 | foreach ($fieldset as $element) { |
| 90 | 90 | if (true === $buttonsFieldset) { |
| 91 | 91 | $content .= $formElement($element); |
@@ -103,14 +103,14 @@ discard block |
||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | if ($fieldset instanceOf TextSearchFormFieldset && $element->getName() == $fieldset->getButtonElement()) { |
| 106 | - $content.='<div class="input-group col-md-' . $cols . '">' |
|
| 106 | + $content .= '<div class="input-group col-md-'.$cols.'">' |
|
| 107 | 107 | . $formElement($element) |
| 108 | 108 | . '<div class="input-group-btn search-form-buttons" style="width: 0px;">' |
| 109 | - . $this->renderElements($buttonsFieldset, true) . '</div>' |
|
| 109 | + . $this->renderElements($buttonsFieldset, true).'</div>' |
|
| 110 | 110 | . '</div>'; |
| 111 | 111 | $buttonsRendered = true; |
| 112 | 112 | } else { |
| 113 | - $content .= '<div class="input-group col-md-' . $cols . '">' |
|
| 113 | + $content .= '<div class="input-group col-md-'.$cols.'">' |
|
| 114 | 114 | . $formElement($element) |
| 115 | 115 | . '</div>'; |
| 116 | 116 | } |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | if (null === $buttonsSpan) { |
| 123 | 123 | $buttonsSpan = $buttonsFieldset->getSpan(); |
| 124 | 124 | } |
| 125 | - $content .= '<div class="input-group search-form-buttons col-md-' . $buttonsSpan . ' text-right">' |
|
| 126 | - . '<div class="btn-group">' . $this->renderElements($buttonsFieldset, true) .'</div></div>'; |
|
| 125 | + $content .= '<div class="input-group search-form-buttons col-md-'.$buttonsSpan.' text-right">' |
|
| 126 | + . '<div class="btn-group">'.$this->renderElements($buttonsFieldset, true).'</div></div>'; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | return $content; |
@@ -84,9 +84,9 @@ |
||
| 84 | 84 | $imageStrategy = $infoContainer->getForm('info.image') |
| 85 | 85 | ->getHydrator() |
| 86 | 86 | ->getStrategy('image'); |
| 87 | - $fileEntity = $imageStrategy->getFileEntity(); |
|
| 88 | - $fileEntity->setUser($user); |
|
| 89 | - $imageStrategy->setFileEntity($fileEntity); |
|
| 87 | + $fileEntity = $imageStrategy->getFileEntity(); |
|
| 88 | + $fileEntity->setUser($user); |
|
| 89 | + $imageStrategy->setFileEntity($fileEntity); |
|
| 90 | 90 | |
| 91 | 91 | if ($this->request->isPost()) { |
| 92 | 92 | $formName = $params->fromQuery('form'); |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | return $this->pagination([ |
| 46 | 46 | 'paginator' => ['Auth/User', 'as' => 'users'], |
| 47 | 47 | 'form' => [ |
| 48 | - [ 'Core/TextSearch', [ |
|
| 48 | + ['Core/TextSearch', [ |
|
| 49 | 49 | 'elements_options' => [ |
| 50 | 50 | 'text_placeholder' => /*@translate*/ 'Type name, email address, role, or login name', |
| 51 | 51 | 'button_element' => 'text', |
@@ -25,9 +25,9 @@ |
||
| 25 | 25 | public function indexAction() |
| 26 | 26 | { |
| 27 | 27 | return $this->pagination([ |
| 28 | - 'form' => ['Core/TextSearch', 'as' => 'form'], |
|
| 29 | - 'paginator' => ['Orders', [ 'sort' => 'date'], 'as' => 'orders'] |
|
| 30 | - ]); |
|
| 28 | + 'form' => ['Core/TextSearch', 'as' => 'form'], |
|
| 29 | + 'paginator' => ['Orders', [ 'sort' => 'date'], 'as' => 'orders'] |
|
| 30 | + ]); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public function viewAction() |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | return $this->pagination([ |
| 28 | 28 | 'form' => ['Core/TextSearch', 'as' => 'form'], |
| 29 | - 'paginator' => ['Orders', [ 'sort' => 'date'], 'as' => 'orders'] |
|
| 29 | + 'paginator' => ['Orders', ['sort' => 'date'], 'as' => 'orders'] |
|
| 30 | 30 | ]); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $order = $repository->find($id); |
| 45 | 45 | |
| 46 | 46 | if (!$order) { |
| 47 | - throw new \InvalidArgumentException('No order with id "' . $id . '" found.'); |
|
| 47 | + throw new \InvalidArgumentException('No order with id "'.$id.'" found.'); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | return [ |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | 'label' => $label, |
| 67 | 67 | ], |
| 68 | 68 | 'attributes' => [ |
| 69 | - 'class' => 'btn btn-' . ('submit' == $type ? 'primary' : 'default'), |
|
| 69 | + 'class' => 'btn btn-'.('submit' == $type ? 'primary' : 'default'), |
|
| 70 | 70 | 'type' => $type, |
| 71 | 71 | ], |
| 72 | 72 | ]; |
@@ -98,6 +98,6 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function getSpan() |
| 100 | 100 | { |
| 101 | - return $this->getOption('span') ? : 12; |
|
| 101 | + return $this->getOption('span') ?: 12; |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | \ No newline at end of file |
@@ -53,10 +53,10 @@ |
||
| 53 | 53 | public function init() |
| 54 | 54 | { |
| 55 | 55 | $this->setAttributes([ |
| 56 | - 'class' => 'form-inline search-form', |
|
| 57 | - 'data-handle-by' => 'script', |
|
| 58 | - 'method' => 'get', |
|
| 59 | - ] |
|
| 56 | + 'class' => 'form-inline search-form', |
|
| 57 | + 'data-handle-by' => 'script', |
|
| 58 | + 'method' => 'get', |
|
| 59 | + ] |
|
| 60 | 60 | ); |
| 61 | 61 | |
| 62 | 62 | if (!$this->hasAttribute('name')) { |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | $elements = $this->elementsFieldset; |
| 67 | 67 | |
| 68 | 68 | if (!is_object($elements)) { |
| 69 | - $elements = ['type' => $elements, 'options' => $this->getOption('elements_options') ? : []]; |
|
| 69 | + $elements = ['type' => $elements, 'options' => $this->getOption('elements_options') ?: []]; |
|
| 70 | 70 | |
| 71 | 71 | } |
| 72 | 72 | |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | public function init() |
| 127 | 127 | { |
| 128 | 128 | $this->addTextElement( |
| 129 | - $this->getOption('text_label') |
|
| 129 | + $this->getOption('text_label') |
|
| 130 | 130 | ? : /*@translate*/ 'Search', |
| 131 | - $this->getOption('text_placeholder') |
|
| 131 | + $this->getOption('text_placeholder') |
|
| 132 | 132 | ? : /*@translate*/ 'Search query', |
| 133 | - $this->getOption('text_span') ? : 12 |
|
| 133 | + $this->getOption('text_span') ? : 12 |
|
| 134 | 134 | ); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | && $elementOrFieldset['options']['is_button_element'] |
| 146 | 146 | ) { |
| 147 | 147 | $this->setButtonElement( |
| 148 | - isset($flags['name']) ? $flags['name'] : $elementOrFieldset['name'] |
|
| 148 | + isset($flags['name']) ? $flags['name'] : $elementOrFieldset['name'] |
|
| 149 | 149 | ); |
| 150 | 150 | } |
| 151 | 151 | |
@@ -173,16 +173,16 @@ discard block |
||
| 173 | 173 | protected function addTextElement($label, $placeholder = 'Search query', $span = 12) |
| 174 | 174 | { |
| 175 | 175 | return $this->add([ |
| 176 | - 'type' => 'Text', |
|
| 177 | - 'name' => 'text', |
|
| 178 | - 'options' => [ |
|
| 179 | - 'label' => $label, |
|
| 180 | - 'span' => $span, |
|
| 181 | - ], |
|
| 182 | - 'attributes' => [ |
|
| 183 | - 'placeholder' => $placeholder, |
|
| 184 | - ], |
|
| 185 | - ] |
|
| 176 | + 'type' => 'Text', |
|
| 177 | + 'name' => 'text', |
|
| 178 | + 'options' => [ |
|
| 179 | + 'label' => $label, |
|
| 180 | + 'span' => $span, |
|
| 181 | + ], |
|
| 182 | + 'attributes' => [ |
|
| 183 | + 'placeholder' => $placeholder, |
|
| 184 | + ], |
|
| 185 | + ] |
|
| 186 | 186 | ); |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | \ No newline at end of file |
@@ -127,10 +127,10 @@ |
||
| 127 | 127 | { |
| 128 | 128 | $this->addTextElement( |
| 129 | 129 | $this->getOption('text_label') |
| 130 | - ? : /*@translate*/ 'Search', |
|
| 130 | + ?: /*@translate*/ 'Search', |
|
| 131 | 131 | $this->getOption('text_placeholder') |
| 132 | - ? : /*@translate*/ 'Search query', |
|
| 133 | - $this->getOption('text_span') ? : 12 |
|
| 132 | + ?: /*@translate*/ 'Search query', |
|
| 133 | + $this->getOption('text_span') ?: 12 |
|
| 134 | 134 | ); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | if (!is_array($stack)) { |
| 73 | - throw new \InvalidArgumentException('Expected argument to be of type array, but received ' . gettype($stack)); |
|
| 73 | + throw new \InvalidArgumentException('Expected argument to be of type array, but received '.gettype($stack)); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $this->stack = $stack; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | * |
| 137 | 137 | * @return self |
| 138 | 138 | */ |
| 139 | - public function params($namespace, $defaults = [ 'page' => 1 ]) |
|
| 139 | + public function params($namespace, $defaults = ['page' => 1]) |
|
| 140 | 140 | { |
| 141 | 141 | $this->stack['params'] = [$namespace, $defaults]; |
| 142 | 142 | return $this; |
@@ -25,8 +25,8 @@ |
||
| 25 | 25 | public function init() |
| 26 | 26 | { |
| 27 | 27 | $this->addTextElement( |
| 28 | - 'Search', |
|
| 29 | - /*@translate*/ 'search for position or company' |
|
| 28 | + 'Search', |
|
| 29 | + /*@translate*/ 'search for position or company' |
|
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | 32 | |
@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | public function indexAction() |
| 27 | 27 | { |
| 28 | 28 | return $this->pagination([ |
| 29 | - 'params' => [ 'Jobs_Admin', ['text', 'page' => 1, 'companyId', 'status' ] ], |
|
| 30 | - 'form' => [ 'as' => 'form', 'Jobs/AdminSearch' ], |
|
| 31 | - 'paginator' => [ 'as' => 'jobs', 'Jobs/Admin' ], |
|
| 29 | + 'params' => ['Jobs_Admin', ['text', 'page' => 1, 'companyId', 'status']], |
|
| 30 | + 'form' => ['as' => 'form', 'Jobs/AdminSearch'], |
|
| 31 | + 'paginator' => ['as' => 'jobs', 'Jobs/Admin'], |
|
| 32 | 32 | ]); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $oldStatus = $job->getStatus(); |
| 55 | 55 | $job->changeStatus($post['status'], '[System] Status changed via Admin GUI.'); |
| 56 | 56 | $events = $services->get('Jobs/Events'); |
| 57 | - $events->trigger(JobEvent::EVENT_STATUS_CHANGED, $this, [ 'job' => $job, 'status' => $oldStatus ]); |
|
| 57 | + $events->trigger(JobEvent::EVENT_STATUS_CHANGED, $this, ['job' => $job, 'status' => $oldStatus]); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $form->bind($job); |
| 68 | 68 | |
| 69 | - return [ 'form' => $form, 'job' => $job ]; |
|
| 69 | + return ['form' => $form, 'job' => $job]; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | } |
| 73 | 73 | \ No newline at end of file |