Completed
Push — master ( 24a963...13192d )
by Mihail
03:16
created
src/Ffcms/Core/Exception/NativeException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Listing.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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']);
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Bootstrap/Nav.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Bootstrap/Navbar.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/Type/Str.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -297,7 +297,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -7 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @param string $string
69 69
      * @param string $delimiter
70 70
      * @param bool $withoutDelimiter
71
-     * @return string|bool
71
+     * @return false|string
72 72
      */
73 73
     public static function lastIn($string, $delimiter, $withoutDelimiter = false)
74 74
     {
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
 
201 201
     /**
202 202
      * Case-ignore replace $needle to $replacement in string $haystack. Alias for function str_ireplace()
203
-     * @param string|array $needle
204
-     * @param string|array $replacement
203
+     * @param string[] $needle
204
+     * @param string $replacement
205 205
      * @param string $haystack
206 206
      * @return string
207 207
      */
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     /**
294 294
      * Check is $string sounds like a phone number
295 295
      * @param string $string
296
-     * @return int
296
+     * @return boolean
297 297
      */
298 298
     public static function isPhone($string)
299 299
     {
@@ -302,9 +302,6 @@  discard block
 block discarded – undo
302 302
 
303 303
     /**
304 304
      * Concat string with add string by separator
305
-     * @param string $separator
306
-     * @param string $string1
307
-     * @param string $string2
308 305
      * @return string
309 306
      */
310 307
     public static function concat()
Please login to merge, or discard this patch.
src/Ffcms/Core/Network/Request.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/Ffcms/Core/Managers/EventManager.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,9 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Ffcms\Core\App;
5 5
 use Ffcms\Core\Helper\Type\Obj;
6
-use Ffcms\Core\Helper\Type\Str;
7
-use Ffcms\Core\Helper\FileSystem\Directory;
8
-use Ffcms\Core\Helper\FileSystem\File;
9 6
 
10 7
 /**
11 8
  * Class EventManager. Control and run events.
Please login to merge, or discard this patch.
src/Ffcms/Core/Properties.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Ffcms/Core/Managers/CronManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.