@@ -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 | } |
@@ -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 |
@@ -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 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | // Sort to get the highest results first |
209 | - usort($results, static function ($a, $b) { |
|
209 | + usort($results, static function($a, $b) { |
|
210 | 210 | if ($a['q'] === $b['q']) { |
211 | 211 | $a_ast = substr_count($a['value'], '*'); |
212 | 212 | $b_ast = substr_count($b['value'], '*'); |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | } |
277 | 277 | |
278 | 278 | foreach ($supported['params'] as $label => $value) { |
279 | - if (! isset($acceptable['params'][$label]) || $acceptable['params'][$label] !== $value) { |
|
279 | + if (!isset($acceptable['params'][$label]) || $acceptable['params'][$label] !== $value) { |
|
280 | 280 | return false; |
281 | 281 | } |
282 | 282 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | { |
50 | 50 | $route = Services::routes()->reverseRoute($route, ...$params); |
51 | 51 | |
52 | - if (! $route) { |
|
52 | + if (!$route) { |
|
53 | 53 | throw HttpException::invalidRedirectRoute($route); |
54 | 54 | } |
55 | 55 |