Completed
Push — master ( 37b087...b08a55 )
by Mihail
02:34
created
src/Ffcms/Core/Arch/Model.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
src/Ffcms/Core/Arch/View.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -54,16 +54,16 @@  discard block
 block discarded – undo
54 54
         $this->lang = App::$Request->getLanguage();
55 55
         // get theme config and build full path
56 56
         $themeConfig = App::$Properties->get('theme');
57
-        $this->themePath = root . DIRECTORY_SEPARATOR . 'Apps' . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . env_name;
57
+        $this->themePath = root.DIRECTORY_SEPARATOR.'Apps'.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.env_name;
58 58
         if (isset($themeConfig[env_name]) && Str::length($themeConfig[env_name]) > 0) {
59
-            $this->themePath .=  DIRECTORY_SEPARATOR . $themeConfig[env_name];
59
+            $this->themePath .= DIRECTORY_SEPARATOR.$themeConfig[env_name];
60 60
         } else {
61
-            $this->themePath .= DIRECTORY_SEPARATOR . 'default';
61
+            $this->themePath .= DIRECTORY_SEPARATOR.'default';
62 62
         }
63 63
 
64 64
         // check if theme is available
65 65
         if (!Directory::exist($this->themePath)) {
66
-            throw new NativeException('Apps theme is not founded: ' . Str::replace(root, null, $this->themePath));
66
+            throw new NativeException('Apps theme is not founded: '.Str::replace(root, null, $this->themePath));
67 67
         }
68 68
 
69 69
         // get input args and build class properties
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         
107 107
         // path still not defined?
108 108
         if ($path === null) {
109
-            throw new SyntaxException('Viewer is not founded: ' . App::$Security->strip_tags($path));
109
+            throw new SyntaxException('Viewer is not founded: '.App::$Security->strip_tags($path));
110 110
         }
111 111
 
112 112
         // cleanup from slashes on start/end
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             // lets try to get full path for current theme
136 136
             $tmpPath = $path;
137 137
             if (!Str::startsWith($this->themePath, $path)) {
138
-                $tmpPath = Normalize::diskPath($this->themePath . '/' . $path . '.php');
138
+                $tmpPath = Normalize::diskPath($this->themePath.'/'.$path.'.php');
139 139
             }
140 140
         } else { // sounds like a object-depended view call from controller or etc
141 141
             // get stack trace of callbacks
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
 
152 152
             // depended controller is not founded? Let finish
153 153
             if ($calledController === null) {
154
-                throw new NativeException('View render is failed: callback controller not founded! Call with relative path: ' . $path);
154
+                throw new NativeException('View render is failed: callback controller not founded! Call with relative path: '.$path);
155 155
             }
156 156
 
157 157
             // get controller name
158
-            $controllerName = Str::sub($calledController, Str::length('Apps\\Controller\\' . env_name . '\\'));
158
+            $controllerName = Str::sub($calledController, Str::length('Apps\\Controller\\'.env_name.'\\'));
159 159
             $controllerName = Str::lowerCase($controllerName);
160 160
             // get full path
161
-            $tmpPath = $this->themePath . DIRECTORY_SEPARATOR . $controllerName . DIRECTORY_SEPARATOR . $path . '.php';
161
+            $tmpPath = $this->themePath.DIRECTORY_SEPARATOR.$controllerName.DIRECTORY_SEPARATOR.$path.'.php';
162 162
         }
163 163
 
164 164
         // check if builded view full path is exist
@@ -168,18 +168,18 @@  discard block
 block discarded – undo
168 168
 
169 169
         // hmm, not founded. Lets try to find in caller directory (for widgets, apps packages and other)
170 170
         if ($source !== null) {
171
-            $tmpPath = Normalize::diskPath($source . DIRECTORY_SEPARATOR . $path . '.php');
171
+            $tmpPath = Normalize::diskPath($source.DIRECTORY_SEPARATOR.$path.'.php');
172 172
             if (File::exist($tmpPath)) {
173 173
                 // add notify for native views
174 174
                 if (App::$Debug !== null) {
175
-                    App::$Debug->addMessage('Render native viewer: ' . Str::replace(root, null, $tmpPath), 'info');
175
+                    App::$Debug->addMessage('Render native viewer: '.Str::replace(root, null, $tmpPath), 'info');
176 176
                 }
177 177
                 return $tmpPath;
178 178
             }
179 179
         }
180 180
 
181 181
         if (App::$Debug !== null) {
182
-            App::$Debug->addMessage('Viewer not founded on rendering: ' . $path, 'warning');
182
+            App::$Debug->addMessage('Viewer not founded on rendering: '.$path, 'warning');
183 183
         }
184 184
 
185 185
         return null;
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
         foreach ($items as $item) {
275 275
             $item = trim($item, '/');
276 276
             if (!Str::startsWith(App::$Alias->scriptUrl, $item) && !Str::startsWith('http', $item)) { // is local without proto and domain
277
-                $item = App::$Alias->scriptUrl . '/' . $item;
277
+                $item = App::$Alias->scriptUrl.'/'.$item;
278 278
             }
279 279
             $output[] = $item;
280 280
         }
@@ -283,9 +283,9 @@  discard block
 block discarded – undo
283 283
         $output = null;
284 284
         foreach ($clear as $row) {
285 285
             if ($type === 'css') {
286
-                $output .= '<link rel="stylesheet" type="text/css" href="' . $row . '">' . "\n";
286
+                $output .= '<link rel="stylesheet" type="text/css" href="'.$row.'">'."\n";
287 287
             } elseif ($type === 'js') {
288
-                $output .= '<script src="' . $row . '"></script>' . "\n";
288
+                $output .= '<script src="'.$row.'"></script>'."\n";
289 289
             }
290 290
         }
291 291
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
         $code = null;
310 310
         foreach (App::$Alias->getPlainCode($type) as $row) {
311
-            $code .= $row . "\n";
311
+            $code .= $row."\n";
312 312
         }
313 313
 
314 314
         return $code;
Please login to merge, or discard this patch.
src/Ffcms/Core/Debug/Manager.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Table.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
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 = null;
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
                             }
62 62
                             // make global checkbox for selectable columns
63 63
                             if ($selectOptions !== false && $order + 1 === $selectOptions['attachOrder']) {
64
-                                $th = $dom->input(function () {
64
+                                $th = $dom->input(function() {
65 65
                                     return null;
66
-                                }, ['type' => 'checkbox', 'name' => 'selectAll']) . ' ' . $th;
66
+                                }, ['type' => 'checkbox', 'name' => 'selectAll']).' '.$th;
67 67
                             }
68 68
                             // build tr row collecting all th's
69
-                            $tr .= $dom->th(function () use ($th) {
69
+                            $tr .= $dom->th(function() use ($th) {
70 70
                                 return $th;
71 71
                             }, $title['property']);
72 72
                         }
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
                         // sort td items inside row by key increment
86 86
                         ksort($row);
87 87
                         // add data in tr container
88
-                        $tr .= $dom->tr(function () use ($dom, $row, $selectOptions) {
88
+                        $tr .= $dom->tr(function() use ($dom, $row, $selectOptions) {
89 89
                             $td = null;
90 90
                             foreach ($row as $order => $item) {
91 91
                                 if (!Obj::isInt($order)) {
92 92
                                     continue;
93 93
                                 }
94 94
                                 // collect td item
95
-                                $td .= $dom->td(function () use ($dom, $order, $item, $selectOptions) {
95
+                                $td .= $dom->td(function() use ($dom, $order, $item, $selectOptions) {
96 96
                                     $text = null;
97 97
                                     // make text secure based on passed options
98 98
                                     if ($item['html'] === true) {
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
                                     }
107 107
                                     // check if selectable box is enabled and equal current order id
108 108
                                     if ($selectOptions !== false && $order === $selectOptions['attachOrder']) {
109
-                                        $text = $dom->input(function (){
109
+                                        $text = $dom->input(function() {
110 110
                                             return null;
111
-                                        }, Arr::merge($selectOptions['selector'], ['value' => htmlentities($text)])) . ' ' . $text;
111
+                                        }, Arr::merge($selectOptions['selector'], ['value' => htmlentities($text)])).' '.$text;
112 112
                                     }
113 113
                                     return $text;
114 114
                                 }, $item['property']);
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
             // build js code for "selectAll" checkbox
132 132
             self::buildSelectorHtml($selectOptions);
133 133
             // return response inside "form" tag
134
-            return $dom->form(function () use ($dom, $selectOptions, $table) {
134
+            return $dom->form(function() use ($dom, $selectOptions, $table) {
135 135
                 foreach ($selectOptions['buttons'] as $btn) {
136 136
                     if (!Obj::isArray($btn)) {
137 137
                         continue;
138 138
                     }
139
-                    $table .= $dom->input(function(){
139
+                    $table .= $dom->input(function() {
140 140
                         return null;
141
-                    }, $btn) . ' ';
141
+                    }, $btn).' ';
142 142
                 }
143 143
                 return $table;
144 144
             }, $selectOptions['form']);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     private static function buildSelectorHtml(array $opt)
155 155
     {
156 156
         $js = '$(function () {
157
-            var targetSwitchbox = $(\'input[name="' . $opt['selector']['name'] . '"]\');
157
+            var targetSwitchbox = $(\'input[name="' . $opt['selector']['name'].'"]\');
158 158
             $(\'input[name="selectAll"]\').change(function() {
159 159
                 $(targetSwitchbox).each(function () {
160 160
                     $(this).prop(\'checked\', !$(this).is(\':checked\'));
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/Text.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
                 $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) {
Please login to merge, or discard this patch.
src/Ffcms/Core/Debug/LaravelDatabaseCollector.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/FileSystem/Normalize.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
     {
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
     }
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/FileSystem/Directory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             return false;
92 92
         }
93 93
 
94
-        $pattern = rtrim($path, '/') . '/*';
94
+        $pattern = rtrim($path, '/').'/*';
95 95
         $entry = glob($pattern, $mod);
96 96
 
97 97
         if ($returnRelative === true) {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         array_pop($separatedPath);
123 123
         $clearPath = implode(DIRECTORY_SEPARATOR, $separatedPath);
124 124
 
125
-        @rename($path, $clearPath . DIRECTORY_SEPARATOR . $newDirName);
125
+        @rename($path, $clearPath.DIRECTORY_SEPARATOR.$newDirName);
126 126
 
127 127
         return true;
128 128
     }
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/System/Dom.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
     {
98 98
         // looks like a single tag, <img src="" class="" />, <hr class="" />
99 99
         if (Arr::in($name, self::$singleTags)) {
100
-            return '<' . $name . self::applyProperties($properties) . ' />';
101
-        } elseif(Arr::in($name, self::$containerTags)) { // looks like a container tag, <div class=""></div>
102
-            return '<' . $name . self::applyProperties($properties) . '>' . $content . '</' . $name . '>';
100
+            return '<'.$name.self::applyProperties($properties).' />';
101
+        } elseif (Arr::in($name, self::$containerTags)) { // looks like a container tag, <div class=""></div>
102
+            return '<'.$name.self::applyProperties($properties).'>'.$content.'</'.$name.'>';
103 103
         }
104 104
 
105 105
         // empty response
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
             }
127 127
             // sounds like single standalone property, ex required, selected etc
128 128
             if ($value === null || $value === false) {
129
-                $build .= ' ' . htmlentities($property, ENT_QUOTES);
129
+                $build .= ' '.htmlentities($property, ENT_QUOTES);
130 130
             } else { // sounds like a classic key="value" property
131
-                $build .= ' ' . htmlentities($property, ENT_QUOTES) . '="' . htmlentities($value, ENT_QUOTES) . '"';
131
+                $build .= ' '.htmlentities($property, ENT_QUOTES).'="'.htmlentities($value, ENT_QUOTES).'"';
132 132
             }
133 133
         }
134 134
         return $build;
Please login to merge, or discard this patch.