Passed
Pull Request — master (#141)
by Arman
04:08
created
src/Libraries/Mailer/Adapters/SmtpAdapter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         if (config()->get('debug')) {
85 85
             $this->mailer->SMTPDebug = SMTP::DEBUG_SERVER;
86 86
 
87
-            $this->mailer->Debugoutput = function ($message) {
87
+            $this->mailer->Debugoutput = function($message) {
88 88
                 $this->updateDebugBar($message);
89 89
             };
90 90
         }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      */
187 187
     public function setAttachment(string $attachment): SmtpAdapter
188 188
     {
189
-        $this->attachments[] = $attachment;;
189
+        $this->attachments[] = $attachment; ;
190 190
         return $this;
191 191
     }
192 192
 
Please login to merge, or discard this patch.
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/Libraries/Validation/Rules/General.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
     {
73 73
         if (!empty($value)) {
74 74
             $captcha = CaptchaManager::getCaptcha();
75
-            if (!$captcha->verifyResponse($value)){
75
+            if (!$captcha->verifyResponse($value)) {
76 76
                 $this->addError($field, 'captcha', $param);
77 77
             }
78 78
         }
Please login to merge, or discard this patch.
src/Libraries/Captcha/Adapters/RecaptchaAdapter.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,8 +150,9 @@
 block discarded – undo
150 150
      */
151 151
     public function verifyResponse(string $response, $clientIp = null): bool
152 152
     {
153
-        if (is_null($this->secretkey))
154
-            throw new \Exception('You must set your secret key');
153
+        if (is_null($this->secretkey)) {
154
+                    throw new \Exception('You must set your secret key');
155
+        }
155 156
 
156 157
         if (empty($response)) {
157 158
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function renderJs(): string
100 100
     {
101
-        return '<script src="'. self::CLIENT_API .'"></script>';
101
+        return '<script src="' . self::CLIENT_API . '"></script>';
102 102
     }
103 103
 
104 104
     /**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     public function display(string $formIdentifier = '', array $attributes = []): string
112 112
     {
113 113
         $captchaElement = '';
114
-        if (strtolower($this->type) == 'visible'){
114
+        if (strtolower($this->type) == 'visible') {
115 115
             $captchaElement = $this->getVisibleElement();
116 116
         } elseif (strtolower($this->type) == 'invisible') {
117 117
             $captchaElement = $this->getInvisibleElement($formIdentifier);
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         $url = self::VERIFY_URL . '?' . http_build_query($query);
147 147
 
148 148
         $this->http->createRequest($url)->setMethod('GET')->start();
149
-        $response = (array)$this->http->getResponseBody();
149
+        $response = (array) $this->http->getResponseBody();
150 150
 
151 151
         if (empty($response) || is_null($response) || !$response) {
152 152
             return false;
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                  })
246 246
                 
247 247
                 function onSubmit (){
248
-                    document.getElementById("'. $formIdentifier .'").submit();
248
+                    document.getElementById("'. $formIdentifier . '").submit();
249 249
                 }
250 250
             </script>';
251 251
     }
Please login to merge, or discard this patch.
src/Libraries/Captcha/Adapters/HcaptchaAdapter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     public function display(string $formIdentifier = '', array $attributes = []): string
91 91
     {
92 92
         $captchaElement = '';
93
-        if (strtolower($this->type) == 'visible'){
93
+        if (strtolower($this->type) == 'visible') {
94 94
             $captchaElement = $this->getVisibleElement($attributes);
95 95
         } elseif (strtolower($this->type) == 'invisible') {
96 96
             $captchaElement = $this->getInvisibleElement($formIdentifier);
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public function renderJs(): string
107 107
     {
108
-        return '<script src="'. static::CLIENT_API .'" async defer></script>' . "\n";
108
+        return '<script src="' . static::CLIENT_API . '" async defer></script>' . "\n";
109 109
     }
110 110
 
111 111
     /**
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public function getErrorCodes(): array
155 155
     {
156
-        if (!empty($this->errorCodes)){
156
+        if (!empty($this->errorCodes)) {
157 157
             return $this->errorCodes;
158 158
         }
159 159
         return [];
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     {
171 171
         $this->http->createRequest(static::VERIFY_URL)->setMethod('POST')->setData($query)->start();
172 172
 
173
-        return (array)$this->http->getResponseBody();
173
+        return (array) $this->http->getResponseBody();
174 174
     }
175 175
 
176 176
     /**
@@ -218,12 +218,12 @@  discard block
 block discarded – undo
218 218
                         let button = document.getElementsByTagName("button");
219 219
                     
220 220
                         button[0].setAttribute("data-sitekey", "' . $this->sitekey . '");
221
-                        button[0].setAttribute("data-callback", "'. $functionName .'");
221
+                        button[0].setAttribute("data-callback", "'. $functionName . '");
222 222
                         button[0].classList.add("h-captcha");
223 223
                      })
224 224
                     
225
-                    function '. $functionName .'(){
226
-                        document.getElementById("'. $formIdentifier .'").submit();
225
+                    function '. $functionName . '(){
226
+                        document.getElementById("'. $formIdentifier . '").submit();
227 227
                     }
228 228
                 </script>';
229 229
     }
Please login to merge, or discard this patch.
src/Libraries/Captcha/CaptchaManager.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 
29 29
         if (!in_array($captchaAdapter, self::ADAPTERS) && !is_null($captchaAdapter)) {
30 30
             throw CaptchaException::unsupportedAdapter($captchaAdapter);
31
-        }elseif (is_null($captchaAdapter)){
31
+        }elseif (is_null($captchaAdapter)) {
32 32
             throw new \Exception('');
33 33
         }
34 34
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 
29 29
         if (!in_array($captchaAdapter, self::ADAPTERS) && !is_null($captchaAdapter)) {
30 30
             throw CaptchaException::unsupportedAdapter($captchaAdapter);
31
-        }elseif (is_null($captchaAdapter)){
31
+        } elseif (is_null($captchaAdapter)){
32 32
             throw new \Exception('');
33 33
         }
34 34
 
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.