@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | Nav::add('sidebar', 'user-details', [ |
20 | 20 | 'weight' => 9, |
21 | - 'callable' => function (AppView $view) { |
|
21 | + 'callable' => function(AppView $view) { |
|
22 | 22 | return $view->element('Backend.Nav/sidebar/user_details'); |
23 | 23 | } |
24 | 24 | ]); |
@@ -36,11 +36,11 @@ |
||
36 | 36 | */ |
37 | 37 | public function initialize(array $config) |
38 | 38 | { |
39 | - $this->_configWrite('prepareBtnClass', function (Helper $form, $options, $button) { |
|
39 | + $this->_configWrite('prepareBtnClass', function(Helper $form, $options, $button) { |
|
40 | 40 | return $this->_prepareBtn($form, $options, $button); |
41 | 41 | }); |
42 | 42 | |
43 | - $this->_configWrite('prepareTooltip', function (Helper $html, $options, $tooltip) { |
|
43 | + $this->_configWrite('prepareTooltip', function(Helper $html, $options, $tooltip) { |
|
44 | 44 | return $this->_prepareTooltip($html, $options, $tooltip); |
45 | 45 | }); |
46 | 46 |
@@ -35,9 +35,9 @@ |
||
35 | 35 | */ |
36 | 36 | public function render(array $data, ContextInterface $context) |
37 | 37 | { |
38 | - $data += ['class' => '']; |
|
39 | - $data['class'] .= ' filled-in '; |
|
40 | - $data['class'] = trim($data['class']); |
|
38 | + $data += [ 'class' => '' ]; |
|
39 | + $data[ 'class' ] .= ' filled-in '; |
|
40 | + $data[ 'class' ] = trim($data[ 'class' ]); |
|
41 | 41 | |
42 | 42 | return parent::render($data, $context); |
43 | 43 | } |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | ]; |
62 | 62 | |
63 | 63 | if (Arr::key('tooltipPos', $options)) { |
64 | - $_options['data-position'] = (string) $options['tooltipPos']; |
|
65 | - unset($options['tooltipPos']); |
|
64 | + $_options[ 'data-position' ] = (string) $options[ 'tooltipPos' ]; |
|
65 | + unset($options[ 'tooltipPos' ]); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $options = $this->_tooltipTitle($options, $tooltip); |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | protected function _tooltipTitle(array $options, $tooltip) |
83 | 83 | { |
84 | 84 | if ($tooltip === true && !Arr::key('title', $options)) { |
85 | - $options['title'] = strip_tags($options['label']); |
|
85 | + $options[ 'title' ] = strip_tags($options[ 'label' ]); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | if (is_string($tooltip)) { |
89 | - $options['title'] = $tooltip; |
|
89 | + $options[ 'title' ] = $tooltip; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | return $options; |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | protected function _dataTooltip(array $options, $tooltip) |
103 | 103 | { |
104 | 104 | if (Arr::key('title', $options)) { |
105 | - $options['data-tooltip'] = $options['title']; |
|
105 | + $options[ 'data-tooltip' ] = $options[ 'title' ]; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | if (is_string($tooltip)) { |
109 | - $options['data-tooltip'] = $tooltip; |
|
109 | + $options[ 'data-tooltip' ] = $tooltip; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return $options; |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public $helpers = [ |
34 | 34 | 'Core.Js', |
35 | - 'Url' => ['className' => 'Core.Url'], |
|
36 | - 'Html' => ['className' => 'Backend.Html'] |
|
35 | + 'Url' => [ 'className' => 'Core.Url' ], |
|
36 | + 'Html' => [ 'className' => 'Backend.Html' ] |
|
37 | 37 | ]; |
38 | 38 | } |
@@ -31,10 +31,10 @@ |
||
31 | 31 | use PrepareHelpers; |
32 | 32 | |
33 | 33 | /** |
34 | - * List of helpers used by this helper. |
|
35 | - * |
|
36 | - * @var array |
|
37 | - */ |
|
34 | + * List of helpers used by this helper. |
|
35 | + * |
|
36 | + * @var array |
|
37 | + */ |
|
38 | 38 | public $helpers = [ |
39 | 39 | 'Url' => ['className' => 'Core.Url'], |
40 | 40 | 'Html' => ['className' => 'Backend.Html'] |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | * @var array |
37 | 37 | */ |
38 | 38 | public $helpers = [ |
39 | - 'Url' => ['className' => 'Core.Url'], |
|
40 | - 'Html' => ['className' => 'Backend.Html'] |
|
39 | + 'Url' => [ 'className' => 'Core.Url' ], |
|
40 | + 'Html' => [ 'className' => 'Backend.Html' ] |
|
41 | 41 | ]; |
42 | 42 | |
43 | 43 | /** |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @return string A generated file input. |
50 | 50 | */ |
51 | - public function file($fieldName, array $options = []) |
|
51 | + public function file($fieldName, array $options = [ ]) |
|
52 | 52 | { |
53 | 53 | $content = parent::file($fieldName, $options); |
54 | 54 | $options = $this->_parseOptions($fieldName, $options); |
55 | 55 | |
56 | - $options['type'] = __FUNCTION__; |
|
56 | + $options[ 'type' ] = __FUNCTION__; |
|
57 | 57 | |
58 | 58 | $result = $this->_inputContainerTemplate([ |
59 | 59 | 'error' => null, |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function initialize(array $config) |
75 | 75 | { |
76 | - $this->_configWrite('prepareBtnClass', function (FormHelper $form, $options, $button) { |
|
76 | + $this->_configWrite('prepareBtnClass', function(FormHelper $form, $options, $button) { |
|
77 | 77 | return $this->_prepareBtn($form, $options, $button); |
78 | 78 | }); |
79 | 79 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @param array $options |
90 | 90 | * @return string |
91 | 91 | */ |
92 | - public function switcher($fieldName, array $options = []) |
|
92 | + public function switcher($fieldName, array $options = [ ]) |
|
93 | 93 | { |
94 | 94 | $input = parent::checkbox($fieldName, $options); |
95 | 95 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'after' => __d('backend', 'On') |
99 | 99 | ]; |
100 | 100 | |
101 | - $title = (Arr::key('title', $options)) ? $options['title'] : $fieldName; |
|
101 | + $title = (Arr::key('title', $options)) ? $options[ 'title' ] : $fieldName; |
|
102 | 102 | |
103 | 103 | if (!empty($title)) { |
104 | 104 | $title = $this->Html->div('switch-title', $title); |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | $content = $this->formatTemplate(__FUNCTION__, [ |
108 | 108 | 'input' => $input, |
109 | 109 | 'title' => $title, |
110 | - 'after' => $options['after'], |
|
111 | - 'before' => $options['before'], |
|
110 | + 'after' => $options[ 'after' ], |
|
111 | + 'before' => $options[ 'before' ], |
|
112 | 112 | 'lever' => '<span class="lever"></span>' |
113 | 113 | ]); |
114 | 114 |
@@ -48,19 +48,19 @@ |
||
48 | 48 | { |
49 | 49 | $data += [ |
50 | 50 | 'name' => '', |
51 | - 'templateVars' => [], |
|
51 | + 'templateVars' => [ ], |
|
52 | 52 | 'escape' => true |
53 | 53 | ]; |
54 | 54 | |
55 | - unset($data['val']); |
|
55 | + unset($data[ 'val' ]); |
|
56 | 56 | |
57 | - $title = (Arr::key('title', $data)) ? $data['title'] : $data['name']; |
|
57 | + $title = (Arr::key('title', $data)) ? $data[ 'title' ] : $data[ 'name' ]; |
|
58 | 58 | |
59 | 59 | return $this->_templates->format('file', [ |
60 | 60 | 'title' => $title, |
61 | - 'name' => $data['name'], |
|
62 | - 'templateVars' => $data['templateVars'], |
|
63 | - 'attrs' => $this->_templates->formatAttributes($data, ['name']) |
|
61 | + 'name' => $data[ 'name' ], |
|
62 | + 'templateVars' => $data[ 'templateVars' ], |
|
63 | + 'attrs' => $this->_templates->formatAttributes($data, [ 'name' ]) |
|
64 | 64 | ]); |
65 | 65 | } |
66 | 66 | } |
@@ -44,10 +44,10 @@ |
||
44 | 44 | */ |
45 | 45 | public function render(array $data, ContextInterface $context) |
46 | 46 | { |
47 | - $data = array_merge(['class' => null], $data); |
|
47 | + $data = array_merge([ 'class' => null ], $data); |
|
48 | 48 | |
49 | - $data['class'] .= ' materialize-textarea'; |
|
50 | - $data['class'] = Str::trim($data['class']); |
|
49 | + $data[ 'class' ] .= ' materialize-textarea'; |
|
50 | + $data[ 'class' ] = Str::trim($data[ 'class' ]); |
|
51 | 51 | |
52 | 52 | return parent::render($data, $context); |
53 | 53 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | 'type' => 'theme', |
32 | 32 | 'backend' => true, |
33 | 33 | ], |
34 | - 'View.initialize' => function (AppView $view) { |
|
34 | + 'View.initialize' => function(AppView $view) { |
|
35 | 35 | $helpers = $view->helpers(); |
36 | 36 | |
37 | 37 | $helpers->unload('Form'); |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | $view->loadHelper('Form', [ |
46 | 46 | 'className' => 'Backend.Form', |
47 | 47 | 'widgets' => [ |
48 | - 'file' => ['Backend\View\Widget\FileWidget'], |
|
49 | - 'textarea' => ['Backend\View\Widget\TextareaWidget'], |
|
50 | - 'checkbox' => ['Backend\View\Widget\CheckboxWidget'] |
|
48 | + 'file' => [ 'Backend\View\Widget\FileWidget' ], |
|
49 | + 'textarea' => [ 'Backend\View\Widget\TextareaWidget' ], |
|
50 | + 'checkbox' => [ 'Backend\View\Widget\CheckboxWidget' ] |
|
51 | 51 | ] |
52 | 52 | ]); |
53 | 53 | } |