@@ -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 | { |
@@ -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; |
@@ -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\')); |
@@ -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) { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | try { |
144 | 144 | /** @var \Ffcms\Core\Arch\Controller $callClass */ |
145 | 145 | $callClass = null; |
146 | - $callMethod = 'action' . self::$Request->getAction(); |
|
146 | + $callMethod = 'action'.self::$Request->getAction(); |
|
147 | 147 | |
148 | 148 | // founded callback injection alias |
149 | 149 | if (self::$Request->getCallbackAlias() !== false) { |
@@ -151,16 +151,16 @@ discard block |
||
151 | 151 | if (class_exists($cName)) { |
152 | 152 | $callClass = new $cName; |
153 | 153 | } else { |
154 | - throw new NotFoundException('Callback alias of class "' . App::$Security->strip_tags($cName) . '" is not founded'); |
|
154 | + throw new NotFoundException('Callback alias of class "'.App::$Security->strip_tags($cName).'" is not founded'); |
|
155 | 155 | } |
156 | 156 | } else { // typical parsing of native apps |
157 | - $cName = '\Apps\Controller\\' . env_name . '\\' . self::$Request->getController(); |
|
157 | + $cName = '\Apps\Controller\\'.env_name.'\\'.self::$Request->getController(); |
|
158 | 158 | |
159 | 159 | // try to initialize class object |
160 | 160 | if (class_exists($cName)) { |
161 | 161 | $callClass = new $cName; |
162 | 162 | } else { |
163 | - throw new NotFoundException('Application can not be runned. Initialized class not founded: ' . App::$Security->strip_tags($cName)); |
|
163 | + throw new NotFoundException('Application can not be runned. Initialized class not founded: '.App::$Security->strip_tags($cName)); |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | // get full compiled response |
205 | 205 | $html = $callClass->getOutput(); |
206 | 206 | } else { |
207 | - throw new NotFoundException('Method "' . App::$Security->strip_tags($callMethod) . '()" not founded in "' . get_class($callClass) . '"'); |
|
207 | + throw new NotFoundException('Method "'.App::$Security->strip_tags($callMethod).'()" not founded in "'.get_class($callClass).'"'); |
|
208 | 208 | } |
209 | 209 | } catch (NotFoundException $e) { // catch exceptions and set output |
210 | 210 | $html = $e->display(); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $hints[] = '<code>LIMIT</code> without <code>ORDER BY</code> causes non-deterministic results, depending on the query execution plan'; |
161 | 161 | } |
162 | 162 | if (preg_match('/LIKE\\s[\'"](%.*?)[\'"]/i', $query, $matches)) { |
163 | - $hints[] = 'An argument has a leading wildcard character: <code>' . $matches[1] . '</code>. |
|
163 | + $hints[] = 'An argument has a leading wildcard character: <code>'.$matches[1].'</code>. |
|
164 | 164 | The predicate with this argument is not sargable and cannot use an index if one exists.'; |
165 | 165 | } |
166 | 166 | return implode("<br />", $hints); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | foreach ($traces as $trace) { |
176 | 176 | if (isset($trace['class']) && isset($trace['file']) && strpos( |
177 | 177 | $trace['file'], |
178 | - DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR |
|
178 | + DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR |
|
179 | 179 | ) === false |
180 | 180 | ) { |
181 | 181 | if (isset($trace['object']) && is_a($trace['object'], 'Twig_Template')) { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $line = isset($trace['line']) ? $trace['line'] : '?'; |
188 | 188 | } |
189 | 189 | |
190 | - return $this->normalizeFilename($file) . ':' . $line; |
|
190 | + return $this->normalizeFilename($file).':'.$line; |
|
191 | 191 | } elseif (isset($trace['function']) && $trace['function'] == 'Illuminate\Routing\{closure}') { |
192 | 192 | return 'Route binding'; |
193 | 193 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | public function __construct() |
17 | 17 | { |
18 | 18 | $config = \HTMLPurifier_Config::createDefault(); |
19 | - $config->set('Cache.SerializerPath', root . '/Private/Cache/HTMLPurifier/'); |
|
19 | + $config->set('Cache.SerializerPath', root.'/Private/Cache/HTMLPurifier/'); |
|
20 | 20 | $config->set('HTML.Allowed', 'p,b,strong,em,a[href],i,span,ul,ol,li,blockquote'); |
21 | 21 | //$config->set('URI.Base', 'http://www.example.com'); |
22 | 22 | //$config->set('URI.MakeAbsolute', true); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * String html tags and escape quotes |
51 | 51 | * @param string|array $html |
52 | 52 | * @param boolean $escapeQuotes |
53 | - * @return string|array|null |
|
53 | + * @return string|null |
|
54 | 54 | */ |
55 | 55 | public function strip_tags($html, $escapeQuotes = true) |
56 | 56 | { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @deprecated |
91 | 91 | * @param $var |
92 | 92 | * @param null $indent |
93 | - * @return mixed|string |
|
93 | + * @return string|null |
|
94 | 94 | */ |
95 | 95 | public function var_export54($var, $indent = null, $guessTypes = false) { |
96 | 96 | return Arr::exportVar($var, $indent, $guessTypes); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | { |
56 | 56 | $path = self::diskPath($path); |
57 | 57 | if (!Str::startsWith(root, $path)) { |
58 | - $path = root . DIRECTORY_SEPARATOR . ltrim($path, '\\/'); |
|
58 | + $path = root.DIRECTORY_SEPARATOR.ltrim($path, '\\/'); |
|
59 | 59 | } |
60 | 60 | return $path; |
61 | 61 | } |