Completed
Push — master ( bd8c0c...3a3845 )
by Mihail
01:50
created
src/Ffcms/Core/Properties.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
         }
43 43
 
44 44
         // try to load from file
45
-        $configFile = ucfirst(Str::lowerCase($configName)) . '.php';
46
-        if (File::exist('/Private/Config/' . $configFile)) {
47
-            $this->data[$configName] = File::inc('/Private/Config/' . $configFile, true);
45
+        $configFile = ucfirst(Str::lowerCase($configName)).'.php';
46
+        if (File::exist('/Private/Config/'.$configFile)) {
47
+            $this->data[$configName] = File::inc('/Private/Config/'.$configFile, true);
48 48
             return true;
49 49
         }
50 50
 
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function writeConfig($configFile, array $data)
143 143
     {
144
-        $path = '/Private/Config/' . ucfirst(Str::lowerCase($configFile)) . '.php';
144
+        $path = '/Private/Config/'.ucfirst(Str::lowerCase($configFile)).'.php';
145 145
         if (!File::exist($path) || !File::writable($path)) {
146 146
             return false;
147 147
         }
148
-        $saveData = '<?php return ' . Arr::exportVar($data) . ';';
148
+        $saveData = '<?php return '.Arr::exportVar($data).';';
149 149
         File::write($path, $saveData);
150 150
         // overload config values if changed
151 151
         $this->load($configFile, true);
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,17 +110,17 @@  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'])) {
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
                             }, $elements['brand']['property']);
136 136
                         }
137 137
                     }
138
-                    return $collapseButton . $brand;
138
+                    return $collapseButton.$brand;
139 139
                 }, ['class' => 'navbar-header']);
140 140
                 // return header and body concat
141
-                return $header . $body;
141
+                return $header.$body;
142 142
             }, $elements['container']);
143 143
         }, $elements['nav']);
144 144
     }
Please login to merge, or discard this patch.
src/Ffcms/Core/Network/Request.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
 
61 61
         $basePath = trim(App::$Properties->get('basePath'), '/');
62 62
         if ($basePath !== null && Str::length($basePath) > 0) {
63
-            $basePath = '/' . $basePath;
63
+            $basePath = '/'.$basePath;
64 64
         }
65 65
 
66 66
         if (!defined('env_no_uri') || env_no_uri === false) {
67
-            $basePath .= '/' . strtolower(env_name);
67
+            $basePath .= '/'.strtolower(env_name);
68 68
         }
69 69
 
70 70
         // we never try to use path's without friendly url's
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             } else {
91 91
                 // try to find language in pathway
92 92
                 foreach (App::$Properties->get('languages') as $lang) {
93
-                    if (Str::startsWith('/' . $lang, $this->getPathInfo())) {
93
+                    if (Str::startsWith('/'.$lang, $this->getPathInfo())) {
94 94
                         $this->language = $lang;
95 95
                         $this->languageInPath = true;
96 96
                     }
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
                     // parse query string
118 118
                     $queryString = null;
119 119
                     if (count($this->query->all()) > 0) {
120
-                        $queryString = '?' . http_build_query($this->query->all());
120
+                        $queryString = '?'.http_build_query($this->query->all());
121 121
                     }
122 122
 
123 123
                     // build response with redirect to language-based path
124
-                    $response = new Redirect($this->getSchemeAndHttpHost() . $this->basePath . '/' . $userLang . $this->getPathInfo() . $queryString);
124
+                    $response = new Redirect($this->getSchemeAndHttpHost().$this->basePath.'/'.$userLang.$this->getPathInfo().$queryString);
125 125
                     $response->send();
126 126
                     exit();
127 127
                 }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         if (array_key_exists($pathway, $routing['Redirect'])) {
181 181
             $target = $this->getSchemeAndHttpHost(); // . $this->getBasePath() . '/' . rtrim($routing['Redirect'][$pathway], '/');
182 182
             if ($this->getBasePath() !== null && !Str::likeEmpty($this->getBasePath())) {
183
-                $target .= '/' . $this->getBasePath();
183
+                $target .= '/'.$this->getBasePath();
184 184
             }
185 185
             $target .= rtrim($routing['Redirect'][$pathway], '/');
186 186
             $redirect = new Redirect($target);
@@ -206,9 +206,9 @@  discard block
 block discarded – undo
206 206
             // find "new path" as binding uri slug
207 207
             $binding = array_search($pathway, $map, true);
208 208
             // build url to redirection
209
-            $url = $this->getSchemeAndHttpHost() . $this->getBasePath() . '/';
209
+            $url = $this->getSchemeAndHttpHost().$this->getBasePath().'/';
210 210
             if (App::$Properties->get('multiLanguage')) {
211
-                $url .= $this->language . '/';
211
+                $url .= $this->language.'/';
212 212
             }
213 213
             $url .= ltrim($binding, '/');
214 214
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
     {
303 303
         $route = $this->languageInPath ? Str::sub(parent::getPathInfo(), Str::length($this->language) + 1) : parent::getPathInfo();
304 304
         if (!Str::startsWith('/', $route)) {
305
-            $route = '/' . $route;
305
+            $route = '/'.$route;
306 306
         }
307 307
         return $route;
308 308
     }
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
      */
428 428
     public function getFullUrl()
429 429
     {
430
-        return $this->getSchemeAndHttpHost() . $this->getRequestUri();
430
+        return $this->getSchemeAndHttpHost().$this->getRequestUri();
431 431
     }
432 432
 
433 433
     /**
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/System/NativeGenerator.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
             $purifier = App::$Memory->get('object.purifier.helpers');
24 24
         } else {
25 25
             $config = \HTMLPurifier_Config::createDefault();
26
-            $config->set('Cache.SerializerPath', root . '/Private/Cache/HTMLPurifier/');
26
+            $config->set('Cache.SerializerPath', root.'/Private/Cache/HTMLPurifier/');
27 27
             $config->set('AutoFormat.AutoParagraph', false);
28 28
 
29 29
             // allow use target=_blank for links
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
         $build = null;
66 66
         foreach ($property as $p => $v) {
67 67
             if ($v === null || $v === false || $v === true) {
68
-                $build .= ' ' . self::nohtml($p);
68
+                $build .= ' '.self::nohtml($p);
69 69
             } else {
70
-                $build .= ' ' . self::nohtml($p) . '="' . self::nohtml($v) . '"';
70
+                $build .= ' '.self::nohtml($p).'="'.self::nohtml($v).'"';
71 71
             }
72 72
         }
73 73
         return $build;
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public static function buildSingleTag($tagName, array $property = null, $closeSlash = true)
84 84
     {
85
-        return '<' . self::nohtml($tagName) . self::applyProperty($property) . ($closeSlash ? '/>' : '>');
85
+        return '<'.self::nohtml($tagName).self::applyProperty($property).($closeSlash ? '/>' : '>');
86 86
     }
87 87
 
88 88
     /**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             $value = self::nohtml($value);
101 101
         }
102 102
         
103
-        return '<' . $tagName . self::applyProperty($property) . '>' . $value . '</' . $tagName . '>';
103
+        return '<'.$tagName.self::applyProperty($property).'>'.$value.'</'.$tagName.'>';
104 104
     }
105 105
 
106 106
     /**
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
                 if (!Str::contains('/', $elementPoint) || count($elementArray) < 2) {
143 143
                     $active = $elementPoint === $currentPoint;
144 144
                 } else {
145
-                    $elementPoint = $elementArray[0] . '/' . $elementArray[1];
145
+                    $elementPoint = $elementArray[0].'/'.$elementArray[1];
146 146
                     $active = Str::startsWith($elementPoint, $currentPoint);
147 147
                 }
148 148
                 break;
149 149
             case 'id':
150 150
                 $elementArray = explode('/', $elementPoint);
151
-                $elementPoint = $elementArray[0] . '/' . $elementArray[1];
151
+                $elementPoint = $elementArray[0].'/'.$elementArray[1];
152 152
                 if ($elementArray[2] === null) { // looks like id is not defined in element
153 153
                     if (Str::contains('?', $currentPoint)) {
154 154
                         $currentPoint = Str::firstIn($currentPoint, '?');
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                     $currentToId = implode('/', array_slice($currentArray, 0, 3));
158 158
                     $active = $elementPoint === $currentToId;
159 159
                 } else {
160
-                    $elementPoint .= '/' . $elementArray[2];
160
+                    $elementPoint .= '/'.$elementArray[2];
161 161
                     $active = Str::startsWith($elementPoint, $currentPoint);
162 162
                 }
163 163
                 break;
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      */
213 213
     public static function convertLink($uri)
214 214
     {
215
-        $link = App::$Alias->baseUrl . '/';
215
+        $link = App::$Alias->baseUrl.'/';
216 216
         if (Obj::isArray($uri)) {
217 217
             $link .= Url::buildPathway($uri);
218 218
         } elseif (Str::startsWith('http', $uri)) {
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
      */
233 233
     public static function encode($uri)
234 234
     {
235
-        return implode('/', array_map(function($v){
235
+        return implode('/', array_map(function($v) {
236 236
             return urlencode($v);
237 237
         }, explode('/', $uri)));
238 238
     }
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Form/CaptchaField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         }
36 36
         // get image link
37 37
         $image = App::$Captcha->get();
38
-        $response = '<img id="src-secure-image" src="' . $image . '" alt="captcha" onClick="this.src=\''.$image.'&rnd=\'+Math.random()" />';
38
+        $response = '<img id="src-secure-image" src="'.$image.'" alt="captcha" onClick="this.src=\''.$image.'&rnd=\'+Math.random()" />';
39 39
         // render response tag with image
40 40
         $this->properties['type'] = 'text';
41 41
         $response .= self::buildSingleTag('input', $this->properties);
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';
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                     return $tabContent;
131 131
                 }, $elements['tabProperty']);
132 132
             }
133
-            return $listing . $tabContent;
133
+            return $listing.$tabContent;
134 134
         }, $blockProperty);
135 135
     }
136 136
 }
137 137
\ No newline at end of file
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Listing.php 2 patches
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
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         return $dom->li(function() use($dom, $item){
73 73
             $dropdownLink = $dom->a(function() use ($dom, $item){
74
-                return self::applyEscape($item['text'], $item['html'], $item['!secure']) . ' ' . $dom->span(function(){}, ['class' => 'caret']);
74
+                return self::applyEscape($item['text'], $item['html'], $item['!secure']).' '.$dom->span(function() {}, ['class' => 'caret']);
75 75
             }, $item['dropdown']);
76 76
 
77 77
             $dropdownElements = $dom->ul(function() use ($dom, $item){
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                 return $resp;
83 83
             }, $item['menuProperty']);
84 84
 
85
-            return $dropdownLink . $dropdownElements;
85
+            return $dropdownLink.$dropdownElements;
86 86
         }, $item['property']);
87 87
 
88 88
     }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         $item['linkProperty']['href'] = self::convertLink($item['link']);
137 137
 
138 138
         // build output <li@params><a @params>@text</li>
139
-        return $dom->li(function () use ($dom, $text, $item) {
139
+        return $dom->li(function() use ($dom, $text, $item) {
140 140
             return $dom->a(function() use ($text) {
141 141
                 return $text;
142 142
             }, $item['linkProperty']);
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,8 +66,9 @@
 block discarded – undo
66 66
             return null;
67 67
         }
68 68
 
69
-        if (!isset($item['menuProperty']['class']))
70
-            $item['menuProperty']['class'] = 'dropdown-menu';
69
+        if (!isset($item['menuProperty']['class'])) {
70
+                    $item['menuProperty']['class'] = 'dropdown-menu';
71
+        }
71 72
 
72 73
         return $dom->li(function() use($dom, $item){
73 74
             $dropdownLink = $dom->a(function() use ($dom, $item){
Please login to merge, or discard this patch.
src/Ffcms/Core/Arch/Model.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     /**
42 42
      * Get label value by variable name
43 43
      * @param string $param
44
-     * @return mixed
44
+     * @return string
45 45
      */
46 46
     final public function getLabel($param)
47 47
     {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
     /**
67 67
      * Set attribute labels for model variables
68
-     * @return array
68
+     * @return string
69 69
      */
70 70
     public function labels(): array
71 71
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
156 156
      * Get all properties for current model in key=>value array
157 157
      * @return array|null
158 158
      */
159
-    public function getAllProperties(): ?array
159
+    public function getAllProperties(): ? array
160 160
     {
161 161
         $properties = null;
162 162
         // list all properties here, array_walk sucks on performance!
Please login to merge, or discard this patch.
src/Ffcms/Core/Arch/Controller.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
         } else {
68 68
             $this->startMeasure(__METHOD__);
69 69
 
70
-            $layoutPath = App::$Alias->currentViewPath . '/layout/' . $this->layout . '.php';
70
+            $layoutPath = App::$Alias->currentViewPath.'/layout/'.$this->layout.'.php';
71 71
             if (!File::exist($layoutPath)) {
72
-                throw new NativeException('Layout not founded: ' . $layoutPath);
72
+                throw new NativeException('Layout not founded: '.$layoutPath);
73 73
             }
74 74
 
75 75
             $body = $this->output;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             // set custom css library's not included on static call
89 89
             $cssIncludeCode = App::$View->showCodeLink('css');
90 90
             if (!Str::likeEmpty($cssIncludeCode)) {
91
-                $content = Str::replace('</head>', $cssIncludeCode . '</head>', $content);
91
+                $content = Str::replace('</head>', $cssIncludeCode.'</head>', $content);
92 92
             }
93 93
 
94 94
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             if (App::$Debug) {
99 99
                 $content = Str::replace(
100 100
                     ['</body>', '</head>'],
101
-                    [App::$Debug->renderOut() . '</body>', App::$Debug->renderHead() . '</head>'],
101
+                    [App::$Debug->renderOut().'</body>', App::$Debug->renderHead().'</head>'],
102 102
                     $content);
103 103
             }
104 104
 
Please login to merge, or discard this patch.