@@ -69,7 +69,7 @@ |
||
69 | 69 | { |
70 | 70 | $this->invalidate(); |
71 | 71 | |
72 | - if ($overwrite || ! isset($this->configSchemas[$key])) { |
|
72 | + if ($overwrite || !isset($this->configSchemas[$key])) { |
|
73 | 73 | $this->configSchemas[$key] = $schema; |
74 | 74 | } |
75 | 75 | } |
@@ -81,18 +81,18 @@ discard block |
||
81 | 81 | public function parse(): ?array |
82 | 82 | { |
83 | 83 | // Nous ne voulons pas imposer la présence d'un fichier .env, ils devraient être facultatifs. |
84 | - if (! is_file($this->path)) { |
|
84 | + if (!is_file($this->path)) { |
|
85 | 85 | return null; |
86 | 86 | } |
87 | 87 | |
88 | 88 | // Assurez-vous que le fichier est lisible |
89 | - if (! is_readable($this->path)) { |
|
89 | + if (!is_readable($this->path)) { |
|
90 | 90 | throw new InvalidArgumentException("The .env file is not readable: {$this->path}"); |
91 | 91 | } |
92 | 92 | |
93 | 93 | $vars = []; |
94 | 94 | |
95 | - $lines = file($this->path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|
95 | + $lines = file($this->path, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); |
|
96 | 96 | |
97 | 97 | foreach ($lines as $line) { |
98 | 98 | // C'est un commentaire? |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | protected function setVariable(string $name, string $value = '') |
119 | 119 | { |
120 | - if (! getenv($name, true)) { |
|
120 | + if (!getenv($name, true)) { |
|
121 | 121 | putenv("{$name}={$value}"); |
122 | 122 | } |
123 | 123 | if (empty($_ENV[$name])) { |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | */ |
167 | 167 | protected function sanitizeValue(string $value): string |
168 | 168 | { |
169 | - if (! $value) { |
|
169 | + if (!$value) { |
|
170 | 170 | return $value; |
171 | 171 | } |
172 | 172 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | |
223 | 223 | $value = preg_replace_callback( |
224 | 224 | '/\${([a-zA-Z0-9_]+)}/', |
225 | - static function ($matchedPatterns) use ($loader) { |
|
225 | + static function($matchedPatterns) use ($loader) { |
|
226 | 226 | $nestedVariable = $loader->getVariable($matchedPatterns[1]); |
227 | 227 | |
228 | 228 | if (null === $nestedVariable) { |
@@ -25,34 +25,34 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public const CHECKPOINT = 103; |
27 | 27 | |
28 | - public const THIS_IS_FIND = 218; // Apache Web Server |
|
29 | - public const PAGE_EXPIRED = 419; // Laravel Framework |
|
30 | - public const METHOD_FAILURE = 420; // Spring Framework |
|
31 | - public const ENHANCE_YOUR_CALM = 420; // Twitter |
|
32 | - public const LOGIN_TIMEOUT = 440; // IIS |
|
33 | - public const NO_RESPONSE = 444; // Nginx |
|
34 | - public const RETRY_WITH = 449; // IIS |
|
35 | - public const BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS = 450; // Microsoft |
|
36 | - public const REDIRECT = 451; // IIS |
|
37 | - public const REQUEST_HEADER_TOO_LARGE = 494; // Nginx |
|
38 | - public const SSL_CERTIFICATE_ERROR = 495; // Nginx |
|
39 | - public const SSL_CERTIFICATE_REQUIRED = 496; // Nginx |
|
40 | - public const HTTP_REQUEST_SENT_TO_HTTPS_PORT = 497; // Nginx |
|
41 | - public const INVALID_TOKEN = 498; // Esri |
|
42 | - public const CLIENT_CLOSED_REQUEST = 499; // Nginx |
|
43 | - public const TOKEN_REQUIRED = 499; // Esri |
|
44 | - public const BANDWIDTH_LIMIT_EXCEEDED = 509; // Apache Web Server/cPanel |
|
45 | - public const WEB_SERVER_RETURNED_AN_UNKNOWN_ERROR = 520; // Cloudflare |
|
46 | - public const WEB_SERVER_IS_DOWN = 521; // Cloudflare |
|
47 | - public const CONNECTION_TIMEDOUT = 522; // Cloudflare |
|
48 | - public const ORIGIN_IS_UNREACHABLE = 523; // Cloudflare |
|
49 | - public const A_TIMEOUT_OCCURRED = 524; // Cloudflare |
|
50 | - public const SSL_HANDSHAKE_FAILED = 525; // Cloudflare |
|
51 | - public const INVALID_SSL_CERTIFICATE = 526; // Cloudflare |
|
52 | - public const RAILGUN_ERROR = 527; // Cloudflare |
|
53 | - public const SITE_IS_OVERLOADED = 529; // Qualys in the SSLLabs |
|
54 | - public const SITE_IS_FROZEN = 530; // Pantheon web platform |
|
55 | - public const NETWORK_READ_TIMEOUT_ERROR = 598; // Informal convention |
|
28 | + public const THIS_IS_FIND = 218; // Apache Web Server |
|
29 | + public const PAGE_EXPIRED = 419; // Laravel Framework |
|
30 | + public const METHOD_FAILURE = 420; // Spring Framework |
|
31 | + public const ENHANCE_YOUR_CALM = 420; // Twitter |
|
32 | + public const LOGIN_TIMEOUT = 440; // IIS |
|
33 | + public const NO_RESPONSE = 444; // Nginx |
|
34 | + public const RETRY_WITH = 449; // IIS |
|
35 | + public const BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS = 450; // Microsoft |
|
36 | + public const REDIRECT = 451; // IIS |
|
37 | + public const REQUEST_HEADER_TOO_LARGE = 494; // Nginx |
|
38 | + public const SSL_CERTIFICATE_ERROR = 495; // Nginx |
|
39 | + public const SSL_CERTIFICATE_REQUIRED = 496; // Nginx |
|
40 | + public const HTTP_REQUEST_SENT_TO_HTTPS_PORT = 497; // Nginx |
|
41 | + public const INVALID_TOKEN = 498; // Esri |
|
42 | + public const CLIENT_CLOSED_REQUEST = 499; // Nginx |
|
43 | + public const TOKEN_REQUIRED = 499; // Esri |
|
44 | + public const BANDWIDTH_LIMIT_EXCEEDED = 509; // Apache Web Server/cPanel |
|
45 | + public const WEB_SERVER_RETURNED_AN_UNKNOWN_ERROR = 520; // Cloudflare |
|
46 | + public const WEB_SERVER_IS_DOWN = 521; // Cloudflare |
|
47 | + public const CONNECTION_TIMEDOUT = 522; // Cloudflare |
|
48 | + public const ORIGIN_IS_UNREACHABLE = 523; // Cloudflare |
|
49 | + public const A_TIMEOUT_OCCURRED = 524; // Cloudflare |
|
50 | + public const SSL_HANDSHAKE_FAILED = 525; // Cloudflare |
|
51 | + public const INVALID_SSL_CERTIFICATE = 526; // Cloudflare |
|
52 | + public const RAILGUN_ERROR = 527; // Cloudflare |
|
53 | + public const SITE_IS_OVERLOADED = 529; // Qualys in the SSLLabs |
|
54 | + public const SITE_IS_FROZEN = 530; // Pantheon web platform |
|
55 | + public const NETWORK_READ_TIMEOUT_ERROR = 598; // Informal convention |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * Code officiels |
@@ -67,55 +67,55 @@ discard block |
||
67 | 67 | public const OK = 200; |
68 | 68 | public const CREATED = 201; |
69 | 69 | public const ACCEPTED = 202; |
70 | - public const NON_AUTHORITATIVE_INFORMATION = 203; // Since HTTP/1.1 |
|
70 | + public const NON_AUTHORITATIVE_INFORMATION = 203; // Since HTTP/1.1 |
|
71 | 71 | public const NO_CONTENT = 204; |
72 | 72 | public const RESET_CONTENT = 205; |
73 | - public const PARTIAL_CONTENT = 206; // RFC 7233 |
|
74 | - public const MULTI_STATUS = 207; // WebDAV; RFC 4918 |
|
75 | - public const ALREADY_REPORTED = 208; // WebDAV; RFC 5842 |
|
76 | - public const IM_USED = 226; // RFC 3229 |
|
73 | + public const PARTIAL_CONTENT = 206; // RFC 7233 |
|
74 | + public const MULTI_STATUS = 207; // WebDAV; RFC 4918 |
|
75 | + public const ALREADY_REPORTED = 208; // WebDAV; RFC 5842 |
|
76 | + public const IM_USED = 226; // RFC 3229 |
|
77 | 77 | |
78 | 78 | // Redirection 3xx |
79 | 79 | public const MULTIPLE_CHOICES = 300; |
80 | 80 | public const MOVED_PERMANENTLY = 301; |
81 | - public const FOUND = 302; // Previously "Moved temporarily" |
|
82 | - public const SEE_OTHER = 303; // Since HTTP/1.1 |
|
81 | + public const FOUND = 302; // Previously "Moved temporarily" |
|
82 | + public const SEE_OTHER = 303; // Since HTTP/1.1 |
|
83 | 83 | public const NOT_MODIFIED = 304; |
84 | - public const USE_PROXY = 305; // Since HTTP/1.1 |
|
84 | + public const USE_PROXY = 305; // Since HTTP/1.1 |
|
85 | 85 | public const SWITCH_PROXY = 306; |
86 | - public const TEMPORARY_REDIRECT = 307; // Since HTTP/1.1 |
|
87 | - public const PERMANENT_REDIRECT = 308; // RFC 7538 |
|
86 | + public const TEMPORARY_REDIRECT = 307; // Since HTTP/1.1 |
|
87 | + public const PERMANENT_REDIRECT = 308; // RFC 7538 |
|
88 | 88 | |
89 | 89 | // Client Errors 4xx |
90 | 90 | public const BAD_REQUEST = 400; |
91 | - public const UNAUTHORIZED = 401; // RFC 7235 |
|
91 | + public const UNAUTHORIZED = 401; // RFC 7235 |
|
92 | 92 | public const PAYMENT_REQUIRED = 402; |
93 | 93 | public const FORBIDDEN = 403; |
94 | 94 | public const NOT_FOUND = 404; |
95 | 95 | public const METHOD_NOT_ALLOWED = 405; |
96 | 96 | public const NOT_ACCEPTABLE = 406; |
97 | - public const PROXY_AUTHENTICATION_REQUIRED = 407; // RFC 7235 |
|
97 | + public const PROXY_AUTHENTICATION_REQUIRED = 407; // RFC 7235 |
|
98 | 98 | public const REQUEST_TIMEOUT = 408; |
99 | 99 | public const CONFLICT = 409; |
100 | 100 | public const GONE = 410; |
101 | 101 | public const LENGTH_REQUIRED = 411; |
102 | - public const PRECONDITION_FAILED = 412; // RFC 7232 |
|
102 | + public const PRECONDITION_FAILED = 412; // RFC 7232 |
|
103 | 103 | public const PAYLOAD_TOO_LARGE = 413; |
104 | - public const URI_TOO_LONG = 414; // RFC 7231 |
|
105 | - public const UNSUPPORTED_MEDIA_TYPE = 415; // RFC 7231 |
|
106 | - public const RANGE_NOT_SATISFIABLE = 416; // RFC 7233 |
|
104 | + public const URI_TOO_LONG = 414; // RFC 7231 |
|
105 | + public const UNSUPPORTED_MEDIA_TYPE = 415; // RFC 7231 |
|
106 | + public const RANGE_NOT_SATISFIABLE = 416; // RFC 7233 |
|
107 | 107 | public const EXPECTATION_FAILED = 417; |
108 | - public const IM_A_TEAPOT = 418; // RFC 2324, RFC 7233 |
|
109 | - public const MISDIRECTED_REQUEST = 421; // RFC 7540 |
|
110 | - public const UNPROCESSABLE_ENTITY = 422; // WebDAV; RFC 4918 |
|
111 | - public const LOCKED = 423; // WebDAV; RFC 4918 |
|
112 | - public const FAILED_DEPENDENCY = 424; // WebDAV; RFC 4918 |
|
113 | - public const TOO_EARLY = 425; // RFC 8470 |
|
108 | + public const IM_A_TEAPOT = 418; // RFC 2324, RFC 7233 |
|
109 | + public const MISDIRECTED_REQUEST = 421; // RFC 7540 |
|
110 | + public const UNPROCESSABLE_ENTITY = 422; // WebDAV; RFC 4918 |
|
111 | + public const LOCKED = 423; // WebDAV; RFC 4918 |
|
112 | + public const FAILED_DEPENDENCY = 424; // WebDAV; RFC 4918 |
|
113 | + public const TOO_EARLY = 425; // RFC 8470 |
|
114 | 114 | public const UPGRADE_REQUIRED = 426; |
115 | - public const PRECONDITION_REQUIRED = 428; // RFC 6585 |
|
116 | - public const TOO_MANY_REQUESTS = 429; // RFC 6585 |
|
117 | - public const REQUEST_HEADER_FIELDS_TOO_LARGE = 431; // RFC 6585 |
|
118 | - public const UNAVAILABLE_FOR_LEGAL_REASONS = 451; // RFC 7725 |
|
115 | + public const PRECONDITION_REQUIRED = 428; // RFC 6585 |
|
116 | + public const TOO_MANY_REQUESTS = 429; // RFC 6585 |
|
117 | + public const REQUEST_HEADER_FIELDS_TOO_LARGE = 431; // RFC 6585 |
|
118 | + public const UNAVAILABLE_FOR_LEGAL_REASONS = 451; // RFC 7725 |
|
119 | 119 | |
120 | 120 | // Server Errors 5xx |
121 | 121 | public const INTERNAL_ERROR = 500; |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | public const SERVICE_UNAVAILABLE = 503; |
125 | 125 | public const GATEWAY_TIMEOUT = 504; |
126 | 126 | public const HTTP_VERSION_NOT_SUPPORTED = 505; |
127 | - public const VARIANT_ALSO_NEGOTIATES = 506; // RFC 2295 |
|
128 | - public const INSUFFICIENT_STORAGE = 507; // WebDAV; RFC 4918 |
|
129 | - public const LOOP_DETECTED = 508; // WebDAV; RFC 4918 |
|
130 | - public const NOT_EXTENDED = 510; // RFC 2774 |
|
131 | - public const NOTWORK_AUTHENTICATION_REQUIRED = 511; // RFC 6585 |
|
127 | + public const VARIANT_ALSO_NEGOTIATES = 506; // RFC 2295 |
|
128 | + public const INSUFFICIENT_STORAGE = 507; // WebDAV; RFC 4918 |
|
129 | + public const LOOP_DETECTED = 508; // WebDAV; RFC 4918 |
|
130 | + public const NOT_EXTENDED = 510; // RFC 2774 |
|
131 | + public const NOTWORK_AUTHENTICATION_REQUIRED = 511; // RFC 6585 |
|
132 | 132 | } |
@@ -327,14 +327,14 @@ |
||
327 | 327 | */ |
328 | 328 | private function setFormatter(object $handler, array $allowed, ?string $format = 'json'): object |
329 | 329 | { |
330 | - if (! method_exists($handler, 'setFormatter')) { |
|
330 | + if (!method_exists($handler, 'setFormatter')) { |
|
331 | 331 | return $handler; |
332 | 332 | } |
333 | 333 | |
334 | 334 | if (empty($format)) { |
335 | 335 | $format = 'json'; |
336 | 336 | } |
337 | - if (! empty($allowed) && ! in_array($format, $allowed, true)) { |
|
337 | + if (!empty($allowed) && !in_array($format, $allowed, true)) { |
|
338 | 338 | throw new InvalidArgumentException('Invalid formatter for log file handler. Accepts values: ' . implode('/', $allowed)); |
339 | 339 | } |
340 | 340 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public function start(string $name, ?float $time = null): self |
35 | 35 | { |
36 | 36 | $this->timers[strtolower($name)] = [ |
37 | - 'start' => ! empty($time) ? $time : microtime(true), |
|
37 | + 'start' => !empty($time) ? $time : microtime(true), |
|
38 | 38 | 'end' => null, |
39 | 39 | ]; |
40 | 40 |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | if ( |
99 | - ! isset($sessionConfig['ini']['session.cookie_secure']) |
|
99 | + !isset($sessionConfig['ini']['session.cookie_secure']) |
|
100 | 100 | && env('HTTPS') |
101 | 101 | && ini_get('session.cookie_secure') !== 1 |
102 | 102 | ) { |
@@ -104,17 +104,17 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | if ( |
107 | - ! isset($sessionConfig['ini']['session.name']) |
|
107 | + !isset($sessionConfig['ini']['session.name']) |
|
108 | 108 | && isset($sessionConfig['cookie']) |
109 | 109 | ) { |
110 | 110 | $sessionConfig['ini']['session.name'] = $sessionConfig['cookie']; |
111 | 111 | } |
112 | 112 | |
113 | - if (! isset($sessionConfig['ini']['session.use_strict_mode']) && ini_get('session.use_strict_mode') !== 1) { |
|
113 | + if (!isset($sessionConfig['ini']['session.use_strict_mode']) && ini_get('session.use_strict_mode') !== 1) { |
|
114 | 114 | $sessionConfig['ini']['session.use_strict_mode'] = 1; |
115 | 115 | } |
116 | 116 | |
117 | - if (! isset($sessionConfig['ini']['session.cookie_httponly']) && ini_get('session.cookie_httponly') !== 1) { |
|
117 | + if (!isset($sessionConfig['ini']['session.cookie_httponly']) && ini_get('session.cookie_httponly') !== 1) { |
|
118 | 118 | $sessionConfig['ini']['session.cookie_httponly'] = 1; |
119 | 119 | } |
120 | 120 | |
@@ -213,14 +213,14 @@ discard block |
||
213 | 213 | $config['ini']['session.name'] = $config['cookie']; |
214 | 214 | } |
215 | 215 | |
216 | - if (! isset($config['ini']['session.cookie_path'])) { |
|
216 | + if (!isset($config['ini']['session.cookie_path'])) { |
|
217 | 217 | $cookiePath = empty($config['cookiePath']) ? '/' : $config['cookiePath']; |
218 | 218 | $config['ini']['session.cookie_path'] = $cookiePath; |
219 | 219 | } |
220 | 220 | |
221 | 221 | $this->options($config['ini']); |
222 | 222 | |
223 | - if (! empty($config['handler'])) { |
|
223 | + if (!empty($config['handler'])) { |
|
224 | 224 | $class = $config['handler']['engine']; |
225 | 225 | unset($config['handler']['engine']); |
226 | 226 | $this->engine($class, $config['handler']); |
@@ -258,14 +258,14 @@ discard block |
||
258 | 258 | } |
259 | 259 | $className = App::className($class, 'Http/Session'); |
260 | 260 | |
261 | - if (! $className) { |
|
261 | + if (!$className) { |
|
262 | 262 | throw new InvalidArgumentException( |
263 | 263 | sprintf('The class "%s" does not exist and cannot be used as a session engine', $class) |
264 | 264 | ); |
265 | 265 | } |
266 | 266 | |
267 | 267 | $handler = new $className($options); |
268 | - if (! ($handler instanceof SessionHandlerInterface)) { |
|
268 | + if (!($handler instanceof SessionHandlerInterface)) { |
|
269 | 269 | throw new InvalidArgumentException( |
270 | 270 | 'The chosen SessionHandler does not implement SessionHandlerInterface, it cannot be used as an engine.' |
271 | 271 | ); |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | protected function setEngine(SessionHandlerInterface $handler): SessionHandlerInterface |
281 | 281 | { |
282 | - if (! headers_sent() && session_status() !== \PHP_SESSION_ACTIVE) { |
|
282 | + if (!headers_sent() && session_status() !== \PHP_SESSION_ACTIVE) { |
|
283 | 283 | session_set_save_handler($handler, false); |
284 | 284 | } |
285 | 285 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | return false; |
344 | 344 | } |
345 | 345 | |
346 | - if (! session_start()) { |
|
346 | + if (!session_start()) { |
|
347 | 347 | throw new RuntimeException('Could not start the session'); |
348 | 348 | } |
349 | 349 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function close(): bool |
365 | 365 | { |
366 | - if (! $this->_started) { |
|
366 | + if (!$this->_started) { |
|
367 | 367 | return true; |
368 | 368 | } |
369 | 369 | |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | return true; |
374 | 374 | } |
375 | 375 | |
376 | - if (! session_write_close()) { |
|
376 | + if (!session_write_close()) { |
|
377 | 377 | throw new RuntimeException('Could not close the session'); |
378 | 378 | } |
379 | 379 | |
@@ -395,11 +395,11 @@ discard block |
||
395 | 395 | */ |
396 | 396 | public function check(?string $name = null): bool |
397 | 397 | { |
398 | - if ($this->_hasSession() && ! $this->started()) { |
|
398 | + if ($this->_hasSession() && !$this->started()) { |
|
399 | 399 | $this->start(); |
400 | 400 | } |
401 | 401 | |
402 | - if (! isset($_SESSION)) { |
|
402 | + if (!isset($_SESSION)) { |
|
403 | 403 | return false; |
404 | 404 | } |
405 | 405 | |
@@ -421,11 +421,11 @@ discard block |
||
421 | 421 | */ |
422 | 422 | public function read(?string $name = null, $default = null) |
423 | 423 | { |
424 | - if ($this->_hasSession() && ! $this->started()) { |
|
424 | + if ($this->_hasSession() && !$this->started()) { |
|
425 | 425 | $this->start(); |
426 | 426 | } |
427 | 427 | |
428 | - if (! isset($_SESSION)) { |
|
428 | + if (!isset($_SESSION)) { |
|
429 | 429 | return $default; |
430 | 430 | } |
431 | 431 | |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | */ |
448 | 448 | public function readOrFail(string $name) |
449 | 449 | { |
450 | - if (! $this->check($name)) { |
|
450 | + if (!$this->check($name)) { |
|
451 | 451 | throw new RuntimeException(sprintf('Expected session key "%s" not found.', $name)); |
452 | 452 | } |
453 | 453 | |
@@ -484,11 +484,11 @@ discard block |
||
484 | 484 | */ |
485 | 485 | public function write($name, $value = null): void |
486 | 486 | { |
487 | - if (! $this->started()) { |
|
487 | + if (!$this->started()) { |
|
488 | 488 | $this->start(); |
489 | 489 | } |
490 | 490 | |
491 | - if (! is_array($name)) { |
|
491 | + if (!is_array($name)) { |
|
492 | 492 | $name = [$name => $value]; |
493 | 493 | } |
494 | 494 | |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | */ |
518 | 518 | public function id(?string $id = null): string |
519 | 519 | { |
520 | - if ($id !== null && ! headers_sent()) { |
|
520 | + if ($id !== null && !headers_sent()) { |
|
521 | 521 | session_id($id); |
522 | 522 | } |
523 | 523 | |
@@ -543,9 +543,9 @@ discard block |
||
543 | 543 | */ |
544 | 544 | protected function _overwrite(array &$old, array $new): void |
545 | 545 | { |
546 | - if (! empty($old)) { |
|
546 | + if (!empty($old)) { |
|
547 | 547 | foreach ($old as $key => $var) { |
548 | - if (! isset($new[$key])) { |
|
548 | + if (!isset($new[$key])) { |
|
549 | 549 | unset($old[$key]); |
550 | 550 | } |
551 | 551 | } |
@@ -561,11 +561,11 @@ discard block |
||
561 | 561 | */ |
562 | 562 | public function destroy(): void |
563 | 563 | { |
564 | - if ($this->_hasSession() && ! $this->started()) { |
|
564 | + if ($this->_hasSession() && !$this->started()) { |
|
565 | 565 | $this->start(); |
566 | 566 | } |
567 | 567 | |
568 | - if (! $this->_isCLI && session_status() === \PHP_SESSION_ACTIVE) { |
|
568 | + if (!$this->_isCLI && session_status() === \PHP_SESSION_ACTIVE) { |
|
569 | 569 | session_destroy(); |
570 | 570 | } |
571 | 571 | |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | */ |
594 | 594 | protected function _hasSession(): bool |
595 | 595 | { |
596 | - return ! ini_get('session.use_cookies') |
|
596 | + return !ini_get('session.use_cookies') |
|
597 | 597 | || isset($_COOKIE[session_name()]) |
598 | 598 | || $this->_isCLI |
599 | 599 | || (ini_get('session.use_trans_sid') && isset($_GET[session_name()])); |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | */ |
605 | 605 | public function renew(): void |
606 | 606 | { |
607 | - if (! $this->_hasSession() || $this->_isCLI) { |
|
607 | + if (!$this->_hasSession() || $this->_isCLI) { |
|
608 | 608 | return; |
609 | 609 | } |
610 | 610 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | public function add($middlewares): self |
51 | 51 | { |
52 | - if (! is_array($middlewares)) { |
|
52 | + if (!is_array($middlewares)) { |
|
53 | 53 | $middlewares = [$middlewares]; |
54 | 54 | } |
55 | 55 |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | $body = $response->getBody(); |
113 | 113 | |
114 | - if (! $body->isSeekable()) { |
|
114 | + if (!$body->isSeekable()) { |
|
115 | 115 | echo $body; |
116 | 116 | |
117 | 117 | return; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | $body->rewind(); |
121 | 121 | |
122 | - while (! $body->eof()) { |
|
122 | + while (!$body->eof()) { |
|
123 | 123 | echo $body->read($maxBufferLength); |
124 | 124 | } |
125 | 125 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | $body = $response->getBody(); |
140 | 140 | |
141 | - if (! $body->isSeekable()) { |
|
141 | + if (!$body->isSeekable()) { |
|
142 | 142 | $contents = $body->getContents(); |
143 | 143 | echo substr($contents, $first, $last - $first + 1); |
144 | 144 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $pos = 0; |
151 | 151 | $length = $last - $first + 1; |
152 | 152 | |
153 | - while (! $body->eof() && $pos < $length) { |
|
153 | + while (!$body->eof() && $pos < $length) { |
|
154 | 154 | if (($pos + $maxBufferLength) > $length) { |
155 | 155 | echo $body->read($length - $pos); |
156 | 156 | break; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $key = strtolower($key); |
234 | 234 | $data[$key] = $value; |
235 | 235 | } |
236 | - if (! empty($data['expires'])) { |
|
236 | + if (!empty($data['expires'])) { |
|
237 | 237 | $data['expires'] = strtotime($data['expires']); |
238 | 238 | } |
239 | 239 | setcookie( |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | $this->_streamMode = $options['streamMode'] ?? $this->_streamMode; |
451 | 451 | |
452 | 452 | if (isset($options['stream'])) { |
453 | - if (! $options['stream'] instanceof StreamInterface) { |
|
453 | + if (!$options['stream'] instanceof StreamInterface) { |
|
454 | 454 | throw new InvalidArgumentException('Stream option must be an object that implements StreamInterface'); |
455 | 455 | } |
456 | 456 | $this->stream = $options['stream']; |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | $this->_setStatus($options['status']); |
467 | 467 | } |
468 | 468 | |
469 | - if (! isset($options['charset'])) { |
|
469 | + if (!isset($options['charset'])) { |
|
470 | 470 | $options['charset'] = config('app.charset'); |
471 | 471 | } |
472 | 472 | $this->_charset = $options['charset']; |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | protected function _clearHeader(string $header): void |
595 | 595 | { |
596 | 596 | $normalized = strtolower($header); |
597 | - if (! isset($this->headerNames[$normalized])) { |
|
597 | + if (!isset($this->headerNames[$normalized])) { |
|
598 | 598 | return; |
599 | 599 | } |
600 | 600 | $original = $this->headerNames[$normalized]; |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | */ |
834 | 834 | public function withCache($since, $time = '+1 day'): static |
835 | 835 | { |
836 | - if (! is_int($time)) { |
|
836 | + if (!is_int($time)) { |
|
837 | 837 | $time = strtotime($time); |
838 | 838 | if ($time === false) { |
839 | 839 | throw new InvalidArgumentException( |
@@ -1287,7 +1287,7 @@ discard block |
||
1287 | 1287 | */ |
1288 | 1288 | public function getCookie(string $name): ?array |
1289 | 1289 | { |
1290 | - if (! $this->_cookies->has($name)) { |
|
1290 | + if (!$this->_cookies->has($name)) { |
|
1291 | 1291 | return null; |
1292 | 1292 | } |
1293 | 1293 | |
@@ -1360,7 +1360,7 @@ discard block |
||
1360 | 1360 | |
1361 | 1361 | $extension = strtolower($file->getExtension()); |
1362 | 1362 | $mapped = $this->getMimeType($extension); |
1363 | - if ((! $extension || ! $mapped) && $options['download'] === null) { |
|
1363 | + if ((!$extension || !$mapped) && $options['download'] === null) { |
|
1364 | 1364 | $options['download'] = true; |
1365 | 1365 | } |
1366 | 1366 | |
@@ -1424,12 +1424,12 @@ discard block |
||
1424 | 1424 | if (strpos($path, '../') !== false || strpos($path, '..\\') !== false) { |
1425 | 1425 | throw new LoadException('The requested file contains `..` and will not be read.'); |
1426 | 1426 | } |
1427 | - if (! is_file($path)) { |
|
1428 | - $path = APP_PATH . $path; // @phpstan-ignore-line |
|
1427 | + if (!is_file($path)) { |
|
1428 | + $path = APP_PATH . $path; // @phpstan-ignore-line |
|
1429 | 1429 | } |
1430 | 1430 | |
1431 | 1431 | $file = new SplFileInfo($path); |
1432 | - if (! $file->isFile() || ! $file->isReadable()) { |
|
1432 | + if (!$file->isFile() || !$file->isReadable()) { |
|
1433 | 1433 | if (on_dev()) { |
1434 | 1434 | throw new LoadException(sprintf('The requested file %s was not found or not readable', $path)); |
1435 | 1435 | } |