Passed
Push — main ( 3399b6...dd4eea )
by Dimitri
11:50
created
src/Middlewares/BodyParser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -152,19 +152,19 @@
 block discarded – undo
152 152
      */
153 153
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
154 154
     {
155
-        if (! in_array($request->getMethod(), $this->methods, true)) {
155
+        if (!in_array($request->getMethod(), $this->methods, true)) {
156 156
             return $handler->handle($request);
157 157
         }
158 158
 
159 159
         [$type] = explode(';', $request->getHeaderLine('Content-Type'));
160 160
         $type   = strtolower($type);
161
-        if (! isset($this->parsers[$type])) {
161
+        if (!isset($this->parsers[$type])) {
162 162
             return $handler->handle($request);
163 163
         }
164 164
 
165 165
         $parser = $this->parsers[$type];
166 166
         $result = $parser($request->getBody()->getContents());
167
-        if (! is_array($result)) {
167
+        if (!is_array($result)) {
168 168
             throw HttpException::badRequest();
169 169
         }
170 170
         $request = $request->withParsedBody($result);
Please login to merge, or discard this patch.
src/Middlewares/Cors.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         'AllowMethods'     => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],
29 29
         'AllowHeaders'     => true,
30 30
         'ExposeHeaders'    => false,
31
-        'MaxAge'           => 86400,                                       // 1 day
31
+        'MaxAge'           => 86400, // 1 day
32 32
     ];
33 33
 
34 34
     /**
Please login to merge, or discard this patch.
src/Loader/DotEnv.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             }
87 87
         }
88 88
 
89
-        if (! count($data)) {
89
+        if (!count($data)) {
90 90
             return false;
91 91
         }
92 92
 
@@ -118,18 +118,18 @@  discard block
 block discarded – undo
118 118
     public function parse(): ?array
119 119
     {
120 120
         // Nous ne voulons pas imposer la présence d'un fichier .env, ils devraient être facultatifs.
121
-        if (! is_file($this->path)) {
121
+        if (!is_file($this->path)) {
122 122
             return null;
123 123
         }
124 124
 
125 125
         // Assurez-vous que le fichier est lisible
126
-        if (! is_readable($this->path)) {
126
+        if (!is_readable($this->path)) {
127 127
             throw new InvalidArgumentException("The .env file is not readable: {$this->path}");
128 128
         }
129 129
 
130 130
         $vars = [];
131 131
 
132
-        $lines = file($this->path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
132
+        $lines = file($this->path, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
133 133
 
134 134
         foreach ($lines as $line) {
135 135
             // C'est un commentaire?
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     protected function setVariable(string $name, string $value = '')
156 156
     {
157
-        if (! getenv($name, true)) {
157
+        if (!getenv($name, true)) {
158 158
             putenv("{$name}={$value}");
159 159
         }
160 160
         if (empty($_ENV[$name])) {
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      */
204 204
     protected function sanitizeValue(string $value): string
205 205
     {
206
-        if (! $value) {
206
+        if (!$value) {
207 207
             return $value;
208 208
         }
209 209
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 
260 260
             $value = preg_replace_callback(
261 261
                 '/\${([a-zA-Z0-9_]+)}/',
262
-                static function ($matchedPatterns) use ($loader) {
262
+                static function($matchedPatterns) use ($loader) {
263 263
                     $nestedVariable = $loader->getVariable($matchedPatterns[1]);
264 264
 
265 265
                     if (null === $nestedVariable) {
Please login to merge, or discard this patch.
src/Controllers/RestController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $this->config = (object) config('rest');
73 73
 
74 74
         $locale       = $this->config->language ?? null;
75
-        $this->locale = ! empty($locale) ? $locale : $this->request->getLocale();
75
+        $this->locale = !empty($locale) ? $locale : $this->request->getLocale();
76 76
     }
77 77
 
78 78
     public function _remap(string $method, array $params = [])
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $class = static::class;
81 81
 
82 82
         // Bien sûr qu'il existe, mais peuvent-ils en faire quelque chose ?
83
-        if (! method_exists($class, $method)) {
83
+        if (!method_exists($class, $method)) {
84 84
             return $this->respondNotImplemented($this->_translate('notImplemented', [$class, $method]));
85 85
         }
86 86
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
             return $this->respondOk($response);
109 109
         } catch (Throwable $ex) {
110
-            if (! on_dev()) {
110
+            if (!on_dev()) {
111 111
                 $url = explode('?', $this->request->getRequestTarget())[0];
112 112
 
113 113
                 return $this->respondBadRequest($this->_translate('badUsed', [$url]));
@@ -156,18 +156,18 @@  discard block
 block discarded – undo
156 156
     final protected function respondFail(?string $message = "Une erreur s'est produite", ?int $status = StatusCode::INTERNAL_ERROR, int|string|null $code = null, array $errors = [])
157 157
     {
158 158
         $message = $message ?: "Une erreur s'est produite";
159
-        $code    = ! empty($code) ? $code : $status;
159
+        $code    = !empty($code) ? $code : $status;
160 160
 
161 161
         $response = [
162 162
             $this->config->field['message'] ?? 'message' => $message,
163 163
         ];
164
-        if (! empty($this->config->field['status'])) {
164
+        if (!empty($this->config->field['status'])) {
165 165
             $response[$this->config->field['status']] = false;
166 166
         }
167
-        if (! empty($this->config->field['code'])) {
167
+        if (!empty($this->config->field['code'])) {
168 168
             $response[$this->config->field['code']] = $code;
169 169
         }
170
-        if (! empty($errors)) {
170
+        if (!empty($errors)) {
171 171
             $response[$this->config->field['errors'] ?? 'errors'] = $errors;
172 172
         }
173 173
 
@@ -188,12 +188,12 @@  discard block
 block discarded – undo
188 188
     final protected function respondSuccess(?string $message = 'Resultat', $result = null, ?int $status = StatusCode::OK)
189 189
     {
190 190
         $message = $message ?: 'Resultat';
191
-        $status  = ! empty($status) ? $status : StatusCode::OK;
191
+        $status  = !empty($status) ? $status : StatusCode::OK;
192 192
 
193 193
         $response = [
194 194
             $this->config->field['message'] ?? 'message' => $message,
195 195
         ];
196
-        if (! empty($this->config->field['status'])) {
196
+        if (!empty($this->config->field['status'])) {
197 197
             $response[$this->config->field['status']] = true;
198 198
         }
199 199
         if (is_array($result)) {
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
      */
306 306
     final protected function allowedMethods(string ...$methods): self
307 307
     {
308
-        if (! empty($methods)) {
308
+        if (!empty($methods)) {
309 309
             $this->config->allowed_methods = array_map(static fn ($str) => strtoupper($str), $methods);
310 310
         }
311 311
 
@@ -403,13 +403,13 @@  discard block
 block discarded – undo
403 403
         }
404 404
 
405 405
         // Si la méthode de format existe, appelle et renvoie la sortie dans ce format
406
-        if (! empty($mime)) {
406
+        if (!empty($mime)) {
407 407
             $output = Formatter::type($mime)->format($data);
408 408
 
409 409
             // Définit l'en-tête du format
410 410
             // Ensuite, vérifiez si le client a demandé un rappel, et si la sortie contient ce rappel :
411 411
             $callback = $this->request->getQuery('callback');
412
-            if (! empty($callback) && $mime === $this->mimes['json'] && preg_match('/^' . $callback . '/', $output)) {
412
+            if (!empty($callback) && $mime === $this->mimes['json'] && preg_match('/^' . $callback . '/', $output)) {
413 413
                 $this->response = $this->response->withType($this->mimes['jsonp']);
414 414
             } else {
415 415
                 $this->response = $this->response->withType($mime === $this->mimes['array'] ? $this->mimes['json'] : $mime);
@@ -465,22 +465,22 @@  discard block
 block discarded – undo
465 465
     private function checkProcess(): bool|ResponseInterface
466 466
     {
467 467
         // Verifie si la requete est en ajax
468
-        if (! $this->request->is('ajax') && $this->config->ajax_only) {
468
+        if (!$this->request->is('ajax') && $this->config->ajax_only) {
469 469
             return $this->respondNotAcceptable($this->_translate('ajaxOnly'));
470 470
         }
471 471
 
472 472
         // Verifie si la requete est en https
473
-        if (! $this->request->is('https') && $this->config->force_https) {
473
+        if (!$this->request->is('https') && $this->config->force_https) {
474 474
             return $this->respondForbidden($this->_translate('unsupported'));
475 475
         }
476 476
 
477 477
         // Verifie si la methode utilisee pour la requete est autorisee
478
-        if (! in_array(strtoupper($this->request->getMethod()), $this->config->allowed_methods, true)) {
478
+        if (!in_array(strtoupper($this->request->getMethod()), $this->config->allowed_methods, true)) {
479 479
             return $this->respondNotAcceptable($this->_translate('unknownMethod'));
480 480
         }
481 481
 
482 482
         // Verifie que l'ip qui emet la requete n'est pas dans la blacklist
483
-        if (! empty($this->config->ip_blacklis)) {
483
+        if (!empty($this->config->ip_blacklis)) {
484 484
             $this->config->ip_blacklist = implode(',', $this->config->ip_blacklist);
485 485
 
486 486
             // Correspond à une adresse IP dans une liste noire, par ex. 127.0.0.0, 0.0.0.0
@@ -493,20 +493,20 @@  discard block
 block discarded – undo
493 493
         }
494 494
 
495 495
         // Verifie que l'ip qui emet la requete est dans la whitelist
496
-        if (! empty($this->config->ip_whitelist)) {
496
+        if (!empty($this->config->ip_whitelist)) {
497 497
             $whitelist = $this->config->ip_whitelist;
498 498
             array_push($whitelist, '127.0.0.1', '0.0.0.0');
499 499
 
500 500
             // coupez les espaces de début et de fin des ip
501 501
             $whitelist = array_map('trim', $whitelist);
502 502
 
503
-            if (! in_array($this->request->clientIp(), $whitelist, true)) {
503
+            if (!in_array($this->request->clientIp(), $whitelist, true)) {
504 504
                 return $this->respondUnauthorized($this->_translate('ipUnauthorized'));
505 505
             }
506 506
         }
507 507
 
508 508
         // Verifie l'authentification du client
509
-        if (false !== $this->config->auth && ! $this->request->is('options')) {
509
+        if (false !== $this->config->auth && !$this->request->is('options')) {
510 510
             if ('bearer' === strtolower($this->config->auth)) {
511 511
                 $token = $this->getBearerToken();
512 512
                 if (empty($token)) {
Please login to merge, or discard this patch.
src/Initializer/kint.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 Kint::$display_called_from = $config->display_called_from;
20 20
 Kint::$expanded            = $config->expanded;
21 21
 
22
-if (! empty($config->plugins)) {
22
+if (!empty($config->plugins)) {
23 23
     Kint::$plugins = $config->plugins;
24 24
 }
25 25
 
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 RichRenderer::$folder = $config->rich_folder;
28 28
 RichRenderer::$sort   = $config->rich_sort;
29 29
 
30
-if (! empty($config->rich_value_plugins)) {
30
+if (!empty($config->rich_value_plugins)) {
31 31
     RichRenderer::$value_plugins = $config->rich_value_plugins;
32 32
 }
33
-if (! empty($config->rich_tab_plugins)) {
33
+if (!empty($config->rich_tab_plugins)) {
34 34
     RichRenderer::$tab_plugins = $config->rich_tab_plugins;
35 35
 }
36 36
 
Please login to merge, or discard this patch.
src/Http/ServerRequest.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         $this->cookies = $config['cookies'];
258 258
 
259 259
         if (isset($config['uri'])) {
260
-            if (! $config['uri'] instanceof UriInterface) {
260
+            if (!$config['uri'] instanceof UriInterface) {
261 261
                 throw new FrameworkException('The `uri` key must be an instance of ' . UriInterface::class);
262 262
             }
263 263
             $uri = $config['uri'];
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
         $ref = $this->getEnv('HTTP_REFERER');
398 398
 
399 399
         $base = /* Configure::read('App.fullBaseUrl') . */ $this->webroot;
400
-        if (! empty($ref) && ! empty($base)) {
400
+        if (!empty($ref) && !empty($base)) {
401 401
             if ($local && strpos($ref, $base) === 0) {
402 402
                 $ref = substr($ref, strlen($base));
403 403
                 if ($ref === '' || strpos($ref, '//') === 0) {
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 
410 410
                 return $ref;
411 411
             }
412
-            if (! $local) {
412
+            if (!$local) {
413 413
                 return $ref;
414 414
             }
415 415
         }
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         }
462 462
 
463 463
         $type = strtolower($type);
464
-        if (! isset(static::$_detectors[$type])) {
464
+        if (!isset(static::$_detectors[$type])) {
465 465
             return false;
466 466
         }
467 467
         if ($args) {
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
         foreach ($detect['header'] as $header => $value) {
541 541
             $header = $this->getEnv('http_' . $header);
542 542
             if ($header !== null) {
543
-                if (! is_string($value) && ! is_bool($value) && is_callable($value)) {
543
+                if (!is_string($value) && !is_bool($value) && is_callable($value)) {
544 544
                     return $value($header);
545 545
                 }
546 546
 
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
     public function isAll(array $types): bool
614 614
     {
615 615
         foreach ($types as $type) {
616
-            if (! $this->is($type)) {
616
+            if (!$this->is($type)) {
617 617
                 return false;
618 618
             }
619 619
         }
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
     protected function normalizeHeaderName(string $name): string
717 717
     {
718 718
         $name = str_replace('-', '_', strtoupper($name));
719
-        if (! in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) {
719
+        if (!in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) {
720 720
             $name = 'HTTP_' . $name;
721 721
         }
722 722
 
@@ -899,8 +899,8 @@  discard block
 block discarded – undo
899 899
         $new = clone $this;
900 900
 
901 901
         if (
902
-            ! is_string($method)
903
-            || ! preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)
902
+            !is_string($method)
903
+            || !preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)
904 904
         ) {
905 905
             throw new InvalidArgumentException(sprintf(
906 906
                 'Unsupported HTTP method "%s" provided',
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
                 }
1145 1145
             }
1146 1146
 
1147
-            if (! isset($accept[$prefValue])) {
1147
+            if (!isset($accept[$prefValue])) {
1148 1148
                 $accept[$prefValue] = [];
1149 1149
             }
1150 1150
             if ($prefValue) {
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
         if ($name === null) {
1223 1223
             return $this->data;
1224 1224
         }
1225
-        if (! is_array($this->data) && $name) {
1225
+        if (!is_array($this->data) && $name) {
1226 1226
             return $default;
1227 1227
         }
1228 1228
 
@@ -1363,7 +1363,7 @@  discard block
 block discarded – undo
1363 1363
      */
1364 1364
     public function withProtocolVersion($version): self
1365 1365
     {
1366
-        if (! preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) {
1366
+        if (!preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) {
1367 1367
             throw new InvalidArgumentException("Unsupported protocol version '{$version}' provided");
1368 1368
         }
1369 1369
         $new           = clone $this;
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
     public function getEnv(string $key, ?string $default = null): ?string
1386 1386
     {
1387 1387
         $key = strtoupper($key);
1388
-        if (! array_key_exists($key, $this->_environment)) {
1388
+        if (!array_key_exists($key, $this->_environment)) {
1389 1389
             $this->_environment[$key] = env($key);
1390 1390
         }
1391 1391
 
@@ -1597,7 +1597,7 @@  discard block
 block discarded – undo
1597 1597
         $file = Arr::get($this->uploadedFiles, $path);
1598 1598
         if (is_array($file)) {
1599 1599
             foreach ($file as $f) {
1600
-                if (! ($f instanceof UploadedFile)) {
1600
+                if (!($f instanceof UploadedFile)) {
1601 1601
                     return null;
1602 1602
                 }
1603 1603
             }
@@ -1605,7 +1605,7 @@  discard block
 block discarded – undo
1605 1605
             return $file;
1606 1606
         }
1607 1607
 
1608
-        if (! ($file instanceof UploadedFileInterface)) {
1608
+        if (!($file instanceof UploadedFileInterface)) {
1609 1609
             return null;
1610 1610
         }
1611 1611
 
@@ -1653,7 +1653,7 @@  discard block
 block discarded – undo
1653 1653
                 continue;
1654 1654
             }
1655 1655
 
1656
-            if (! $file instanceof UploadedFileInterface) {
1656
+            if (!$file instanceof UploadedFileInterface) {
1657 1657
                 throw new InvalidArgumentException("Invalid file at '{$path}{$key}'");
1658 1658
             }
1659 1659
         }
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
         }
1705 1705
 
1706 1706
         $host = $uri->getHost();
1707
-        if (! $host) {
1707
+        if (!$host) {
1708 1708
             return $new;
1709 1709
         }
1710 1710
         $port = $uri->getPort();
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
         $validLocales = config('app.supported_locales');
1813 1813
         // S'il ne s'agit pas d'un paramètre régional valide, définissez-le
1814 1814
         // aux paramètres régionaux par défaut du site.
1815
-        if (! in_array($locale, $validLocales, true)) {
1815
+        if (!in_array($locale, $validLocales, true)) {
1816 1816
             $locale = config('app.language');
1817 1817
         }
1818 1818
 
@@ -1912,7 +1912,7 @@  discard block
 block discarded – undo
1912 1912
             $override = true;
1913 1913
         }
1914 1914
 
1915
-        if ($override && ! in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) {
1915
+        if ($override && !in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) {
1916 1916
             $data = [];
1917 1917
         }
1918 1918
 
@@ -1961,7 +1961,7 @@  discard block
 block discarded – undo
1961 1961
      */
1962 1962
     protected function _processFiles(array $post, array $files): array
1963 1963
     {
1964
-        if (! is_array($files)) {
1964
+        if (!is_array($files)) {
1965 1965
             return $post;
1966 1966
         }
1967 1967
 
Please login to merge, or discard this patch.
src/Helpers/date.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  *
17 17
  * @credit	<a href="https://codeigniter.com">CodeIgniter 4.2 - date_helper</a>
18 18
  */
19
-if (! function_exists('now')) {
19
+if (!function_exists('now')) {
20 20
     /**
21 21
      * Get "now" time
22 22
      *
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     }
54 54
 }
55 55
 
56
-if (! function_exists('timezone_select')) {
56
+if (!function_exists('timezone_select')) {
57 57
     /**
58 58
      * Generates a select field of all available timezones
59 59
      *
Please login to merge, or discard this patch.
src/Helpers/number.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  *
15 15
  * @credit	<a href="https://codeigniter.com">CodeIgniter 4.2 - number_helper</a>
16 16
  */
17
-if (! function_exists('number_to_size')) {
17
+if (!function_exists('number_to_size')) {
18 18
     /**
19 19
      * Formats a numbers as bytes, based on size, and adds the appropriate suffix
20 20
      *
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
         // ignore sub part
36 36
         $generalLocale = $locale;
37
-        if (! empty($locale) && ($underscorePos = strpos($locale, '_'))) {
37
+        if (!empty($locale) && ($underscorePos = strpos($locale, '_'))) {
38 38
             $generalLocale = substr($locale, 0, $underscorePos);
39 39
         }
40 40
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     }
59 59
 }
60 60
 
61
-if (! function_exists('number_to_amount')) {
61
+if (!function_exists('number_to_amount')) {
62 62
     /**
63 63
      * Converts numbers to a more readable representation
64 64
      * when dealing with very large numbers (in the thousands or above),
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
         // ignore sub part
89 89
         $generalLocale = $locale;
90
-        if (! empty($locale) && ($underscorePos = strpos($locale, '_'))) {
90
+        if (!empty($locale) && ($underscorePos = strpos($locale, '_'))) {
91 91
             $generalLocale = substr($locale, 0, $underscorePos);
92 92
         }
93 93
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     }
113 113
 }
114 114
 
115
-if (! function_exists('number_to_currency')) {
115
+if (!function_exists('number_to_currency')) {
116 116
     function number_to_currency(float $num, string $currency, ?string $locale = null, int $fraction = 0): string
117 117
     {
118 118
         return format_number($num, 1, $locale, [
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     }
124 124
 }
125 125
 
126
-if (! function_exists('format_number')) {
126
+if (!function_exists('format_number')) {
127 127
     /**
128 128
      * A general purpose, locale-aware, number_format method.
129 129
      * Used by all of the functions of the number_helper.
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     }
173 173
 }
174 174
 
175
-if (! function_exists('number_to_roman')) {
175
+if (!function_exists('number_to_roman')) {
176 176
     /**
177 177
      * Convert a number to a roman numeral.
178 178
      *
Please login to merge, or discard this patch.
src/Helpers/assets.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * the LICENSE file that was distributed with this source code.
10 10
  */
11 11
 
12
-if (! function_exists('css_url')) {
12
+if (!function_exists('css_url')) {
13 13
     /**
14 14
      * CSS URL
15 15
      *
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
         $name = str_replace(site_url() . 'css/', '', htmlspecialchars($name));
24 24
 
25 25
         if (is_localfile($name)) {
26
-            $name .= (! preg_match('#\.css$#i', $name) ? '.css' : '');
26
+            $name .= (!preg_match('#\.css$#i', $name) ? '.css' : '');
27 27
             $filename = WEBROOT . 'css' . DS . $name;
28 28
 
29 29
             return site_url() . 'css/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : '');
30 30
         }
31 31
 
32
-        return $name . (! preg_match('#\.css$#i', $name) ? '.css' : '');
32
+        return $name . (!preg_match('#\.css$#i', $name) ? '.css' : '');
33 33
     }
34 34
 }
35 35
 
36
-if (! function_exists('js_url')) {
36
+if (!function_exists('js_url')) {
37 37
     /**
38 38
      * JS URL
39 39
      *
@@ -47,17 +47,17 @@  discard block
 block discarded – undo
47 47
         $name = str_replace(site_url() . 'js/', '', htmlspecialchars($name));
48 48
 
49 49
         if (is_localfile($name)) {
50
-            $name .= (! preg_match('#\.js$#i', $name) ? '.js' : '');
50
+            $name .= (!preg_match('#\.js$#i', $name) ? '.js' : '');
51 51
             $filename = WEBROOT . 'js' . DS . $name;
52 52
 
53 53
             return site_url() . 'js/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : '');
54 54
         }
55 55
 
56
-        return $name . (! preg_match('#\.js$#i', $name) ? '.js' : '');
56
+        return $name . (!preg_match('#\.js$#i', $name) ? '.js' : '');
57 57
     }
58 58
 }
59 59
 
60
-if (! function_exists('lib_css_url')) {
60
+if (!function_exists('lib_css_url')) {
61 61
     /**
62 62
      * LIB CSS URL
63 63
      *
@@ -71,17 +71,17 @@  discard block
 block discarded – undo
71 71
         $name = str_replace(site_url() . 'lib/', '', htmlspecialchars($name));
72 72
 
73 73
         if (is_localfile($name)) {
74
-            $name .= (! preg_match('#\.css$#i', $name) ? '.css' : '');
74
+            $name .= (!preg_match('#\.css$#i', $name) ? '.css' : '');
75 75
             $filename = WEBROOT . 'lib' . DS . $name;
76 76
 
77 77
             return site_url() . 'lib/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : '');
78 78
         }
79 79
 
80
-        return $name . (! preg_match('#\.css$#i', $name) ? '.css' : '');
80
+        return $name . (!preg_match('#\.css$#i', $name) ? '.css' : '');
81 81
     }
82 82
 }
83 83
 
84
-if (! function_exists('lib_js_url')) {
84
+if (!function_exists('lib_js_url')) {
85 85
     /**
86 86
      * LIB JS URL
87 87
      *
@@ -95,17 +95,17 @@  discard block
 block discarded – undo
95 95
         $name = str_replace(site_url() . 'lib/', '', htmlspecialchars($name));
96 96
 
97 97
         if (is_localfile($name)) {
98
-            $name .= (! preg_match('#\.js$#i', $name) ? '.js' : '');
98
+            $name .= (!preg_match('#\.js$#i', $name) ? '.js' : '');
99 99
             $filename = WEBROOT . 'lib' . DS . $name;
100 100
 
101 101
             return site_url() . 'lib/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : '');
102 102
         }
103 103
 
104
-        return $name . (! preg_match('#\.js$#i', $name) ? '.js' : '');
104
+        return $name . (!preg_match('#\.js$#i', $name) ? '.js' : '');
105 105
     }
106 106
 }
107 107
 
108
-if (! function_exists('lib_styles')) {
108
+if (!function_exists('lib_styles')) {
109 109
     /**
110 110
      * LIB_STYLES
111 111
      *
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
         foreach ($name as $style) {
125 125
             if (is_string($style)) {
126
-                $style = (! preg_match('#\.css$#i', $style) ? $style . '.css' : $style);
126
+                $style = (!preg_match('#\.css$#i', $style) ? $style . '.css' : $style);
127 127
                 if (is_file(WEBROOT . 'lib' . DS . str_replace('/', DS, $style))) {
128 128
                     $return[] = '<link rel="preload" type="text/css" href="' . lib_css_url($style) . '" as="style">
129 129
 						<link rel="stylesheet" type="text/css" href="' . lib_css_url($style) . '" />';
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     }
148 148
 }
149 149
 
150
-if (! function_exists('lib_scripts')) {
150
+if (!function_exists('lib_scripts')) {
151 151
     /**
152 152
      * LIB_SCRIPTS
153 153
      *
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 
166 166
         foreach ($name as $script) {
167 167
             if (is_string($script)) {
168
-                $script = (! preg_match('#\.js$#i', $script) ? $script . '.js' : $script);
168
+                $script = (!preg_match('#\.js$#i', $script) ? $script . '.js' : $script);
169 169
                 if (is_file(WEBROOT . 'lib' . DS . str_replace('/', DS, $script))) {
170 170
                     $return[] = '<script type="text/javascript" src="' . lib_js_url($script) . '"></script>';
171 171
                 } elseif (is_localfile($script)) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     }
188 188
 }
189 189
 
190
-if (! function_exists('styles')) {
190
+if (!function_exists('styles')) {
191 191
     /**
192 192
      * STYLES
193 193
      *
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
         foreach ($name as $style) {
207 207
             if (is_string($style)) {
208
-                $style = (! preg_match('#\.css$#i', $style) ? $style . '.css' : $style);
208
+                $style = (!preg_match('#\.css$#i', $style) ? $style . '.css' : $style);
209 209
                 if (is_file(WEBROOT . 'css' . DS . str_replace('/', DS, $style))) {
210 210
                     $return[] = '<link rel="preload" type="text/css" href="' . css_url($style) . '" as="style">
211 211
 						<link rel="stylesheet" type="text/css" href="' . css_url($style) . '" />';
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     }
230 230
 }
231 231
 
232
-if (! function_exists('scripts')) {
232
+if (!function_exists('scripts')) {
233 233
     /**
234 234
      * SCRIPTS
235 235
      *
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 
248 248
         foreach ($name as $script) {
249 249
             if (is_string($script)) {
250
-                $script = (! preg_match('#\.js$#i', $script) ? $script . '.js' : $script);
250
+                $script = (!preg_match('#\.js$#i', $script) ? $script . '.js' : $script);
251 251
                 if (is_file(WEBROOT . 'js' . DS . str_replace('/', DS, $script))) {
252 252
                     $return[] = '<script type="text/javascript" src="' . js_url($script) . '"></script>';
253 253
                 } elseif (is_localfile($script)) {
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
     }
270 270
 }
271 271
 
272
-if (! function_exists('less_url')) {
272
+if (!function_exists('less_url')) {
273 273
     /**
274 274
      * LESS URL
275 275
      *
@@ -283,17 +283,17 @@  discard block
 block discarded – undo
283 283
         $name = str_replace(site_url() . 'less/', '', htmlspecialchars($name));
284 284
 
285 285
         if (is_localfile($name)) {
286
-            $name .= (! preg_match('#\.less$#i', $name) ? '.less' : '');
286
+            $name .= (!preg_match('#\.less$#i', $name) ? '.less' : '');
287 287
             $filename = WEBROOT . 'less' . DS . $name;
288 288
 
289 289
             return site_url() . 'less/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : '');
290 290
         }
291 291
 
292
-        return $name . (! preg_match('#\.less$#i', $name) ? '.less' : '');
292
+        return $name . (!preg_match('#\.less$#i', $name) ? '.less' : '');
293 293
     }
294 294
 }
295 295
 
296
-if (! function_exists('less_styles')) {
296
+if (!function_exists('less_styles')) {
297 297
     /**
298 298
      * LESS_STYLES
299 299
      *
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 
312 312
         foreach ($name as $style) {
313 313
             if (is_string($style)) {
314
-                $style = (! preg_match('#\.less$#i', $style) ? $style . '.less' : $style);
314
+                $style = (!preg_match('#\.less$#i', $style) ? $style . '.less' : $style);
315 315
                 if (is_file(WEBROOT . 'less' . DS . str_replace('/', DS, $style))) {
316 316
                     $return[] = '<link rel="stylesheet" type="text/less" href="' . less_url($style) . '" />';
317 317
                 } elseif (is_localfile($style)) {
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
     }
334 334
 }
335 335
 
336
-if (! function_exists('img_url')) {
336
+if (!function_exists('img_url')) {
337 337
     /**
338 338
      * IMG URL
339 339
      *
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
     }
361 361
 }
362 362
 
363
-if (! function_exists('img')) {
363
+if (!function_exists('img')) {
364 364
     /**
365 365
      * IMG
366 366
      *
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     }
392 392
 }
393 393
 
394
-if (! function_exists('docs_url')) {
394
+if (!function_exists('docs_url')) {
395 395
     /**
396 396
      * DOCS URL
397 397
      *
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
     }
419 419
 }
420 420
 
421
-if (! function_exists('videos_url')) {
421
+if (!function_exists('videos_url')) {
422 422
     /**
423 423
      * VIDEOS URL
424 424
      *
Please login to merge, or discard this patch.