Completed
Push — master ( cac22e...48735e )
by Mihail
02:18
created
src/Helper/Type/Any.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,12 +17,14 @@  discard block
 block discarded – undo
17 17
     public static function isEmpty($var = null): bool
18 18
     {
19 19
         // var is array type?
20
-        if (is_array($var))
21
-            return count($var) < 1;
20
+        if (is_array($var)) {
21
+                    return count($var) < 1;
22
+        }
22 23
 
23 24
         // var seems to be object?
24
-        if (is_object($var))
25
-            return count(get_object_vars($var)) < 1;
25
+        if (is_object($var)) {
26
+                    return count(get_object_vars($var)) < 1;
27
+        }
26 28
 
27 29
         // float,int,string,bool and null left. Check if not empty. Int and float will never equal to null.
28 30
         return ($var === null || $var === '' || $var === false);
@@ -123,14 +125,17 @@  discard block
 block discarded – undo
123 125
     public static function guessValueType($var = null)
124 126
     {
125 127
         // pass var by reference and guess var type
126
-        if (self::isInt($var))
127
-            return $var;
128
+        if (self::isInt($var)) {
129
+                    return $var;
130
+        }
128 131
 
129
-        if (self::isFloat($var))
130
-            return $var;
132
+        if (self::isFloat($var)) {
133
+                    return $var;
134
+        }
131 135
 
132
-        if (self::isBool($var))
133
-            return $var;
136
+        if (self::isBool($var)) {
137
+                    return $var;
138
+        }
134 139
 
135 140
 
136 141
         return $var;
Please login to merge, or discard this patch.
src/Helper/Type/Arr.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -118,16 +118,16 @@
 block discarded – undo
118 118
                         return 'true';
119 119
                     }
120 120
                 }
121
-                return '\'' . $var . '\'';
121
+                return '\''.$var.'\'';
122 122
             case 'array':
123 123
                 $indexed = array_keys($var) === range(0, count($var) - 1);
124 124
                 $row = [];
125 125
                 foreach ($var as $key => $value) {
126
-                    $row[] = $indent . "\t"
127
-                        . ($indexed ? null : self::exportVar($key, null, $guessTypes) . ' => ')
128
-                        . self::exportVar($value, $indent . "\t", $guessTypes);
126
+                    $row[] = $indent."\t"
127
+                        . ($indexed ? null : self::exportVar($key, null, $guessTypes).' => ')
128
+                        . self::exportVar($value, $indent."\t", $guessTypes);
129 129
                 }
130
-                return "[\n" . implode(",\n", $row) . "\n" . $indent . ']';
130
+                return "[\n".implode(",\n", $row)."\n".$indent.']';
131 131
             case 'boolean':
132 132
                 return $var ? 'true' : 'false';
133 133
             default:
Please login to merge, or discard this patch.
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -19,8 +19,9 @@  discard block
 block discarded – undo
19 19
     public static function in($needle, ?array $haystack = null, bool $strict = true): bool
20 20
     {
21 21
         // prevent errors
22
-        if (!Any::isArray($haystack) || $needle === null)
23
-            return false;
22
+        if (!Any::isArray($haystack) || $needle === null) {
23
+                    return false;
24
+        }
24 25
 
25 26
         return in_array($needle, $haystack, $strict);
26 27
     }
@@ -33,8 +34,9 @@  discard block
 block discarded – undo
33 34
     {
34 35
         $arguments = [];
35 36
         foreach (func_get_args() as $key => $val) {
36
-            if (!Any::isArray($val))
37
-                $val = [];
37
+            if (!Any::isArray($val)) {
38
+                            $val = [];
39
+            }
38 40
 
39 41
             $arguments[$key] = $val;
40 42
         }
@@ -49,8 +51,9 @@  discard block
 block discarded – undo
49 51
     {
50 52
         $arguments = [];
51 53
         foreach (func_get_args() as $key => $val) {
52
-            if (!Any::isArray($val))
53
-                $val = [];
54
+            if (!Any::isArray($val)) {
55
+                            $val = [];
56
+            }
54 57
 
55 58
             $arguments[$key] = $val;
56 59
         }
@@ -67,18 +70,21 @@  discard block
 block discarded – undo
67 70
     public static function getByPath(string $path, ?array $array = null, $delimiter = '.')
68 71
     {
69 72
         // path of nothing? interest
70
-        if (!Any::isArray($array) || count($array) < 1 || !Any::isStr($path) || Str::likeEmpty($path))
71
-            return null;
73
+        if (!Any::isArray($array) || count($array) < 1 || !Any::isStr($path) || Str::likeEmpty($path)) {
74
+                    return null;
75
+        }
72 76
 
73 77
         // c'mon man, what the f*ck are you doing? ))
74
-        if (!Str::contains($delimiter, $path))
75
-            return $array[$path];
78
+        if (!Str::contains($delimiter, $path)) {
79
+                    return $array[$path];
80
+        }
76 81
 
77 82
         $output = $array;
78 83
         $pathArray = explode($delimiter, $path);
79 84
         foreach ($pathArray as $key) {
80
-            if (!Any::isArray($output) || !array_key_exists($key, $output))
81
-                return null;
85
+            if (!Any::isArray($output) || !array_key_exists($key, $output)) {
86
+                            return null;
87
+            }
82 88
 
83 89
             $output = $output[$key];
84 90
         }
@@ -93,14 +99,16 @@  discard block
 block discarded – undo
93 99
      */
94 100
     public static function pluck(?string $key = null, ?array $array = null): array
95 101
     {
96
-        if (!Any::isArray($array) || !Any::isStr($key))
97
-            return [];
102
+        if (!Any::isArray($array) || !Any::isStr($key)) {
103
+                    return [];
104
+        }
98 105
 
99 106
         $output = [];
100 107
         foreach ($array as $item) {
101 108
             $object = $item[$key];
102
-            if (!self::in($object, $output))
103
-                $output[] = $object;
109
+            if (!self::in($object, $output)) {
110
+                            $output[] = $object;
111
+            }
104 112
         }
105 113
         return $output;
106 114
     }
@@ -148,8 +156,9 @@  discard block
 block discarded – undo
148 156
      */
149 157
     public static function onlyNumericValues(?array $array = null)
150 158
     {
151
-        if (!Any::isArray($array))
152
-            return false;
159
+        if (!Any::isArray($array)) {
160
+                    return false;
161
+        }
153 162
 
154 163
         return is_numeric(implode('', $array));
155 164
     }
Please login to merge, or discard this patch.
src/Helper/Environment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,6 +67,6 @@
 block discarded – undo
67 67
             return 'error';
68 68
         }
69 69
 
70
-        return (int)$load . '%';
70
+        return (int)$load.'%';
71 71
     }
72 72
 }
73 73
\ No newline at end of file
Please login to merge, or discard this patch.
src/Exception/TemplateException.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@
 block discarded – undo
36 36
         }
37 37
         
38 38
         // add notification in debug bar if exist
39
-        if (App::$Debug !== null)
40
-            App::$Debug->addException($this);
39
+        if (App::$Debug !== null) {
40
+                    App::$Debug->addException($this);
41
+        }
41 42
 
42 43
         // return rendered result
43 44
         return $this->buildFakePage();
Please login to merge, or discard this patch.
src/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/Debug/DebugMeasure.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@  discard block
 block discarded – undo
16 16
      */
17 17
     public function startMeasure(string $name): void
18 18
     {
19
-        if (App::$Debug)
20
-            App::$Debug->startMeasure($name);
19
+        if (App::$Debug) {
20
+                    App::$Debug->startMeasure($name);
21
+        }
21 22
     }
22 23
 
23 24
     /**
@@ -26,7 +27,8 @@  discard block
 block discarded – undo
26 27
      */
27 28
     public function stopMeasure(string $name): void
28 29
     {
29
-        if (App::$Debug)
30
-            App::$Debug->stopMeasure($name);
30
+        if (App::$Debug) {
31
+                    App::$Debug->stopMeasure($name);
32
+        }
31 33
     }
32 34
 }
33 35
\ No newline at end of file
Please login to merge, or discard this patch.
src/Debug/FfcmsDebugBar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
             $this->addCollector(new TimeDataCollector());
27 27
             $this->addCollector(new MemoryCollector());
28 28
             $this->addCollector(new ExceptionsCollector());
29
-        } catch (\Exception $e){} // mute
29
+        } catch (\Exception $e) {} // mute
30 30
     }
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
src/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/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.