Passed
Push — master ( e985ab...f5765f )
by Mihail
04:35
created
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/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/Widget.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 
26 26
         // check if class exist
27 27
         if (!class_exists(self::$class)) {
28
-            return 'Error: Widget is not founded: ' . self::$class;
28
+            return 'Error: Widget is not founded: '.self::$class;
29 29
         }
30 30
 
31 31
         // init class and pass properties
Please login to merge, or discard this patch.
src/Traits/ModelValidator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                     } elseif (method_exists($class, $obj)) { // maybe its a function?
140 140
                         $class = $class::$obj; // call function
141 141
                     } else {
142
-                        throw new SyntaxException('Filter callback execution failed: ' . $filterName);
142
+                        throw new SyntaxException('Filter callback execution failed: '.$filterName);
143 143
                     }
144 144
                 }
145 145
             }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             if (method_exists($class, $method)) {
149 149
                 $check = @$class::$method($fieldValue, $filterArgs);
150 150
             } else {
151
-                throw new SyntaxException('Filter callback execution failed: ' . $filterName);
151
+                throw new SyntaxException('Filter callback execution failed: '.$filterName);
152 152
             }
153 153
         } elseif (method_exists('Ffcms\Core\Helper\ModelFilters', $filterName)) { // only full namespace\class path based :(
154 154
             if ($filterArgs != null) {
@@ -157,14 +157,14 @@  discard block
 block discarded – undo
157 157
                 $check = ModelFilters::$filterName($fieldValue);
158 158
             }
159 159
         } else {
160
-            throw new SyntaxException('Filter "' . $filterName . '" is not exist');
160
+            throw new SyntaxException('Filter "'.$filterName.'" is not exist');
161 161
         }
162 162
 
163 163
         // if one from all validation tests is fail - mark as incorrect attribute
164 164
         if ($check !== true) {
165 165
             $this->_badAttr[] = $propertyName;
166 166
             if (App::$Debug) {
167
-                App::$Debug->addMessage('Validation failed. Property: ' . $propertyName . ', filter: ' . $filterName, 'warning');
167
+                App::$Debug->addMessage('Validation failed. Property: '.$propertyName.', filter: '.$filterName, 'warning');
168 168
             }
169 169
         } else {
170 170
             $field_set_name = $propertyName;
Please login to merge, or discard this patch.
src/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
 
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public function writeConfig(string $configFile, array $data): bool
139 139
     {
140
-        $path = '/Private/Config/' . ucfirst(Str::lowerCase($configFile)) . '.php';
140
+        $path = '/Private/Config/'.ucfirst(Str::lowerCase($configFile)).'.php';
141 141
         if (!File::exist($path) || !File::writable($path)) {
142 142
             return false;
143 143
         }
144 144
 
145
-        $saveData = '<?php return ' . Arr::exportVar($data) . ';';
145
+        $saveData = '<?php return '.Arr::exportVar($data).';';
146 146
         File::write($path, $saveData);
147 147
         // overload config values if changed
148 148
         $this->load($configFile, true);
Please login to merge, or discard this patch.
src/I18n/Translate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
         if (Any::isArray($params) && count($params) > 0) {
57 57
             foreach ($params as $var => $value) {
58
-                $text = Str::replace('%' . $var . '%', $value, $text);
58
+                $text = Str::replace('%'.$var.'%', $value, $text);
59 59
             }
60 60
         }
61 61
         return $text;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     public function translate(string $text, array $params = null)
71 71
     {
72 72
         $index = null;
73
-        $namespace = 'Apps\Controller\\' . env_name . '\\';
73
+        $namespace = 'Apps\Controller\\'.env_name.'\\';
74 74
         foreach (@debug_backtrace() as $caller) {
75 75
             if (isset($caller['class']) && Str::startsWith($namespace, $caller['class'])) {
76 76
                 $index = Str::sub((string)$caller['class'], Str::length($namespace));
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     protected function load(string $index): ?array
88 88
     {
89
-        $file = root . '/I18n/' . env_name . '/' . App::$Request->getLanguage() . '/' . $index . '.php';
89
+        $file = root.'/I18n/'.env_name.'/'.App::$Request->getLanguage().'/'.$index.'.php';
90 90
         if (!File::exist($file)) {
91 91
             return [];
92 92
         }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     public function getAvailableLangs(): array
126 126
     {
127 127
         $langs = ['en'];
128
-        $scan = Directory::scan(root . '/I18n/' . env_name . '/', GLOB_ONLYDIR, true);
128
+        $scan = Directory::scan(root.'/I18n/'.env_name.'/', GLOB_ONLYDIR, true);
129 129
         foreach ($scan as $row) {
130 130
             $langs[] = trim($row, '/');
131 131
         }
Please login to merge, or discard this patch.
src/Network/Response.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Helper/Url.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public static function to($controller_action, $id = null, $add = null, array $params = null, $encode = true)
26 26
     {
27 27
         $pathway = self::buildPathway([$controller_action, $id, $add, $params], $encode);
28
-        return App::$Alias->baseUrl . '/' . $pathway;
28
+        return App::$Alias->baseUrl.'/'.$pathway;
29 29
     }
30 30
 
31 31
     /**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                 $controller = Str::lastIn($controller, '\\', true);
62 62
             }
63 63
 
64
-            $response = $controller . '/' . $action;
64
+            $response = $controller.'/'.$action;
65 65
         }
66 66
 
67 67
         // check if controller and action is defined
@@ -71,17 +71,17 @@  discard block
 block discarded – undo
71 71
 
72 72
         // id is defined?
73 73
         if (isset($to[1]) && !Str::likeEmpty($to[1])) {
74
-            $response .= '/' . self::safeUri($to[1], $encode);
74
+            $response .= '/'.self::safeUri($to[1], $encode);
75 75
         }
76 76
 
77 77
         // add param is defined?
78 78
         if (isset($to[2]) && !Str::likeEmpty($to[2])) {
79
-            $response .= '/' . self::safeUri($to[2], $encode);
79
+            $response .= '/'.self::safeUri($to[2], $encode);
80 80
         }
81 81
 
82 82
         // try to find static alias
83
-        if (isset($routing['Alias'][env_name]) && Arr::in('/' . $response, $routing['Alias'][env_name])) {
84
-            $pathAlias = array_search('/' . $response, $routing['Alias'][env_name]);
83
+        if (isset($routing['Alias'][env_name]) && Arr::in('/'.$response, $routing['Alias'][env_name])) {
84
+            $pathAlias = array_search('/'.$response, $routing['Alias'][env_name]);
85 85
             if ($pathAlias !== false) {
86 86
                 $response = Str::lowerCase(trim($pathAlias, '/'));
87 87
             }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             }
98 98
             $queryString = http_build_query($to[3]);
99 99
             if (Str::length($queryString) > 0) {
100
-                $response .= '?' . http_build_query($to[3]);
100
+                $response .= '?'.http_build_query($to[3]);
101 101
             }
102 102
             if ($anchor !== false) {
103 103
                 $response .= $anchor;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     public static function buildPathwayFromRequest()
120 120
     {
121 121
         return self::buildPathway([
122
-            Str::lowerCase(App::$Request->getController()) . '/' . Str::lowerCase(App::$Request->getAction()),
122
+            Str::lowerCase(App::$Request->getController()).'/'.Str::lowerCase(App::$Request->getAction()),
123 123
             App::$Request->getID(),
124 124
             App::$Request->getAdd(),
125 125
             App::$Request->query->all()
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
         }
142 142
 
143 143
         // call Url::to(args)
144
-        $callbackTo = call_user_func_array([__NAMESPACE__ . '\Url', 'to'], $to);
144
+        $callbackTo = call_user_func_array([__NAMESPACE__.'\Url', 'to'], $to);
145 145
 
146
-        return '<a href="' . $callbackTo . '"' . $compile_property . '>' . $name . '</a>';
146
+        return '<a href="'.$callbackTo.'"'.$compile_property.'>'.$name.'</a>';
147 147
     }
148 148
 
149 149
     /**
@@ -156,19 +156,19 @@  discard block
 block discarded – undo
156 156
     {
157 157
         /** @var array $configs */
158 158
         $configs = \App::$Properties->getAll('default');
159
-        $httpHost = $configs['baseProto'] . '://' . $configs['baseDomain'];
159
+        $httpHost = $configs['baseProto'].'://'.$configs['baseDomain'];
160 160
         if ($configs['basePath'] !== '/') {
161
-            $httpHost .= $configs['basePath'] . '/';
161
+            $httpHost .= $configs['basePath'].'/';
162 162
         }
163 163
 
164 164
         // check if is this is URI not URL
165 165
         if (!Str::startsWith($httpHost, $uri)) {
166 166
             // check if lang is defined in URI or define it
167 167
             if ($lang !== null && $configs['multiLanguage'] && !Str::startsWith($lang, $uri)) {
168
-                $uri = $lang . '/' . ltrim($uri, '/');
168
+                $uri = $lang.'/'.ltrim($uri, '/');
169 169
             }
170 170
             // add basic httpHost data
171
-            $uri = rtrim($httpHost, '/') . '/' . ltrim($uri, '/');
171
+            $uri = rtrim($httpHost, '/').'/'.ltrim($uri, '/');
172 172
         }
173 173
 
174 174
         return $uri;
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
@@ -66,6 +66,6 @@
 block discarded – undo
66 66
             return 'error';
67 67
         }
68 68
 
69
-        return (int)$load . '%';
69
+        return (int)$load.'%';
70 70
     }
71 71
 }
Please login to merge, or discard this patch.