@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | if (Obj::isArray($params) && count($params) > 0) { |
54 | 54 | foreach ($params as $var => $value) { |
55 | - $text = Str::replace('%' . $var . '%', $value, $text); |
|
55 | + $text = Str::replace('%'.$var.'%', $value, $text); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | return $text; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | public function translate($text, array $params = []) |
68 | 68 | { |
69 | 69 | $index = null; |
70 | - $namespace = 'Apps\\Controller\\' . env_name . '\\'; |
|
70 | + $namespace = 'Apps\\Controller\\'.env_name.'\\'; |
|
71 | 71 | foreach (debug_backtrace() as $caller) { |
72 | 72 | if (isset($caller['class']) && Str::startsWith($namespace, $caller['class'])) { |
73 | 73 | $index = Str::sub((string)$caller['class'], Str::length($namespace)); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | protected function load($index) |
85 | 85 | { |
86 | - $file = root . '/I18n/' . env_name . '/' . App::$Request->getLanguage() . '/' . $index . '.php'; |
|
86 | + $file = root.'/I18n/'.env_name.'/'.App::$Request->getLanguage().'/'.$index.'.php'; |
|
87 | 87 | if (!File::exist($file)) { |
88 | 88 | return []; |
89 | 89 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | public function getAvailableLangs() |
122 | 122 | { |
123 | 123 | $langs = ['en']; |
124 | - $scan = Directory::scan(root . '/I18n/' . env_name . '/', GLOB_ONLYDIR, true); |
|
124 | + $scan = Directory::scan(root.'/I18n/'.env_name.'/', GLOB_ONLYDIR, true); |
|
125 | 125 | foreach ($scan as $row) { |
126 | 126 | $langs[] = trim($row, '/'); |
127 | 127 | } |
@@ -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 | { |
@@ -93,22 +93,22 @@ |
||
93 | 93 | } |
94 | 94 | $this->baseUrlNoLang = $this->baseUrl; |
95 | 95 | if (App::$Request->languageInPath() && App::$Request->getLanguage() !== null) { |
96 | - $this->baseUrl .= '/' . App::$Request->getLanguage(); |
|
96 | + $this->baseUrl .= '/'.App::$Request->getLanguage(); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | // build vendor libs alias |
100 | - $this->vendorNamedLibrary['js']['jquery'] = $this->scriptUrl . '/vendor/bower/jquery/dist/jquery.min.js'; |
|
101 | - $this->vendorNamedLibrary['css']['bootstrap'] = $this->scriptUrl . '/vendor/bower/bootstrap/dist/css/bootstrap.min.css'; |
|
102 | - $this->vendorNamedLibrary['js']['bootstrap'] = $this->scriptUrl . '/vendor/bower/bootstrap/dist/js/bootstrap.min.js'; |
|
103 | - $this->vendorNamedLibrary['css']['fa'] = $this->scriptUrl . '/vendor/bower/components-font-awesome/css/font-awesome.min.css'; |
|
104 | - $this->vendorNamedLibrary['js']['jquery-ui'] = $this->scriptUrl . '/vendor/bower/jquery-ui/jquery-ui.min.js'; |
|
105 | - $this->vendorNamedLibrary['css']['jquery-ui'] = $this->scriptUrl . '/vendor/bower/jquery-ui/themes/base/jquery-ui.min.css'; |
|
100 | + $this->vendorNamedLibrary['js']['jquery'] = $this->scriptUrl.'/vendor/bower/jquery/dist/jquery.min.js'; |
|
101 | + $this->vendorNamedLibrary['css']['bootstrap'] = $this->scriptUrl.'/vendor/bower/bootstrap/dist/css/bootstrap.min.css'; |
|
102 | + $this->vendorNamedLibrary['js']['bootstrap'] = $this->scriptUrl.'/vendor/bower/bootstrap/dist/js/bootstrap.min.js'; |
|
103 | + $this->vendorNamedLibrary['css']['fa'] = $this->scriptUrl.'/vendor/bower/components-font-awesome/css/font-awesome.min.css'; |
|
104 | + $this->vendorNamedLibrary['js']['jquery-ui'] = $this->scriptUrl.'/vendor/bower/jquery-ui/jquery-ui.min.js'; |
|
105 | + $this->vendorNamedLibrary['css']['jquery-ui'] = $this->scriptUrl.'/vendor/bower/jquery-ui/themes/base/jquery-ui.min.css'; |
|
106 | 106 | |
107 | 107 | $themeAll = App::$Properties->get('theme'); |
108 | 108 | if (!isset($themeAll[env_name]) || Str::length($themeAll[env_name]) < 1) { |
109 | 109 | $themeAll[env_name] = 'default'; |
110 | 110 | } |
111 | - $this->currentViewUrl = $this->scriptUrl . '/Apps/View/' . env_name . '/' . $themeAll[env_name]; |
|
111 | + $this->currentViewUrl = $this->scriptUrl.'/Apps/View/'.env_name.'/'.$themeAll[env_name]; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | if ($this->layout === null) { |
50 | 50 | $content = $this->response; |
51 | 51 | } else { |
52 | - $layoutPath = App::$Alias->currentViewPath . '/layout/' . $this->layout . '.php'; |
|
52 | + $layoutPath = App::$Alias->currentViewPath.'/layout/'.$this->layout.'.php'; |
|
53 | 53 | if (!File::exist($layoutPath)) { |
54 | - throw new NativeException('Layout not founded: ' . $layoutPath); |
|
54 | + throw new NativeException('Layout not founded: '.$layoutPath); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | $body = $this->response; |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | // set custom css library's not included on static call |
71 | 71 | $cssIncludeCode = App::$View->showCodeLink('css'); |
72 | 72 | if (!Str::likeEmpty($cssIncludeCode)) { |
73 | - $content = Str::replace('</head>', $cssIncludeCode . '</head>', $content); |
|
73 | + $content = Str::replace('</head>', $cssIncludeCode.'</head>', $content); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | // add debug bar |
77 | 77 | if (App::$Debug !== null) { |
78 | 78 | $content = Str::replace( |
79 | 79 | ['</body>', '</head>'], |
80 | - [App::$Debug->renderOut() . '</body>', App::$Debug->renderHead() . '</head>'], |
|
80 | + [App::$Debug->renderOut().'</body>', App::$Debug->renderHead().'</head>'], |
|
81 | 81 | $content); |
82 | 82 | } |
83 | 83 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | // check if class exist |
28 | 28 | if (!class_exists(self::$class)) { |
29 | - return 'Error: Widget is not founded: ' . App::$Security->strip_tags(self::$class); |
|
29 | + return 'Error: Widget is not founded: '.App::$Security->strip_tags(self::$class); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | // init class and pass properties |
@@ -22,10 +22,10 @@ |
||
22 | 22 | { |
23 | 23 | $to = trim($to, '/'); |
24 | 24 | if (false === $full && !Str::startsWith(App::$Alias->baseUrl, $to)) { |
25 | - $to = App::$Alias->baseUrl . '/' . $to; |
|
25 | + $to = App::$Alias->baseUrl.'/'.$to; |
|
26 | 26 | } |
27 | 27 | $redirect = new FoundationRedirect($to); |
28 | 28 | $redirect->send(); |
29 | - exit('Redirecting to ' . $to . ' ...'); |
|
29 | + exit('Redirecting to '.$to.' ...'); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -62,7 +62,7 @@ |
||
62 | 62 | // build error text |
63 | 63 | $rawResponse = 'error'; |
64 | 64 | try { |
65 | - $rawResponse = App::$View->render('native/errors/' . $this->tpl, ['msg' => $this->text]); |
|
65 | + $rawResponse = App::$View->render('native/errors/'.$this->tpl, ['msg' => $this->text]); |
|
66 | 66 | if (Str::likeEmpty($rawResponse)) { |
67 | 67 | $rawResponse = $this->text; |
68 | 68 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | protected function sendHTML($message = null) |
56 | 56 | { |
57 | 57 | header('HTTP/1.1 404 Not Found'); |
58 | - return '<!DOCTYPE html><html><head><title>An error has occurred</title></head><body><div style="width:60%; margin: auto; background-color: #fcc;border: 1px solid #faa; padding: 0.5em 1em;"><h1 style="font-size: 120%">Runtime error</h1><p>' . $message . '</p></div></body></html>'; |
|
58 | + return '<!DOCTYPE html><html><head><title>An error has occurred</title></head><body><div style="width:60%; margin: auto; background-color: #fcc;border: 1px solid #faa; padding: 0.5em 1em;"><h1 style="font-size: 120%">Runtime error</h1><p>'.$message.'</p></div></body></html>'; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -85,7 +85,7 @@ |
||
85 | 85 | |
86 | 86 | /** |
87 | 87 | * Build text item |
88 | - * @param unknown $dom |
|
88 | + * @param Dom $dom |
|
89 | 89 | * @param unknown $item |
90 | 90 | */ |
91 | 91 | private static function buildText($dom, $item) |
@@ -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']); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * Find first entry in $string before $delimiter |
53 | 53 | * @param string $string |
54 | 54 | * @param string $delimiter |
55 | - * @return string|bool |
|
55 | + * @return string |
|
56 | 56 | */ |
57 | 57 | public static function firstIn($string, $delimiter) |
58 | 58 | { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @param string $string |
65 | 65 | * @param string $delimiter |
66 | 66 | * @param bool $withoutDelimiter |
67 | - * @return string|bool |
|
67 | + * @return false|string |
|
68 | 68 | */ |
69 | 69 | public static function lastIn($string, $delimiter, $withoutDelimiter = false) |
70 | 70 | { |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | /** |
278 | 278 | * Check is $string sounds like a phone number |
279 | 279 | * @param string $string |
280 | - * @return int |
|
280 | + * @return boolean |
|
281 | 281 | */ |
282 | 282 | public static function isPhone($string) |
283 | 283 | { |
@@ -286,9 +286,6 @@ discard block |
||
286 | 286 | |
287 | 287 | /** |
288 | 288 | * Concat string with add string by separator |
289 | - * @param string $separator |
|
290 | - * @param string $string1 |
|
291 | - * @param string $string2 |
|
292 | 289 | */ |
293 | 290 | public static function concat() |
294 | 291 | { |
@@ -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); |