@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @param bool $required |
17 | 17 | * @return $this method can be chained |
18 | 18 | */ |
19 | - public function setRequired($required=true); |
|
19 | + public function setRequired($required = true); |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Add a validator to a form field |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return $this Is a chainable function |
54 | 54 | */ |
55 | - public function addValidator($validator, $options=[]); |
|
55 | + public function addValidator($validator, $options = []); |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * @param array $validators |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | public function init() |
32 | 32 | { |
33 | - $this->sourcePath = __DIR__ . '/vendor/ckeditor'; |
|
33 | + $this->sourcePath = __DIR__.'/vendor/ckeditor'; |
|
34 | 34 | parent::init(); |
35 | 35 | } |
36 | 36 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | if (!is_array($value)) |
106 | 106 | throw new \InvalidArgumentException('The value should be an array'); |
107 | 107 | |
108 | - foreach($value as $position => $values) { |
|
108 | + foreach ($value as $position => $values) { |
|
109 | 109 | if (!$this->hasField($position)) { |
110 | 110 | $this->addInstance($position); |
111 | 111 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | { |
121 | 121 | $subFormCount = count(parent::getSubForms()); |
122 | 122 | if ($subFormCount < $this->count) { |
123 | - for ($i = $subFormCount; $i <= $this->count-1; $i++) { |
|
123 | + for ($i = $subFormCount; $i <= $this->count - 1; $i++) { |
|
124 | 124 | $this->addInstance($i); |
125 | 125 | } |
126 | 126 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | * The fields in the template must register their scripts |
132 | 132 | * @param null $view |
133 | 133 | */ |
134 | - public function registerScripts($view=null, $mount=true) |
|
134 | + public function registerScripts($view = null, $mount = true) |
|
135 | 135 | { |
136 | 136 | $view = ($view === null) ? $this->getView() : $view; |
137 | 137 | foreach ($this->getTemplate()->getFields() as $field) |
@@ -209,11 +209,11 @@ discard block |
||
209 | 209 | * Get fields - also add additional instances as appropriate |
210 | 210 | * @inheritdoc |
211 | 211 | */ |
212 | - public function getFields($names=null) |
|
212 | + public function getFields($names = null) |
|
213 | 213 | { |
214 | 214 | $subFormCount = count(parent::getSubForms()); |
215 | 215 | if ($subFormCount < $this->count) { |
216 | - for ($i = $subFormCount; $i <= $this->count-1; $i++) { |
|
216 | + for ($i = $subFormCount; $i <= $this->count - 1; $i++) { |
|
217 | 217 | $this->addInstance(Hash::uuid64()); |
218 | 218 | } |
219 | 219 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $block = ['neonPlugin']; |
73 | 73 | |
74 | 74 | $block['plugin'] = $this->_getPluginNameFromLines($lines, $current); |
75 | - $block['attributes'] = $this->_getPluginAttributesFromLines($lines, $current); |
|
75 | + $block['attributes'] = $this->_getPluginAttributesFromLines($lines, $current); |
|
76 | 76 | $block['content'] = $this->_getPluginContentFromLines($lines, $current, $endLine); |
77 | 77 | |
78 | 78 | return [$block, $endLine]; |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | protected function renderNeonPlugin($block) |
82 | 82 | { |
83 | 83 | $plugin = $block['plugin']; |
84 | - $content = implode("\n",$block['content']); |
|
84 | + $content = implode("\n", $block['content']); |
|
85 | 85 | $attributes = $block['attributes']; |
86 | 86 | if (class_exists($plugin)) |
87 | 87 | return $plugin::widget(array_merge($attributes, ['content' => $content])); |
88 | - return '<div class="alert alert-danger">unknown plugin: "' . $plugin . '"</div>'; |
|
88 | + return '<div class="alert alert-danger">unknown plugin: "'.$plugin.'"</div>'; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | protected function _getPluginAttributesFromLines($lines, $current) |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | } |
106 | 106 | // remove tag and open delimiter from first and last lines |
107 | 107 | $plugin = $this->_getPluginNameFromLines($lines, $current); |
108 | - $lastLine = \count($content)-1; |
|
108 | + $lastLine = \count($content) - 1; |
|
109 | 109 | $content[0] = Str::replaceFirst($openDelimiter, '', $content[0]); |
110 | 110 | $content[0] = Str::replaceFirst($plugin, '', $content[0]); |
111 | 111 | $content[$lastLine] = Str::replaceLast($closeDelimiter, '', $content[$lastLine]); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | // xml part |
115 | 115 | $xml = simplexml_load_string("<attr $attrs></attr>"); |
116 | 116 | $attributes = []; |
117 | - foreach($xml[0]->attributes() as $a => $b) { |
|
117 | + foreach ($xml[0]->attributes() as $a => $b) { |
|
118 | 118 | $attributes[$a] = (string) $b; |
119 | 119 | } |
120 | 120 | return $attributes; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | trigger_error("path: missing 'route' parameter"); |
73 | 73 | } |
74 | 74 | |
75 | - array_unshift($params, $params['route']) ; |
|
75 | + array_unshift($params, $params['route']); |
|
76 | 76 | unset($params['route']); |
77 | 77 | |
78 | 78 | return Url::to($params); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | if ($type === 'block') { |
120 | 120 | // Register widget tag during compile time |
121 | 121 | $this->viewRenderer->widgets['blocks'][$alias] = $class; |
122 | - $this->smarty->registerPlugin('block', $alias, [$this->viewRenderer, '_widget_block__' . $alias]); |
|
122 | + $this->smarty->registerPlugin('block', $alias, [$this->viewRenderer, '_widget_block__'.$alias]); |
|
123 | 123 | |
124 | 124 | // Inject code to re-register widget tag during run-time |
125 | 125 | return <<<PHP |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | } elseif ($type === 'function') { |
138 | 138 | // Register widget tag during compile time |
139 | 139 | $this->viewRenderer->widgets['functions'][$alias] = $class; |
140 | - $this->smarty->registerPlugin('function', $alias, [$this->viewRenderer, '_widget_function__' . $alias]); |
|
140 | + $this->smarty->registerPlugin('function', $alias, [$this->viewRenderer, '_widget_function__'.$alias]); |
|
141 | 141 | |
142 | 142 | // Inject code to re-register widget tag during run-time |
143 | 143 | return <<<PHP |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | */ |
284 | 284 | protected function getViewConstVal($string, $default) |
285 | 285 | { |
286 | - $val = @constant('yii\web\View::' . $string); |
|
286 | + $val = @constant('yii\web\View::'.$string); |
|
287 | 287 | return isset($val) ? $val : $default; |
288 | 288 | } |
289 | 289 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | */ |
8 | 8 | class JQueryUiAsset extends AssetBundle |
9 | 9 | { |
10 | - public $sourcePath = __DIR__ . '/publish/vendor/jqueryui'; |
|
10 | + public $sourcePath = __DIR__.'/publish/vendor/jqueryui'; |
|
11 | 11 | |
12 | 12 | public $js = [ |
13 | 13 | 'jquery-ui.min.js' |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | class CoreAsset extends AssetBundle |
19 | 19 | { |
20 | - public $sourcePath = __DIR__ . '/publish'; |
|
20 | + public $sourcePath = __DIR__.'/publish'; |
|
21 | 21 | |
22 | 22 | public $js = [ |
23 | 23 | (YII_DEBUG ? 'vendor/vue.js' : 'vendor/vue.min.js'), |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | protected function hash($path) |
28 | 28 | { |
29 | - if (isset($this->publishOptions['path'])){ |
|
29 | + if (isset($this->publishOptions['path'])) { |
|
30 | 30 | // if a path is specified then use this instead of a hash |
31 | 31 | return $this->publishOptions['path']; |
32 | 32 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | // of text/html instead of application/json then we are probably browsing the API |
19 | 19 | // and therefore want a prettier version of the response. |
20 | 20 | $acceptableContentTypes = array_keys(neon()->request->getAcceptableContentTypes()); |
21 | - $contentTypeIsHtml = (isset($acceptableContentTypes[0]) && $acceptableContentTypes[0] === 'text/html'); |
|
21 | + $contentTypeIsHtml = (isset($acceptableContentTypes[0]) && $acceptableContentTypes[0] === 'text/html'); |
|
22 | 22 | $prettyGetVarExists = (neon()->request->get('_pretty', false) !== false); |
23 | 23 | if ($contentTypeIsHtml || $prettyGetVarExists) { |
24 | 24 | $this->prettyPrint = true; |