@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // initialize new DOM model |
31 | 31 | $dom = new Dom(); |
32 | 32 | // return DOM-HTML, build based on closures! |
33 | - return $dom->{$elements['type']}(function () use ($dom, $elements) { |
|
33 | + return $dom->{$elements['type']}(function() use ($dom, $elements) { |
|
34 | 34 | // prepare output avg variable |
35 | 35 | $itemHTML = null; |
36 | 36 | // get active order level |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | return $dom->li(function() use($dom, $item){ |
69 | 69 | $dropdownLink = $dom->a(function() use ($dom, $item){ |
70 | - return self::applyEscape($item['text'], $item['html'], $item['!secure']) . ' ' . $dom->span(function(){}, ['class' => 'caret']); |
|
70 | + return self::applyEscape($item['text'], $item['html'], $item['!secure']).' '.$dom->span(function() {}, ['class' => 'caret']); |
|
71 | 71 | }, $item['dropdown']); |
72 | 72 | |
73 | 73 | $dropdownElements = $dom->ul(function() use ($dom, $item){ |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | return $resp; |
79 | 79 | }, ['class' => 'dropdown-menu']); |
80 | 80 | |
81 | - return $dropdownLink . $dropdownElements; |
|
81 | + return $dropdownLink.$dropdownElements; |
|
82 | 82 | }, $item['property']); |
83 | 83 | |
84 | 84 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $item['linkProperty']['href'] = self::convertLink($item['link']); |
131 | 131 | |
132 | 132 | // build output <li@params><a @params>@text</li> |
133 | - return $dom->li(function () use ($dom, $text, $item) { |
|
133 | + return $dom->li(function() use ($dom, $text, $item) { |
|
134 | 134 | return $dom->a(function() use ($text) { |
135 | 135 | return $text; |
136 | 136 | }, $item['linkProperty']); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } elseif ($item['type'] === 'tab') { |
61 | 61 | $activeObject = false; |
62 | 62 | $item['type'] = 'link'; // fix for global Listing builder |
63 | - $item['link'] = '#' . $elements['tabAnchor'] . $tabIdx; |
|
63 | + $item['link'] = '#'.$elements['tabAnchor'].$tabIdx; |
|
64 | 64 | |
65 | 65 | $item['property']['role'] = 'presentation'; |
66 | 66 | |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | |
76 | 76 | // mark active tab |
77 | 77 | if ($activeObject === true) { |
78 | - $item['property']['class'] .= (Str::length($item['property']['class']) > 0 ? ' ' : null) . 'active'; |
|
78 | + $item['property']['class'] .= (Str::length($item['property']['class']) > 0 ? ' ' : null).'active'; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | // tab special properties for bootstrap |
82 | - $item['linkProperty']['aria-controls'] = $elements['tabAnchor'] . $tabIdx; |
|
82 | + $item['linkProperty']['aria-controls'] = $elements['tabAnchor'].$tabIdx; |
|
83 | 83 | $item['linkProperty']['role'] = 'tab'; |
84 | 84 | $item['linkProperty']['data-toggle'] = 'tab'; |
85 | 85 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } else { |
99 | 99 | return self::nohtml($itemContent); |
100 | 100 | } |
101 | - }, ['role' => 'tabpanel', 'class' => 'tab-pane fade' . ($activeObject === true ? ' in active' : null), 'id' => $elements['tabAnchor'] . $tabIdx]); |
|
101 | + }, ['role' => 'tabpanel', 'class' => 'tab-pane fade'.($activeObject === true ? ' in active' : null), 'id' => $elements['tabAnchor'].$tabIdx]); |
|
102 | 102 | $tabIdx++; |
103 | 103 | } |
104 | 104 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | // check if global class "nav" isset |
107 | 107 | if ($elements['property']['class'] !== null) { |
108 | 108 | if (!Str::contains('nav ', $elements['property']['class'])) { |
109 | - $elements['property']['class'] = 'nav ' . $elements['property']['class']; |
|
109 | + $elements['property']['class'] = 'nav '.$elements['property']['class']; |
|
110 | 110 | } |
111 | 111 | } else { |
112 | 112 | $elements['property']['class'] = 'nav'; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | return $tabContent; |
127 | 127 | }, ['class' => 'tab-content']); |
128 | 128 | } |
129 | - return $listing . $tabContent; |
|
129 | + return $listing.$tabContent; |
|
130 | 130 | }, $blockProperty); |
131 | 131 | } |
132 | 132 | } |
133 | 133 | \ No newline at end of file |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | // set mobile collapse id for toggle |
38 | 38 | $mobCollapseId = $elements['collapseId']; |
39 | 39 | if (Str::likeEmpty($mobCollapseId)) { |
40 | - $mobCollapseId = Str::randomLatin(mt_rand(6,12)) . mt_rand(1, 99); |
|
40 | + $mobCollapseId = Str::randomLatin(mt_rand(6, 12)).mt_rand(1, 99); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | // set element id for toggle |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | // generate output dom of bootstrap navbar |
100 | 100 | $dom = new Dom(); |
101 | 101 | $body = $dom->div(function() use ($leftBuild, $rightBuild, $itemsStatic){ |
102 | - return $leftBuild . $itemsStatic . $rightBuild; |
|
102 | + return $leftBuild.$itemsStatic.$rightBuild; |
|
103 | 103 | }, ['class' => 'collapse navbar-collapse', 'id' => $mobCollapseId]); |
104 | 104 | |
105 | 105 | // drow <nav @properties>@next</nav> |
@@ -110,26 +110,26 @@ discard block |
||
110 | 110 | $header = $dom->div(function() use ($dom, $elements, $mobCollapseId){ |
111 | 111 | // drow <button @collapse>@next</button> |
112 | 112 | $collapseButton = $dom->button(function() use ($dom){ |
113 | - $toggleItem = $dom->span(function(){ |
|
113 | + $toggleItem = $dom->span(function() { |
|
114 | 114 | return 'Toggle menu'; |
115 | 115 | }, ['class' => 'sr-only']); |
116 | 116 | $toggleIcon = null; |
117 | 117 | for ($i = 0; $i < 3; $i++) { |
118 | - $toggleIcon .= $dom->span(function(){ |
|
118 | + $toggleIcon .= $dom->span(function() { |
|
119 | 119 | return null; |
120 | 120 | }, ['class' => 'icon-bar']); |
121 | 121 | } |
122 | - return $toggleItem . $toggleIcon; |
|
123 | - }, ['type' => 'button', 'class' => 'navbar-toggle collapsed', 'data-toggle' => 'collapse', 'data-target' => '#' . $mobCollapseId]); |
|
122 | + return $toggleItem.$toggleIcon; |
|
123 | + }, ['type' => 'button', 'class' => 'navbar-toggle collapsed', 'data-toggle' => 'collapse', 'data-target' => '#'.$mobCollapseId]); |
|
124 | 124 | // drow <div @brand>@brandtext<?div> |
125 | 125 | $brand = null; |
126 | 126 | if (isset($elements['brand'])) { |
127 | 127 | $brand = Url::link($elements['brand']['link'], $elements['brand']['text'], ['class' => 'navbar-brand']); |
128 | 128 | } |
129 | - return $collapseButton . $brand; |
|
129 | + return $collapseButton.$brand; |
|
130 | 130 | }, ['class' => 'navbar-header']); |
131 | 131 | // return header and body concat |
132 | - return $header . $body; |
|
132 | + return $header.$body; |
|
133 | 133 | }, $elements['container']); |
134 | 134 | }, $elements['nav']); |
135 | 135 | } |
@@ -297,7 +297,7 @@ |
||
297 | 297 | |
298 | 298 | $output = null; |
299 | 299 | foreach ($args as $string) { |
300 | - $output .= $string . $separator; |
|
300 | + $output .= $string.$separator; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | $output = rtrim($output, $separator); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * Find first entry in $string before $delimiter |
58 | 58 | * @param string $string |
59 | 59 | * @param string $delimiter |
60 | - * @return string|bool |
|
60 | + * @return false|string |
|
61 | 61 | */ |
62 | 62 | public static function firstIn($string, $delimiter) |
63 | 63 | { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @param string $string |
73 | 73 | * @param string $delimiter |
74 | 74 | * @param bool $withoutDelimiter |
75 | - * @return string|bool |
|
75 | + * @return false|string |
|
76 | 76 | */ |
77 | 77 | public static function lastIn($string, $delimiter, $withoutDelimiter = false) |
78 | 78 | { |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | |
215 | 215 | /** |
216 | 216 | * Case-ignore replace $needle to $replacement in string $haystack. Alias for function str_ireplace() |
217 | - * @param string|array $needle |
|
218 | - * @param string|array $replacement |
|
217 | + * @param string[] $needle |
|
218 | + * @param string $replacement |
|
219 | 219 | * @param string $haystack |
220 | 220 | * @return string |
221 | 221 | */ |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | /** |
311 | 311 | * Check is $string sounds like a phone number |
312 | 312 | * @param string $string |
313 | - * @return int |
|
313 | + * @return boolean |
|
314 | 314 | */ |
315 | 315 | public static function isPhone($string) |
316 | 316 | { |
@@ -319,9 +319,6 @@ discard block |
||
319 | 319 | |
320 | 320 | /** |
321 | 321 | * Concat string with add string by separator |
322 | - * @param string $separator |
|
323 | - * @param string $string1 |
|
324 | - * @param string $string2 |
|
325 | 322 | * @return string |
326 | 323 | */ |
327 | 324 | public static function concat() |
@@ -115,7 +115,7 @@ |
||
115 | 115 | |
116 | 116 | /** |
117 | 117 | * Get available languages in the filesystem |
118 | - * @return array |
|
118 | + * @return string[] |
|
119 | 119 | */ |
120 | 120 | public function getAvailableLangs() |
121 | 121 | { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | if (Obj::isArray($params) && count($params) > 0) { |
56 | 56 | foreach ($params as $var => $value) { |
57 | - $text = Str::replace('%' . $var . '%', $value, $text); |
|
57 | + $text = Str::replace('%'.$var.'%', $value, $text); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | return $text; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | public function translate($text, array $params = []) |
70 | 70 | { |
71 | 71 | $index = null; |
72 | - $namespace = 'Apps\Controller\\' . env_name . '\\'; |
|
72 | + $namespace = 'Apps\Controller\\'.env_name.'\\'; |
|
73 | 73 | foreach (@debug_backtrace() as $caller) { |
74 | 74 | if (isset($caller['class']) && Str::startsWith($namespace, $caller['class'])) { |
75 | 75 | $index = Str::sub((string)$caller['class'], Str::length($namespace)); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | protected function load($index) |
87 | 87 | { |
88 | - $file = root . '/I18n/' . env_name . '/' . App::$Request->getLanguage() . '/' . $index . '.php'; |
|
88 | + $file = root.'/I18n/'.env_name.'/'.App::$Request->getLanguage().'/'.$index.'.php'; |
|
89 | 89 | if (!File::exist($file)) { |
90 | 90 | return []; |
91 | 91 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | public function getAvailableLangs() |
124 | 124 | { |
125 | 125 | $langs = ['en']; |
126 | - $scan = Directory::scan(root . '/I18n/' . env_name . '/', GLOB_ONLYDIR, true); |
|
126 | + $scan = Directory::scan(root.'/I18n/'.env_name.'/', GLOB_ONLYDIR, true); |
|
127 | 127 | foreach ($scan as $row) { |
128 | 128 | $langs[] = trim($row, '/'); |
129 | 129 | } |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | |
60 | 60 | $basePath = trim(App::$Properties->get('basePath'), '/'); |
61 | 61 | if ($basePath !== null && Str::length($basePath) > 0) { |
62 | - $basePath = '/' . $basePath; |
|
62 | + $basePath = '/'.$basePath; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | if (!defined('env_no_uri') || env_no_uri === false) { |
66 | - $basePath .= '/' . strtolower(env_name); |
|
66 | + $basePath .= '/'.strtolower(env_name); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | // we never try to use path's without friendly url's |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } else { |
90 | 90 | // try to find language in pathway |
91 | 91 | foreach (App::$Properties->get('languages') as $lang) { |
92 | - if (Str::startsWith('/' . $lang, $this->getPathInfo())) { |
|
92 | + if (Str::startsWith('/'.$lang, $this->getPathInfo())) { |
|
93 | 93 | $this->language = $lang; |
94 | 94 | $this->languageInPath = true; |
95 | 95 | } |
@@ -116,11 +116,11 @@ discard block |
||
116 | 116 | // parse query string |
117 | 117 | $queryString = null; |
118 | 118 | if (count($this->query->all()) > 0) { |
119 | - $queryString = '?' . http_build_query($this->query->all()); |
|
119 | + $queryString = '?'.http_build_query($this->query->all()); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | // build response with redirect to language-based path |
123 | - $response = new Redirect($this->getSchemeAndHttpHost() . $this->basePath . '/' . $userLang . $this->getPathInfo() . $queryString); |
|
123 | + $response = new Redirect($this->getSchemeAndHttpHost().$this->basePath.'/'.$userLang.$this->getPathInfo().$queryString); |
|
124 | 124 | $response->send(); |
125 | 125 | exit(); |
126 | 126 | } |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | // find "new path" as binding uri slug |
179 | 179 | $binding = array_search($pathway, $map, true); |
180 | 180 | // build url to redirection |
181 | - $url = $this->getSchemeAndHttpHost() . $this->getBasePath() . '/'; |
|
181 | + $url = $this->getSchemeAndHttpHost().$this->getBasePath().'/'; |
|
182 | 182 | if (App::$Properties->get('multiLanguage')) { |
183 | - $url .= $this->language . '/'; |
|
183 | + $url .= $this->language.'/'; |
|
184 | 184 | } |
185 | 185 | $url .= ltrim($binding, '/'); |
186 | 186 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | { |
271 | 271 | $route = $this->languageInPath ? Str::sub(parent::getPathInfo(), Str::length($this->language) + 1) : parent::getPathInfo(); |
272 | 272 | if (!Str::startsWith('/', $route)) { |
273 | - $route = '/' . $route; |
|
273 | + $route = '/'.$route; |
|
274 | 274 | } |
275 | 275 | return $route; |
276 | 276 | } |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | */ |
381 | 381 | public function getFullUrl() |
382 | 382 | { |
383 | - return $this->getSchemeAndHttpHost() . $this->getRequestUri(); |
|
383 | + return $this->getSchemeAndHttpHost().$this->getRequestUri(); |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | /** |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | // try to load from file |
49 | - $configFile = ucfirst(Str::lowerCase($configName)) . '.php'; |
|
50 | - if (File::exist('/Private/Config/' . $configFile)) { |
|
51 | - $this->data[$configName] = File::inc('/Private/Config/' . $configFile, true); |
|
49 | + $configFile = ucfirst(Str::lowerCase($configName)).'.php'; |
|
50 | + if (File::exist('/Private/Config/'.$configFile)) { |
|
51 | + $this->data[$configName] = File::inc('/Private/Config/'.$configFile, true); |
|
52 | 52 | return true; |
53 | 53 | } |
54 | 54 | |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function writeConfig($configFile, array $data) |
141 | 141 | { |
142 | - $path = '/Private/Config/' . ucfirst(Str::lowerCase($configFile)) . '.php'; |
|
142 | + $path = '/Private/Config/'.ucfirst(Str::lowerCase($configFile)).'.php'; |
|
143 | 143 | if (!File::exist($path) || !File::writable($path)) { |
144 | 144 | return false; |
145 | 145 | } |
146 | - $saveData = '<?php return ' . Arr::exportVar($data) . ';'; |
|
146 | + $saveData = '<?php return '.Arr::exportVar($data).';'; |
|
147 | 147 | File::write($path, $saveData); |
148 | 148 | return true; |
149 | 149 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | return false; |
77 | 77 | } |
78 | 78 | |
79 | - $callback = (string)$class . '::' . (string)$method; |
|
79 | + $callback = (string)$class.'::'.(string)$method; |
|
80 | 80 | |
81 | 81 | // add instance to cron task manager |
82 | 82 | if (!isset($this->configs['instances'][$callback])) { |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function remove($class, $method) |
96 | 96 | { |
97 | - $callback = $class . '::' . $method; |
|
97 | + $callback = $class.'::'.$method; |
|
98 | 98 | if (isset($this->configs['instances'][$callback])) { |
99 | 99 | unset($this->configs['instances'][$callback], $this->configs['log'][$callback]); |
100 | 100 | App::$Properties->writeConfig('Cron', $this->configs); |
@@ -103,8 +103,8 @@ |
||
103 | 103 | |
104 | 104 | /** |
105 | 105 | * Display form field. Allowed type: text, password, textarea, checkbox, select, checkboxes, file, captcha, email, hidden |
106 | - * @param $object |
|
107 | - * @param $type |
|
106 | + * @param string $object |
|
107 | + * @param string $type |
|
108 | 108 | * @param null|array $property |
109 | 109 | * @param null|string $helper |
110 | 110 | * @param null|string $layerFile |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | { |
82 | 82 | $form = self::buildSingleTag('form', $this->formProperty, false); |
83 | 83 | if ($this->model->_tokenRequired) { |
84 | - $form .= PHP_EOL . $this->field('_csrf_token', 'hidden', ['value' => $this->model->_csrf_token]); |
|
84 | + $form .= PHP_EOL.$this->field('_csrf_token', 'hidden', ['value' => $this->model->_csrf_token]); |
|
85 | 85 | } |
86 | 86 | return $form; |
87 | 87 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | { |
102 | 102 | if ($this->model === null) { |
103 | 103 | if (App::$Debug !== null) { |
104 | - App::$Debug->addMessage('Form model is not defined for field name: [' . strip_tags($object) . ']'); |
|
104 | + App::$Debug->addMessage('Form model is not defined for field name: ['.strip_tags($object).']'); |
|
105 | 105 | } |
106 | 106 | return null; |
107 | 107 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | // check if model contains current tag name as property |
116 | 116 | if (!property_exists($this->model, $propertyName)) { |
117 | 117 | if (App::$Debug !== null) { |
118 | - App::$Debug->addMessage('Form field ["' . $object . '"] is not defined in model: [' . get_class($this->model) . ']', 'error'); |
|
118 | + App::$Debug->addMessage('Form field ["'.$object.'"] is not defined in model: ['.get_class($this->model).']', 'error'); |
|
119 | 119 | } |
120 | 120 | return null; |
121 | 121 | } |
@@ -136,13 +136,13 @@ discard block |
||
136 | 136 | } |
137 | 137 | |
138 | 138 | // prepare labels text and label "for" attr |
139 | - $labelFor = $this->name . '-' . $propertyName; |
|
139 | + $labelFor = $this->name.'-'.$propertyName; |
|
140 | 140 | $labelText = $this->model->getLabel($object); |
141 | 141 | $itemValue = $this->model->{$propertyName}; |
142 | 142 | // sounds like a dot-separated $object |
143 | 143 | if ($propertyName !== $object) { |
144 | 144 | $nesting = trim(strstr($object, '.'), '.'); |
145 | - $labelFor .= '-' . Str::replace('.', '-', $nesting); |
|
145 | + $labelFor .= '-'.Str::replace('.', '-', $nesting); |
|
146 | 146 | $itemValue = Arr::getByPath($nesting, $itemValue); |
147 | 147 | } |
148 | 148 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | public function submitButton($title, array $property = []) |
174 | 174 | { |
175 | 175 | $property['type'] = 'submit'; |
176 | - $property['name'] = $this->name . '[submit]'; |
|
176 | + $property['name'] = $this->name.'[submit]'; |
|
177 | 177 | $property['value'] = $title; |
178 | 178 | return self::buildSingleTag('input', $property); |
179 | 179 | } |
@@ -187,10 +187,10 @@ discard block |
||
187 | 187 | { |
188 | 188 | // pre-validate form fields based on model rules and jquery.validation |
189 | 189 | if ($validate) { |
190 | - App::$Alias->addPlainCode('js', '$().ready(function() { $("#' . $this->name . '").validate(); });'); |
|
190 | + App::$Alias->addPlainCode('js', '$().ready(function() { $("#'.$this->name.'").validate(); });'); |
|
191 | 191 | App::$Alias->setCustomLibrary('js', '/vendor/bower/jquery-validation/dist/jquery.validate.min.js'); |
192 | 192 | if (App::$Request->getLanguage() !== 'en') { |
193 | - $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_' . App::$Request->getLanguage() . '.js'; |
|
193 | + $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_'.App::$Request->getLanguage().'.js'; |
|
194 | 194 | if (File::exist($localeFile)) { |
195 | 195 | App::$Alias->setCustomLibrary('js', $localeFile); |
196 | 196 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $formName = $this->model->getFormName(); |
202 | 202 | if (Obj::isArray($badAttr) && count($badAttr) > 0) { |
203 | 203 | foreach ($badAttr as $attr) { |
204 | - $itemId = $formName . '-' . $attr; |
|
204 | + $itemId = $formName.'-'.$attr; |
|
205 | 205 | $render = App::$View->render(static::$structLayer['jsnotify'], ['itemId' => $itemId]); |
206 | 206 | App::$Alias->addPlainCode('js', $render); |
207 | 207 | } |