@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | if (is_array($config)) { |
| 89 | 89 | foreach ($config as $key => $value) { |
| 90 | - if (! is_string($value) || empty($value)) { |
|
| 90 | + if (!is_string($value) || empty($value)) { |
|
| 91 | 91 | continue; |
| 92 | 92 | } |
| 93 | 93 | if (is_string($key)) { |
@@ -99,14 +99,14 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | self::load($conf, $file); |
| 101 | 101 | } |
| 102 | - } elseif (is_string($config) && ! isset(self::$loaded[$config])) { |
|
| 102 | + } elseif (is_string($config) && !isset(self::$loaded[$config])) { |
|
| 103 | 103 | if (empty($file)) { |
| 104 | 104 | $file = self::path($config); |
| 105 | 105 | } |
| 106 | - if (! file_exists($file)) { |
|
| 106 | + if (!file_exists($file)) { |
|
| 107 | 107 | throw ConfigException::configDontExist($config, $file); |
| 108 | 108 | } |
| 109 | - if (! in_array($file, get_included_files(), true)) { |
|
| 109 | + if (!in_array($file, get_included_files(), true)) { |
|
| 110 | 110 | if (empty($schema)) { |
| 111 | 111 | $schema = self::schema($config); |
| 112 | 112 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | { |
| 130 | 130 | if (is_array($accepts_values)) { |
| 131 | 131 | $accepts_values = '(Accept values: ' . implode('/', $accepts_values) . ')'; |
| 132 | - } elseif (! is_string($accepts_values)) { |
|
| 132 | + } elseif (!is_string($accepts_values)) { |
|
| 133 | 133 | throw new InvalidArgumentException('Misuse of the method ' . __METHOD__); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -145,13 +145,13 @@ discard block |
||
| 145 | 145 | $server_addr = $_SERVER['HTTP_HOST'] ?? ((strpos($_SERVER['SERVER_ADDR'], ':') !== false) ? '[' . $_SERVER['SERVER_ADDR'] . ']' : $_SERVER['SERVER_ADDR']); |
| 146 | 146 | |
| 147 | 147 | if (isset($_SERVER['SERVER_PORT'])) { |
| 148 | - $server_addr .= ':' . ((! preg_match('#:' . $_SERVER['SERVER_PORT'] . '$#', $server_addr)) ? $_SERVER['SERVER_PORT'] : '80'); |
|
| 148 | + $server_addr .= ':' . ((!preg_match('#:' . $_SERVER['SERVER_PORT'] . '$#', $server_addr)) ? $_SERVER['SERVER_PORT'] : '80'); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | if ( |
| 152 | - (! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') |
|
| 152 | + (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') |
|
| 153 | 153 | || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https') |
| 154 | - || (! empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') |
|
| 154 | + || (!empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') |
|
| 155 | 155 | ) { |
| 156 | 156 | $base_url = 'https'; |
| 157 | 157 | } else { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $schema = require $app_schema; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - if (empty($schema) || ! ($schema instanceof Schema)) { |
|
| 208 | + if (empty($schema) || !($schema instanceof Schema)) { |
|
| 209 | 209 | $schema = Expect::mixed(); |
| 210 | 210 | } |
| 211 | 211 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | private function initializeURL() |
| 232 | 232 | { |
| 233 | - if (! $this->configurator->exists('app.base_url')) { |
|
| 233 | + if (!$this->configurator->exists('app.base_url')) { |
|
| 234 | 234 | $config = 'auto'; |
| 235 | 235 | } else { |
| 236 | 236 | $config = $this->configurator->get('app.base_url'); |
@@ -284,17 +284,17 @@ discard block |
||
| 284 | 284 | */ |
| 285 | 285 | private function initializeDebugbar() |
| 286 | 286 | { |
| 287 | - if (! $this->configurator->exists('app.show_debugbar')) { |
|
| 287 | + if (!$this->configurator->exists('app.show_debugbar')) { |
|
| 288 | 288 | $config = 'auto'; |
| 289 | 289 | } else { |
| 290 | 290 | $config = $this->configurator->get('app.show_debugbar'); |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | - if (! in_array($config, ['auto', true, false], true)) { |
|
| 293 | + if (!in_array($config, ['auto', true, false], true)) { |
|
| 294 | 294 | self::exceptBadConfigValue('show_debugbar', ['auto', true, false], 'app'); |
| 295 | 295 | } |
| 296 | 296 | if ($config === 'auto') { |
| 297 | - $this->configurator->set('app.show_debugbar', ! is_online()); |
|
| 297 | + $this->configurator->set('app.show_debugbar', !is_online()); |
|
| 298 | 298 | } |
| 299 | 299 | } |
| 300 | 300 | } |
@@ -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 | } |
@@ -35,16 +35,16 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | // services système |
| 37 | 37 | $filename = SYST_PATH . 'Constants' . DS . 'providers.php'; |
| 38 | - if (! file_exists($filename)) { |
|
| 38 | + if (!file_exists($filename)) { |
|
| 39 | 39 | throw LoadException::providersDefinitionDontExist($filename); |
| 40 | 40 | } |
| 41 | - if (! in_array($filename, get_included_files(), true)) { |
|
| 41 | + if (!in_array($filename, get_included_files(), true)) { |
|
| 42 | 42 | $providers = array_merge($providers, require $filename); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // services de l'application |
| 46 | 46 | $filename = CONFIG_PATH . 'providers.php'; |
| 47 | - if (file_exists($filename) && ! in_array($filename, get_included_files(), true)) { |
|
| 47 | + if (file_exists($filename) && !in_array($filename, get_included_files(), true)) { |
|
| 48 | 48 | $providers = array_merge($providers, require $filename); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | private static function is_loaded(string $module, $element): bool |
| 60 | 60 | { |
| 61 | - if (! isset(self::$loads[$module]) || ! is_array(self::$loads[$module])) { |
|
| 61 | + if (!isset(self::$loads[$module]) || !is_array(self::$loads[$module])) { |
|
| 62 | 62 | return false; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $languages = []; |
| 40 | 40 | |
| 41 | 41 | foreach ($paths as $path) { |
| 42 | - if (file_exists($path) && ! in_array($path, get_included_files(), true)) { |
|
| 42 | + if (file_exists($path) && !in_array($path, get_included_files(), true)) { |
|
| 43 | 43 | $languages = array_merge($languages, (array) require($path)); |
| 44 | 44 | $file_exist = true; |
| 45 | 45 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | throw LoadException::libraryNotFound($lib); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - if (true !== $file_syst && ! class_exists($lib)) { |
|
| 117 | + if (true !== $file_syst && !class_exists($lib)) { |
|
| 118 | 118 | throw LoadException::libraryDontExist($lib); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $model = explode('/', $model); |
| 133 | 133 | |
| 134 | 134 | $mod = ucfirst(end($model)); |
| 135 | - $mod = (! preg_match('#Model$#', $mod)) ? $mod . 'Model' : $mod; |
|
| 135 | + $mod = (!preg_match('#Model$#', $mod)) ? $mod . 'Model' : $mod; |
|
| 136 | 136 | $model[count($model) - 1] = $mod; |
| 137 | 137 | |
| 138 | 138 | foreach ($model as $key => &$value) { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | $path = MODEL_PATH . Helpers::ensureExt(implode(DS, $model), 'php'); |
| 145 | 145 | |
| 146 | - if (! file_exists($path)) { |
|
| 146 | + if (!file_exists($path)) { |
|
| 147 | 147 | throw LoadException::modelNotFound($mod, $path); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | if (class_exists($class_namespaced, false)) { |
| 155 | 155 | return Injector::make($class_namespaced); |
| 156 | 156 | } |
| 157 | - if (! class_exists($mod, false)) { |
|
| 157 | + if (!class_exists($mod, false)) { |
|
| 158 | 158 | throw LoadException::modelDontExist($mod, $path); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | $controller = explode('/', $controller); |
| 173 | 173 | |
| 174 | 174 | $con = ucfirst(end($controller)); |
| 175 | - $con = (! preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con; |
|
| 175 | + $con = (!preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con; |
|
| 176 | 176 | $controller[count($controller) - 1] = $con; |
| 177 | 177 | |
| 178 | 178 | foreach ($controller as $key => &$value) { |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $path = CONTROLLER_PATH . Helpers::ensureExt(implode(DS, $controller), 'php'); |
| 185 | 185 | |
| 186 | - if (! file_exists($path)) { |
|
| 186 | + if (!file_exists($path)) { |
|
| 187 | 187 | throw LoadException::controllerNotFound(str_replace('Controller', '', $con), $path); |
| 188 | 188 | } |
| 189 | 189 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | if (class_exists($class_namespaced, false)) { |
| 195 | 195 | return Injector::make($class_namespaced); |
| 196 | 196 | } |
| 197 | - if (! class_exists($con, false)) { |
|
| 197 | + if (!class_exists($con, false)) { |
|
| 198 | 198 | throw LoadException::controllerDontExist(str_replace('Controller', '', $con), $path); |
| 199 | 199 | } |
| 200 | 200 | |
@@ -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 | } |
@@ -182,9 +182,9 @@ |
||
| 182 | 182 | |
| 183 | 183 | /** |
| 184 | 184 | * Vérifiez si un cookie a expiré par rapport à $time |
| 185 | - * |
|
| 185 | + * |
|
| 186 | 186 | * Les cookies sans date d'expiration renvoient toujours faux. |
| 187 | - * |
|
| 187 | + * |
|
| 188 | 188 | * @param DateTime|DateTimeImmutable $time L'heure de test. Par défaut, 'maintenant' en UTC. |
| 189 | 189 | */ |
| 190 | 190 | public function isExpired($time = null): bool; |
@@ -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 | |