Completed
Push — master ( 48735e...1bc6cd )
by Mihail
02:17
created
src/Managers/MigrationsManager.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 use Ffcms\Core\Helper\FileSystem\Normalize;
9 9
 use Ffcms\Core\Helper\Type\Any;
10 10
 use Ffcms\Core\Helper\Type\Arr;
11
-use Ffcms\Core\Helper\Type\Obj;
12 11
 use Ffcms\Core\Helper\Type\Str;
13 12
 
14 13
 /**
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                 continue;
73 73
             }
74 74
             // check initialize conditions (equals to $exist)
75
-            if (File::exist($this->dir . '/' . $migration)) {
75
+            if (File::exist($this->dir.'/'.$migration)) {
76 76
                 if (Arr::in($fullName, $dbmigrations) === $exist) {
77 77
                     $found[] = $migration;
78 78
                 }
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
         }
103 103
 
104 104
         // check if migration file is exists
105
-        if (!File::exist($this->dir . '/' . $file)) {
105
+        if (!File::exist($this->dir.'/'.$file)) {
106 106
             return false;
107 107
         }
108 108
 
109 109
         // check if migration file located in extend directory and copy to default
110 110
         if (Normalize::diskFullPath($this->dir) !== Normalize::diskFullPath(static::DEFAULT_DIR)) {
111
-            File::copy($this->dir . DIRECTORY_SEPARATOR . $file, static::DEFAULT_DIR . DIRECTORY_SEPARATOR . $file);
111
+            File::copy($this->dir.DIRECTORY_SEPARATOR.$file, static::DEFAULT_DIR.DIRECTORY_SEPARATOR.$file);
112 112
         }
113 113
 
114 114
         // include migration and get class name
115
-        File::inc($this->dir . '/' . $file, false, false);
115
+        File::inc($this->dir.'/'.$file, false, false);
116 116
         $fullName = Str::cleanExtension($file);
117 117
         $class = Str::firstIn($fullName, '-');
118 118
 
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
         }
149 149
 
150 150
         // check if exists
151
-        if (!File::exist($this->dir . '/' . $file)) {
151
+        if (!File::exist($this->dir.'/'.$file)) {
152 152
             return false;
153 153
         }
154 154
 
155
-        File::inc($this->dir . '/' . $file, false, false);
155
+        File::inc($this->dir.'/'.$file, false, false);
156 156
         $fullName = Str::cleanExtension($file);
157 157
         $class = Str::firstIn($fullName, '-');
158 158
 
Please login to merge, or discard this patch.
src/Network/Request.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Ffcms\Core\App;
6 6
 use Ffcms\Core\Helper\Type\Any;
7 7
 use Ffcms\Core\Helper\Type\Arr;
8
-use Ffcms\Core\Helper\Type\Obj;
9 8
 use Ffcms\Core\Helper\Type\Str;
10 9
 use Symfony\Component\HttpFoundation\RedirectResponse as Redirect;
11 10
 use Symfony\Component\HttpFoundation\Request as FoundationRequest;
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 
62 62
         $basePath = trim(App::$Properties->get('basePath'), '/');
63 63
         if ($basePath !== null && Str::length($basePath) > 0) {
64
-            $basePath = '/' . $basePath;
64
+            $basePath = '/'.$basePath;
65 65
         }
66 66
 
67 67
         if (!defined('env_no_uri') || env_no_uri === false) {
68
-            $basePath .= '/' . strtolower(env_name);
68
+            $basePath .= '/'.strtolower(env_name);
69 69
         }
70 70
 
71 71
         // we never try to use path's without friendly url's
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             } else {
92 92
                 // try to find language in pathway
93 93
                 foreach (App::$Properties->get('languages') as $lang) {
94
-                    if (Str::startsWith('/' . $lang, $this->getPathInfo())) {
94
+                    if (Str::startsWith('/'.$lang, $this->getPathInfo())) {
95 95
                         $this->language = $lang;
96 96
                         $this->languageInPath = true;
97 97
                     }
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
                     // parse query string
119 119
                     $queryString = null;
120 120
                     if (count($this->query->all()) > 0) {
121
-                        $queryString = '?' . http_build_query($this->query->all());
121
+                        $queryString = '?'.http_build_query($this->query->all());
122 122
                     }
123 123
 
124 124
                     // build response with redirect to language-based path
125
-                    $response = new Redirect($this->getSchemeAndHttpHost() . $this->basePath . '/' . $userLang . $this->getPathInfo() . $queryString);
125
+                    $response = new Redirect($this->getSchemeAndHttpHost().$this->basePath.'/'.$userLang.$this->getPathInfo().$queryString);
126 126
                     $response->send();
127 127
                     exit();
128 128
                 }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         if (array_key_exists($pathway, $routing['Redirect'])) {
182 182
             $target = $this->getSchemeAndHttpHost(); // . $this->getBasePath() . '/' . rtrim($routing['Redirect'][$pathway], '/');
183 183
             if ($this->getBasePath() !== null && !Str::likeEmpty($this->getBasePath())) {
184
-                $target .= '/' . $this->getBasePath();
184
+                $target .= '/'.$this->getBasePath();
185 185
             }
186 186
             $target .= rtrim($routing['Redirect'][$pathway], '/');
187 187
             $redirect = new Redirect($target);
@@ -207,9 +207,9 @@  discard block
 block discarded – undo
207 207
             // find "new path" as binding uri slug
208 208
             $binding = array_search($pathway, $map, true);
209 209
             // build url to redirection
210
-            $url = $this->getSchemeAndHttpHost() . $this->getBasePath() . '/';
210
+            $url = $this->getSchemeAndHttpHost().$this->getBasePath().'/';
211 211
             if (App::$Properties->get('multiLanguage')) {
212
-                $url .= $this->language . '/';
212
+                $url .= $this->language.'/';
213 213
             }
214 214
             $url .= ltrim($binding, '/');
215 215
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
     {
307 307
         $route = $this->languageInPath ? Str::sub(parent::getPathInfo(), Str::length($this->language) + 1) : parent::getPathInfo();
308 308
         if (!Str::startsWith('/', $route)) {
309
-            $route = '/' . $route;
309
+            $route = '/'.$route;
310 310
         }
311 311
         return $route;
312 312
     }
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
      */
473 473
     public function getFullUrl(): string
474 474
     {
475
-        return $this->getSchemeAndHttpHost() . $this->getRequestUri();
475
+        return $this->getSchemeAndHttpHost().$this->getRequestUri();
476 476
     }
477 477
 
478 478
     /**
Please login to merge, or discard this patch.
src/Traits/ModelValidator.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 use Ffcms\Core\Exception\SyntaxException;
9 9
 use Ffcms\Core\Helper\ModelFilters;
10 10
 use Ffcms\Core\Helper\Type\Any;
11
-use Ffcms\Core\Helper\Type\Obj;
12 11
 use Ffcms\Core\Helper\Type\Str;
13 12
 
14 13
 /**
Please login to merge, or discard this 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/Traits/ClassTools.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     {
18 18
         $hash = null;
19 19
         foreach ($this as $property => $value) {
20
-            $hash = md5($hash . $property . '=' . $value);
20
+            $hash = md5($hash.$property.'='.$value);
21 21
         }
22 22
         return $hash;
23 23
     }
Please login to merge, or discard this patch.
src/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/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/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/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/Helper/Type/Arr.php 1 patch
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.