@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * Get label value by variable name |
32 | 32 | * @param string $param |
33 | - * @return mixed |
|
33 | + * @return string |
|
34 | 34 | */ |
35 | 35 | final public function getLabel($param) |
36 | 36 | { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Set attribute labels for model variables |
75 | - * @return array |
|
75 | + * @return string |
|
76 | 76 | */ |
77 | 77 | public function labels() |
78 | 78 | { |
@@ -226,7 +226,7 @@ |
||
226 | 226 | /** |
227 | 227 | * Show custom code library link |
228 | 228 | * @param string $type - js or css allowed |
229 | - * @return array|null|string |
|
229 | + * @return null|string |
|
230 | 230 | */ |
231 | 231 | public function showCodeLink($type) |
232 | 232 | { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Ffcms\Core\App; |
6 | 6 | use Ffcms\Core\Exception\NativeException; |
7 | -use Ffcms\Core\Exception\NotFoundException; |
|
8 | 7 | use Ffcms\Core\Exception\SyntaxException; |
9 | 8 | use Ffcms\Core\Helper\FileSystem\Directory; |
10 | 9 | use Ffcms\Core\Helper\FileSystem\File; |
@@ -44,16 +44,16 @@ discard block |
||
44 | 44 | { |
45 | 45 | // get theme config and build full path |
46 | 46 | $themeConfig = App::$Properties->get('theme'); |
47 | - $this->themePath = root . DIRECTORY_SEPARATOR . 'Apps' . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . env_name; |
|
47 | + $this->themePath = root.DIRECTORY_SEPARATOR.'Apps'.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.env_name; |
|
48 | 48 | if (isset($themeConfig[env_name]) && Str::length($themeConfig[env_name]) > 0) { |
49 | - $this->themePath .= DIRECTORY_SEPARATOR . $themeConfig[env_name]; |
|
49 | + $this->themePath .= DIRECTORY_SEPARATOR.$themeConfig[env_name]; |
|
50 | 50 | } else { |
51 | - $this->themePath .= DIRECTORY_SEPARATOR . 'default'; |
|
51 | + $this->themePath .= DIRECTORY_SEPARATOR.'default'; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | // check if theme is available |
55 | 55 | if (!Directory::exist($this->themePath)) { |
56 | - throw new NativeException('Apps theme is not founded: ' . Str::replace(root, null, $this->themePath)); |
|
56 | + throw new NativeException('Apps theme is not founded: '.Str::replace(root, null, $this->themePath)); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // get input args and build class properties |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | // path still not defined? |
98 | 98 | if ($path === null) { |
99 | - throw new SyntaxException('Viewer is not founded: ' . App::$Security->strip_tags($path)); |
|
99 | + throw new SyntaxException('Viewer is not founded: '.App::$Security->strip_tags($path)); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | // cleanup from slashes on start/end |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | // lets try to get full path for current theme |
126 | 126 | $tmpPath = $path; |
127 | 127 | if (!Str::startsWith($this->themePath, $path)) { |
128 | - $tmpPath = Normalize::diskPath($this->themePath . '/' . $path . '.php'); |
|
128 | + $tmpPath = Normalize::diskPath($this->themePath.'/'.$path.'.php'); |
|
129 | 129 | } |
130 | 130 | } else { // sounds like a object-depended view call from controller or etc |
131 | 131 | // get stack trace of callbacks |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | |
142 | 142 | // depended controller is not founded? Let finish |
143 | 143 | if ($calledController === null) { |
144 | - throw new NativeException('View render is failed: callback controller not founded! Call with relative path: ' . $path); |
|
144 | + throw new NativeException('View render is failed: callback controller not founded! Call with relative path: '.$path); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | // get controller name |
148 | - $controllerName = Str::sub($calledController, Str::length('Apps\\Controller\\' . env_name . '\\')); |
|
148 | + $controllerName = Str::sub($calledController, Str::length('Apps\\Controller\\'.env_name.'\\')); |
|
149 | 149 | $controllerName = Str::lowerCase($controllerName); |
150 | 150 | // get full path |
151 | - $tmpPath = $this->themePath . DIRECTORY_SEPARATOR . $controllerName . DIRECTORY_SEPARATOR . $path . '.php'; |
|
151 | + $tmpPath = $this->themePath.DIRECTORY_SEPARATOR.$controllerName.DIRECTORY_SEPARATOR.$path.'.php'; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | // check if builded view full path is exist |
@@ -158,18 +158,18 @@ discard block |
||
158 | 158 | |
159 | 159 | // hmm, not founded. Lets try to find in caller directory (for widgets, apps packages and other) |
160 | 160 | if ($source !== null) { |
161 | - $tmpPath = Normalize::diskPath($source . DIRECTORY_SEPARATOR . $path . '.php'); |
|
161 | + $tmpPath = Normalize::diskPath($source.DIRECTORY_SEPARATOR.$path.'.php'); |
|
162 | 162 | if (File::exist($tmpPath)) { |
163 | 163 | // add notify for native views |
164 | 164 | if (App::$Debug !== null) { |
165 | - App::$Debug->addMessage('Render native viewer: ' . Str::replace(root, null, $tmpPath), 'info'); |
|
165 | + App::$Debug->addMessage('Render native viewer: '.Str::replace(root, null, $tmpPath), 'info'); |
|
166 | 166 | } |
167 | 167 | return $tmpPath; |
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
171 | 171 | if (App::$Debug !== null) { |
172 | - App::$Debug->addMessage('Viewer not founded on rendering: ' . $path, 'warning'); |
|
172 | + App::$Debug->addMessage('Viewer not founded on rendering: '.$path, 'warning'); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | return null; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | foreach ($items as $item) { |
265 | 265 | $item = trim($item, '/'); |
266 | 266 | if (!Str::startsWith(App::$Alias->scriptUrl, $item) && !Str::startsWith('http', $item)) { // is local without proto and domain |
267 | - $item = App::$Alias->scriptUrl . '/' . $item; |
|
267 | + $item = App::$Alias->scriptUrl.'/'.$item; |
|
268 | 268 | } |
269 | 269 | $output[] = $item; |
270 | 270 | } |
@@ -273,9 +273,9 @@ discard block |
||
273 | 273 | $output = null; |
274 | 274 | foreach ($clear as $row) { |
275 | 275 | if ($type === 'css') { |
276 | - $output .= '<link rel="stylesheet" type="text/css" href="' . $row . '">' . "\n"; |
|
276 | + $output .= '<link rel="stylesheet" type="text/css" href="'.$row.'">'."\n"; |
|
277 | 277 | } elseif ($type === 'js') { |
278 | - $output .= '<script src="' . $row . '"></script>' . "\n"; |
|
278 | + $output .= '<script src="'.$row.'"></script>'."\n"; |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | |
299 | 299 | $code = null; |
300 | 300 | foreach (App::$Alias->getPlainCode($type) as $row) { |
301 | - $code .= $row . "\n"; |
|
301 | + $code .= $row."\n"; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | return $code; |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * @param string|null $add |
19 | 19 | * @param array $params |
20 | 20 | * @param bool $encode |
21 | - * @return null|string |
|
21 | + * @return string |
|
22 | 22 | */ |
23 | 23 | public static function to($controller_action, $id = null, $add = null, array $params = null, $encode = true) |
24 | 24 | { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public static function to($controller_action, $id = null, $add = null, array $params = null, $encode = true) |
24 | 24 | { |
25 | 25 | $pathway = self::buildPathway([$controller_action, $id, $add, $params], $encode); |
26 | - return App::$Alias->baseUrl . '/' . $pathway; |
|
26 | + return App::$Alias->baseUrl.'/'.$pathway; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $controller = Str::lastIn($controller, '\\', true); |
61 | 61 | } |
62 | 62 | |
63 | - $response = $controller . '/' . $action; |
|
63 | + $response = $controller.'/'.$action; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | // check if controller and action is defined |
@@ -70,17 +70,17 @@ discard block |
||
70 | 70 | |
71 | 71 | // id is defined? |
72 | 72 | if (isset($to[1]) && !Str::likeEmpty($to[1])) { |
73 | - $response .= '/' . self::safeUri($to[1], $encode); |
|
73 | + $response .= '/'.self::safeUri($to[1], $encode); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | // add param is defined? |
77 | 77 | if (isset($to[2]) && !Str::likeEmpty($to[2])) { |
78 | - $response .= '/' . self::safeUri($to[2], $encode); |
|
78 | + $response .= '/'.self::safeUri($to[2], $encode); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | // try to find static alias |
82 | - if (isset($routing['Alias'][env_name]) && Arr::in('/' . $response, $routing['Alias'][env_name])) { |
|
83 | - $pathAlias = array_search('/' . $response, $routing['Alias'][env_name]); |
|
82 | + if (isset($routing['Alias'][env_name]) && Arr::in('/'.$response, $routing['Alias'][env_name])) { |
|
83 | + $pathAlias = array_search('/'.$response, $routing['Alias'][env_name]); |
|
84 | 84 | if ($pathAlias !== false) { |
85 | 85 | $response = Str::lowerCase(trim($pathAlias, '/')); |
86 | 86 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | $queryString = http_build_query($to[3]); |
98 | 98 | if (Str::length($queryString) > 0) { |
99 | - $response .= '?' . http_build_query($to[3]); |
|
99 | + $response .= '?'.http_build_query($to[3]); |
|
100 | 100 | } |
101 | 101 | if ($anchor !== false) { |
102 | 102 | $response .= $anchor; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | public static function buildPathwayFromRequest() |
119 | 119 | { |
120 | 120 | return self::buildPathway([ |
121 | - Str::lowerCase(App::$Request->getController()) . '/' . Str::lowerCase(App::$Request->getAction()), |
|
121 | + Str::lowerCase(App::$Request->getController()).'/'.Str::lowerCase(App::$Request->getAction()), |
|
122 | 122 | App::$Request->getID(), |
123 | 123 | App::$Request->getAdd(), |
124 | 124 | App::$Request->query->all() |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | $to = [$to]; |
141 | 141 | } |
142 | 142 | // call Url::to(args) |
143 | - $callbackTo = call_user_func_array([__NAMESPACE__ . '\Url', 'to'], $to); |
|
143 | + $callbackTo = call_user_func_array([__NAMESPACE__.'\Url', 'to'], $to); |
|
144 | 144 | |
145 | - return '<a href="' . $callbackTo . '"' . $compile_property . '>' . $name . '</a>'; |
|
145 | + return '<a href="'.$callbackTo.'"'.$compile_property.'>'.$name.'</a>'; |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | |
240 | 240 | /** |
241 | 241 | * Get current $id argument for controller action |
242 | - * @return string|null |
|
242 | + * @return string |
|
243 | 243 | */ |
244 | 244 | public function getID() |
245 | 245 | { |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | |
249 | 249 | /** |
250 | 250 | * Get current $add argument for controller action |
251 | - * @return string|null |
|
251 | + * @return string |
|
252 | 252 | */ |
253 | 253 | public function getAdd() |
254 | 254 | { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | /** |
259 | 259 | * Get callback class alias if exist |
260 | - * @return bool|string |
|
260 | + * @return boolean |
|
261 | 261 | */ |
262 | 262 | public function getCallbackAlias() |
263 | 263 | { |
@@ -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 | /** |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | /** |
57 | 57 | * Add exception into debug bar and stop execute |
58 | - * @param $e |
|
58 | + * @param \Ffcms\Core\Exception\TemplateException $e |
|
59 | 59 | * @throws \DebugBar\DebugBarException |
60 | 60 | */ |
61 | 61 | public function addException($e) |
@@ -18,7 +18,7 @@ |
||
18 | 18 | /** |
19 | 19 | * Construct table based on passed elements as array: properties, thead, tbody, rows, items etc |
20 | 20 | * @param array $elements |
21 | - * @return null |
|
21 | + * @return null|string |
|
22 | 22 | */ |
23 | 23 | public static function display($elements) |
24 | 24 | { |
@@ -40,24 +40,24 @@ discard block |
||
40 | 40 | // init dom model |
41 | 41 | $dom = new Dom(); |
42 | 42 | // draw response |
43 | - $table = $dom->table(function () use ($dom, $elements, $selectOptions) { |
|
43 | + $table = $dom->table(function() use ($dom, $elements, $selectOptions) { |
|
44 | 44 | $res = null; |
45 | 45 | // check if thead is defined |
46 | 46 | if (isset($elements['thead']) && Obj::isArray($elements['thead']) && count($elements['thead']) > 0 && Obj::isArray($elements['thead']['titles'])) { |
47 | 47 | // add thead container |
48 | - $res .= $dom->thead(function () use ($dom, $elements, $selectOptions) { |
|
49 | - return $dom->tr(function () use ($dom, $elements, $selectOptions) { |
|
48 | + $res .= $dom->thead(function() use ($dom, $elements, $selectOptions) { |
|
49 | + return $dom->tr(function() use ($dom, $elements, $selectOptions) { |
|
50 | 50 | $tr = null; |
51 | 51 | foreach ($elements['thead']['titles'] as $order => $title) { |
52 | 52 | $th = htmlentities($title['text']); |
53 | 53 | // make global checkbox for selectable columns |
54 | 54 | if ($selectOptions !== false && $order + 1 === $selectOptions['attachOrder']) { |
55 | - $th = $dom->input(function () { |
|
55 | + $th = $dom->input(function() { |
|
56 | 56 | return null; |
57 | - }, ['type' => 'checkbox', 'name' => 'selectAll']) . ' ' . $th; |
|
57 | + }, ['type' => 'checkbox', 'name' => 'selectAll']).' '.$th; |
|
58 | 58 | } |
59 | 59 | // build tr row collecting all th's |
60 | - $tr .= $dom->th(function () use ($th) { |
|
60 | + $tr .= $dom->th(function() use ($th) { |
|
61 | 61 | return $th; |
62 | 62 | }); |
63 | 63 | } |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | // sort td items inside row by key increment |
77 | 77 | ksort($row); |
78 | 78 | // add data in tr container |
79 | - $tr .= $dom->tr(function () use ($dom, $row, $selectOptions) { |
|
79 | + $tr .= $dom->tr(function() use ($dom, $row, $selectOptions) { |
|
80 | 80 | $td = null; |
81 | 81 | foreach ($row as $order => $item) { |
82 | 82 | if (!Obj::isInt($order)) { |
83 | 83 | continue; |
84 | 84 | } |
85 | 85 | // collect td item |
86 | - $td .= $dom->td(function () use ($dom, $order, $item, $selectOptions) { |
|
86 | + $td .= $dom->td(function() use ($dom, $order, $item, $selectOptions) { |
|
87 | 87 | $text = null; |
88 | 88 | // make text secure based on passed options |
89 | 89 | if ($item['html'] === true) { |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | } |
98 | 98 | // check if selectable box is enabled and equal current order id |
99 | 99 | if ($selectOptions !== false && $order === $selectOptions['attachOrder']) { |
100 | - $text = $dom->input(function (){ |
|
100 | + $text = $dom->input(function() { |
|
101 | 101 | return null; |
102 | - }, Arr::merge($selectOptions['selector'], ['value' => htmlentities($text)])) . ' ' . $text; |
|
102 | + }, Arr::merge($selectOptions['selector'], ['value' => htmlentities($text)])).' '.$text; |
|
103 | 103 | } |
104 | 104 | return $text; |
105 | 105 | }, $item['property']); |
@@ -122,14 +122,14 @@ discard block |
||
122 | 122 | // build js code for "selectAll" checkbox |
123 | 123 | self::buildSelectorHtml($selectOptions); |
124 | 124 | // return response inside "form" tag |
125 | - return $dom->form(function () use ($dom, $selectOptions, $table) { |
|
125 | + return $dom->form(function() use ($dom, $selectOptions, $table) { |
|
126 | 126 | foreach ($selectOptions['buttons'] as $btn) { |
127 | 127 | if (!Obj::isArray($btn)) { |
128 | 128 | continue; |
129 | 129 | } |
130 | - $table .= $dom->input(function(){ |
|
130 | + $table .= $dom->input(function() { |
|
131 | 131 | return null; |
132 | - }, $btn) . ' '; |
|
132 | + }, $btn).' '; |
|
133 | 133 | } |
134 | 134 | return $table; |
135 | 135 | }, $selectOptions['form']); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | private static function buildSelectorHtml(array $opt) |
146 | 146 | { |
147 | 147 | $js = '$(function () { |
148 | - var targetSwitchbox = $(\'input[name="' . $opt['selector']['name'] . '"]\'); |
|
148 | + var targetSwitchbox = $(\'input[name="' . $opt['selector']['name'].'"]\'); |
|
149 | 149 | $(\'input[name="selectAll"]\').change(function() { |
150 | 150 | $(targetSwitchbox).each(function () { |
151 | 151 | $(this).prop(\'checked\', !$(this).is(\':checked\')); |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ffcms\Core\App; |
6 | 6 | use Ffcms\Core\Exception\SyntaxException; |
7 | 7 | use Dflydev\DotAccessData\Data as DotData; |
8 | -use Ffcms\Core\Helper\Type\Arr; |
|
9 | 8 | use Ffcms\Core\Helper\Type\Obj; |
10 | 9 | use Ffcms\Core\Helper\Type\Str; |
11 | 10 | use Ffcms\Core\Filter\Native; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } elseif (method_exists($class, $obj)) { // maybe its a function? |
96 | 96 | $class = $class::$obj; // call function |
97 | 97 | } else { |
98 | - throw new SyntaxException('Filter callback execution failed: ' . $filter_name); |
|
98 | + throw new SyntaxException('Filter callback execution failed: '.$filter_name); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | if (method_exists($class, $method)) { |
106 | 106 | $check = @$class::$method($field_value, $filter_argv); |
107 | 107 | } else { |
108 | - throw new SyntaxException('Filter callback execution failed: ' . $filter_name); |
|
108 | + throw new SyntaxException('Filter callback execution failed: '.$filter_name); |
|
109 | 109 | } |
110 | 110 | } elseif (method_exists('Ffcms\Core\Filter\Native', $filter_name)) { // only full namespace\class path based :( |
111 | 111 | if ($filter_argv != null) { |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $check = Native::$filter_name($field_value); |
115 | 115 | } |
116 | 116 | } else { |
117 | - throw new SyntaxException('Filter "' . $filter_name . '" is not exist'); |
|
117 | + throw new SyntaxException('Filter "'.$filter_name.'" is not exist'); |
|
118 | 118 | } |
119 | 119 | if ($check !== true) { // switch only on fail check. |
120 | 120 | $this->_badAttr[] = $field_name; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | if ($inputType !== 'file') { |
170 | 170 | if ($html !== true) { |
171 | 171 | $field_value = App::$Security->strip_tags($field_value); |
172 | - } elseif($secure !== true) { |
|
172 | + } elseif ($secure !== true) { |
|
173 | 173 | $field_value = App::$Security->secureHtml($field_value); |
174 | 174 | } |
175 | 175 | } |
@@ -265,10 +265,10 @@ discard block |
||
265 | 265 | $paramQuery = $this->getFormName(); |
266 | 266 | if (Str::contains('.', $param)) { |
267 | 267 | foreach (explode('.', $param) as $item) { |
268 | - $paramQuery .= '[' . $item . ']'; |
|
268 | + $paramQuery .= '['.$item.']'; |
|
269 | 269 | } |
270 | 270 | } else { |
271 | - $paramQuery .= '[' . $param . ']'; |
|
271 | + $paramQuery .= '['.$param.']'; |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | // get request based on method and param query |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $breakerPos = mb_strpos($text, '<br', null, 'UTF-8'); |
36 | 36 | } else { |
37 | 37 | // add length('</p>') |
38 | - $breakerPos+= 4; |
|
38 | + $breakerPos += 4; |
|
39 | 39 | } |
40 | 40 | // cut text from position caret before </p> (+4 symbols to save item as valid) |
41 | 41 | if ($breakerPos !== false) { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * @param string|null $add |
19 | 19 | * @param array $params |
20 | 20 | * @param bool $encode |
21 | - * @return null|string |
|
21 | + * @return string |
|
22 | 22 | */ |
23 | 23 | public static function to($controller_action, $id = null, $add = null, array $params = null, $encode = true) |
24 | 24 | { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $purifier = App::$Memory->get('object.purifier.helpers'); |
25 | 25 | } else { |
26 | 26 | $config = \HTMLPurifier_Config::createDefault(); |
27 | - $config->set('Cache.SerializerPath', root . '/Private/Cache/HTMLPurifier/'); |
|
27 | + $config->set('Cache.SerializerPath', root.'/Private/Cache/HTMLPurifier/'); |
|
28 | 28 | $config->set('AutoFormat.AutoParagraph', false); |
29 | 29 | |
30 | 30 | // allow use target=_blank for links |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | $build = null; |
65 | 65 | foreach ($property as $p => $v) { |
66 | 66 | if ($v === null || $v === false || $v === true) { |
67 | - $build .= ' ' . self::nohtml($p); |
|
67 | + $build .= ' '.self::nohtml($p); |
|
68 | 68 | } else { |
69 | - $build .= ' ' . self::nohtml($p) . '="' . self::nohtml($v) . '"'; |
|
69 | + $build .= ' '.self::nohtml($p).'="'.self::nohtml($v).'"'; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | return $build; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public static function buildSingleTag($tagName, array $property = null) |
82 | 82 | { |
83 | - return '<' . self::nohtml($tagName) . self::applyProperty($property) . '/>'; |
|
83 | + return '<'.self::nohtml($tagName).self::applyProperty($property).'/>'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $value = self::nohtml($value); |
99 | 99 | } |
100 | 100 | |
101 | - return '<' . $tagName . self::applyProperty($property) . '>' . $value . '</' . $tagName . '>'; |
|
101 | + return '<'.$tagName.self::applyProperty($property).'>'.$value.'</'.$tagName.'>'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -140,15 +140,15 @@ discard block |
||
140 | 140 | if (!Str::contains('/', $elementPoint) || count($elementArray) < 2) { |
141 | 141 | $active = $elementPoint === $currentPoint; |
142 | 142 | } else { |
143 | - $elementPoint = $elementArray[0] . '/' . $elementArray[1]; |
|
143 | + $elementPoint = $elementArray[0].'/'.$elementArray[1]; |
|
144 | 144 | $active = Str::startsWith($elementPoint, $currentPoint); |
145 | 145 | } |
146 | 146 | break; |
147 | 147 | case 'id': |
148 | 148 | $elementArray = explode('/', $elementPoint); |
149 | - $elementPoint = $elementArray[0] . '/' . $elementArray[1]; |
|
149 | + $elementPoint = $elementArray[0].'/'.$elementArray[1]; |
|
150 | 150 | if (null !== $elementArray[2]) { |
151 | - $elementPoint .= '/' . $elementArray[2]; |
|
151 | + $elementPoint .= '/'.$elementArray[2]; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | $active = Str::startsWith($elementPoint, $currentPoint); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public static function convertLink($uri) |
206 | 206 | { |
207 | - $link = App::$Alias->baseUrl . '/'; |
|
207 | + $link = App::$Alias->baseUrl.'/'; |
|
208 | 208 | if (Obj::isArray($uri)) { |
209 | 209 | $link .= Url::buildPathway($uri); |
210 | 210 | } elseif (Str::startsWith('http', $uri)) { |