Passed
Pull Request — master (#143)
by Arman
04:03
created
src/Libraries/Storage/Adapters/Local/LocalFileSystemAdapter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
     {
210 210
         $lines = file($filename, FILE_IGNORE_NEW_LINES);
211 211
 
212
-        if(!$lines) {
212
+        if (!$lines) {
213 213
             return [];
214 214
         }
215 215
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
      */
228 228
     public function fileName(string $path): string
229 229
     {
230
-        return (string)pathinfo($path, PATHINFO_FILENAME);
230
+        return (string) pathinfo($path, PATHINFO_FILENAME);
231 231
     }
232 232
 
233 233
     /**
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
      */
238 238
     public function extension(string $path): string
239 239
     {
240
-        return (string)pathinfo($path, PATHINFO_EXTENSION);
240
+        return (string) pathinfo($path, PATHINFO_EXTENSION);
241 241
     }
242 242
 
243 243
     /**
Please login to merge, or discard this patch.
src/Router/Router.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $this->findPatternMatches($uri);
101 101
 
102 102
         if (!count($this->matchedRoutes)) {
103
-            stop(function () {
103
+            stop(function() {
104 104
                 $this->handleNotFound();
105 105
             });
106 106
         }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     {
156 156
         $routeInfo = [];
157 157
 
158
-        array_walk($currentRoute, function ($value, $key) use (&$routeInfo) {
158
+        array_walk($currentRoute, function($value, $key) use (&$routeInfo) {
159 159
             $routeInfo[ucfirst($key)] = json_encode($value);
160 160
         });
161 161
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         $routePattern = '(\/)?';
200 200
         $routeParams = [];
201 201
 
202
-        $lastIndex = (int)array_key_last($routeSegments);
202
+        $lastIndex = (int) array_key_last($routeSegments);
203 203
 
204 204
         foreach ($routeSegments as $index => $segment) {
205 205
             $segmentParam = $this->checkSegment($segment, $index, $lastIndex);
Please login to merge, or discard this patch.
src/Libraries/Module/ModuleManager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use Quantum\Di\Di;
6 6
 use Quantum\Libraries\Storage\FileSystem;
7 7
 
8
-class ModuleManager{
8
+class ModuleManager {
9 9
 
10 10
     protected $fs;
11 11
     protected $optionEnabled;
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     private $modulePath;
17 17
     private $templatePath;
18 18
 
19
-    function __construct(string $moduleName, string $template, string $demo, $enabled){
19
+    function __construct(string $moduleName, string $template, string $demo, $enabled) {
20 20
         $this->moduleName = $moduleName;
21 21
 
22 22
         $this->template = $template;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $modules = require $modulesConfigPath;
46 46
 
47 47
         foreach ($modules['modules'] as $module => $options) {
48
-            if ($module == $this->moduleName  || $options['prefix'] == strtolower($this->moduleName)) {
48
+            if ($module == $this->moduleName || $options['prefix'] == strtolower($this->moduleName)) {
49 49
                 throw new \Exception("A module or prefix named '$this->moduleName' already exists");
50 50
             }
51 51
         }
Please login to merge, or discard this patch.
src/Libraries/Validation/Rules/General.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
         if (!empty($value)) {
83 83
             $captcha = CaptchaManager::getHandler();
84 84
 
85
-            if (!$captcha->verify($value)){
85
+            if (!$captcha->verify($value)) {
86 86
                 $this->addError($field, 'captcha', $param);
87 87
             }
88 88
         }
Please login to merge, or discard this patch.
src/Libraries/Captcha/Adapters/BaseCaptcha.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,8 +124,9 @@
 block discarded – undo
124 124
      */
125 125
     public function verify(string $code): bool
126 126
     {
127
-        if (is_null($this->secretKey))
128
-            throw new Exception('The secret key is not set');
127
+        if (is_null($this->secretKey)) {
128
+                    throw new Exception('The secret key is not set');
129
+        }
129 130
 
130 131
         if (empty($code)) {
131 132
             $this->errorCodes = ['internal-empty-response'];
Please login to merge, or discard this patch.