@@ -21,7 +21,7 @@ |
||
| 21 | 21 | protected function decorate(string $output): string |
| 22 | 22 | { |
| 23 | 23 | foreach (config('view.decorators') as $decorator) { |
| 24 | - if (! is_subclass_of($decorator, ViewDecoratorInterface::class, true)) { |
|
| 24 | + if (!is_subclass_of($decorator, ViewDecoratorInterface::class, true)) { |
|
| 25 | 25 | throw ViewException::invalidDecorator($decorator); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | $data = array_merge(self::$shared, $data); |
| 217 | 217 | |
| 218 | - if (! on_test() && ! isset($data['errors'])) { |
|
| 218 | + if (!on_test() && !isset($data['errors'])) { |
|
| 219 | 219 | $data['errors'] = $this->setValidationErrors(); |
| 220 | 220 | } |
| 221 | 221 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | if (is_string($errors)) { |
| 247 | 247 | $errors = ['default' => $errors]; |
| 248 | 248 | } |
| 249 | - if (! ($errors instanceof ErrorBag)) { |
|
| 249 | + if (!($errors instanceof ErrorBag)) { |
|
| 250 | 250 | $errors = new ErrorBag($errors); |
| 251 | 251 | } |
| 252 | 252 | |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | $data = array_merge(self::$shared, $data); |
| 286 | 286 | |
| 287 | - if (! on_test() && ! isset($data['errors'])) { |
|
| 287 | + if (!on_test() && !isset($data['errors'])) { |
|
| 288 | 288 | $data['errors'] = $this->setValidationErrors(); |
| 289 | 289 | } |
| 290 | 290 | |
@@ -342,10 +342,10 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | public function setAdapter(string $adapter, array $config = []): static |
| 344 | 344 | { |
| 345 | - if (! array_key_exists($adapter, self::$validAdapters)) { |
|
| 345 | + if (!array_key_exists($adapter, self::$validAdapters)) { |
|
| 346 | 346 | $adapter = 'native'; |
| 347 | 347 | } |
| 348 | - if (empty($this->config['adapters']) || ! is_array($this->config['adapters'])) { |
|
| 348 | + if (empty($this->config['adapters']) || !is_array($this->config['adapters'])) { |
|
| 349 | 349 | $this->config['adapters'] = []; |
| 350 | 350 | } |
| 351 | 351 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | |
| 271 | 271 | $route = $this->routes->reverseRoute($action, ...$parameters); |
| 272 | 272 | |
| 273 | - if (! $route) { |
|
| 273 | + if (!$route) { |
|
| 274 | 274 | throw RouterException::actionNotDefined($action); |
| 275 | 275 | } |
| 276 | 276 | |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | */ |
| 342 | 342 | public function isValidUrl(string $path): bool |
| 343 | 343 | { |
| 344 | - if (! preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) { |
|
| 344 | + if (!preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) { |
|
| 345 | 345 | return filter_var($path, FILTER_VALIDATE_URL) !== false; |
| 346 | 346 | } |
| 347 | 347 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $this->path = $path; |
| 36 | 36 | |
| 37 | 37 | foreach ($this->arguments as $argument => $value) { |
| 38 | - if (! is_string($argument)) { |
|
| 38 | + if (!is_string($argument)) { |
|
| 39 | 39 | continue; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public static function makeUploadedFile(array $spec): UploadedFile |
| 65 | 65 | { |
| 66 | - if (! isset($spec['tmp_name']) || ! isset($spec['size']) || ! isset($spec['error'])) { |
|
| 66 | + if (!isset($spec['tmp_name']) || !isset($spec['size']) || !isset($spec['error'])) { |
|
| 67 | 67 | throw new InvalidArgumentException(sprintf( |
| 68 | 68 | '$spec fourni à %s DOIT contenir chacune des clés "tmp_name", "size", et "error" ; une ou plusieurs étaient manquantes', |
| 69 | 69 | __FUNCTION__ |
@@ -103,13 +103,13 @@ discard block |
||
| 103 | 103 | * |
| 104 | 104 | * @return array[]|UploadedFile[] |
| 105 | 105 | */ |
| 106 | - $recursiveNormalize = static function ( |
|
| 106 | + $recursiveNormalize = static function( |
|
| 107 | 107 | array $tmpNameTree, |
| 108 | 108 | array $sizeTree, |
| 109 | 109 | array $errorTree, |
| 110 | 110 | ?array $nameTree = null, |
| 111 | 111 | ?array $typeTree = null |
| 112 | - ) use (&$recursiveNormalize): array { |
|
| 112 | + ) use (&$recursiveNormalize) : array { |
|
| 113 | 113 | $normalized = []; |
| 114 | 114 | |
| 115 | 115 | foreach ($tmpNameTree as $key => $value) { |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | * |
| 148 | 148 | * @return UploadedFile[] |
| 149 | 149 | */ |
| 150 | - $normalizeUploadedFileSpecification = static function (array $files = []) use (&$recursiveNormalize): array { |
|
| 150 | + $normalizeUploadedFileSpecification = static function(array $files = []) use (&$recursiveNormalize): array { |
|
| 151 | 151 | if ( |
| 152 | - ! isset($files['tmp_name']) || ! is_array($files['tmp_name']) |
|
| 153 | - || ! isset($files['size']) || ! is_array($files['size']) |
|
| 154 | - || ! isset($files['error']) || ! is_array($files['error']) |
|
| 152 | + !isset($files['tmp_name']) || !is_array($files['tmp_name']) |
|
| 153 | + || !isset($files['size']) || !is_array($files['size']) |
|
| 154 | + || !isset($files['error']) || !is_array($files['error']) |
|
| 155 | 155 | ) { |
| 156 | 156 | throw new InvalidArgumentException(sprintf( |
| 157 | 157 | 'Les fichiers fournis à %s DOIVENT contenir chacune des clés "tmp_name", "size" et "error", |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $input = $this->all(); |
| 88 | 88 | |
| 89 | 89 | foreach ($keys as $value) { |
| 90 | - if (! Arr::has($input, $value)) { |
|
| 90 | + if (!Arr::has($input, $value)) { |
|
| 91 | 91 | return false; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $keys = is_array($key) ? $key : func_get_args(); |
| 150 | 150 | |
| 151 | 151 | foreach ($keys as $value) { |
| 152 | - if (! $this->isEmptyString($value)) { |
|
| 152 | + if (!$this->isEmptyString($value)) { |
|
| 153 | 153 | return false; |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | { |
| 199 | 199 | $keys = is_array($key) ? $key : func_get_args(); |
| 200 | 200 | |
| 201 | - return ! $this->has($keys); |
|
| 201 | + return !$this->has($keys); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | /** |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | { |
| 227 | 227 | $value = $this->input($key); |
| 228 | 228 | |
| 229 | - return ! is_bool($value) && ! is_array($value) && trim((string) $value) === ''; |
|
| 229 | + return !is_bool($value) && !is_array($value) && trim((string) $value) === ''; |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /** |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | { |
| 247 | 247 | $input = array_replace_recursive($this->input(), $this->allFiles()); |
| 248 | 248 | |
| 249 | - if (! $keys) { |
|
| 249 | + if (!$keys) { |
|
| 250 | 250 | return $input; |
| 251 | 251 | } |
| 252 | 252 | |
@@ -341,9 +341,9 @@ discard block |
||
| 341 | 341 | public function enum(string $key, $enumClass) |
| 342 | 342 | { |
| 343 | 343 | if ($this->isNotFilled($key) |
| 344 | - || ! function_exists('enum_exists') |
|
| 345 | - || ! enum_exists($enumClass) |
|
| 346 | - || ! method_exists($enumClass, 'tryFrom')) { |
|
| 344 | + || !function_exists('enum_exists') |
|
| 345 | + || !enum_exists($enumClass) |
|
| 346 | + || !method_exists($enumClass, 'tryFrom')) { |
|
| 347 | 347 | return null; |
| 348 | 348 | } |
| 349 | 349 | |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | */ |
| 458 | 458 | public function hasFile(string $key): bool |
| 459 | 459 | { |
| 460 | - if (! is_array($files = $this->file($key))) { |
|
| 460 | + if (!is_array($files = $this->file($key))) { |
|
| 461 | 461 | $files = [$files]; |
| 462 | 462 | } |
| 463 | 463 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $override = true; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if ($override && ! in_array($request->getMethod(), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
| 99 | + if ($override && !in_array($request->getMethod(), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
| 100 | 100 | $parsedBody = []; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $request = $request->withUploadedFiles($files); |
| 115 | 115 | |
| 116 | 116 | $parsedBody = $request->getParsedBody(); |
| 117 | - if (! is_array($parsedBody)) { |
|
| 117 | + if (!is_array($parsedBody)) { |
|
| 118 | 118 | return $request; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | // Si la valeur HTTP_AUTHORIZATION est déjà définie, ou si le callback n'est pas appelable, nous renvoyons les parameters server sans changements |
| 171 | - if (isset($server['HTTP_AUTHORIZATION']) || ! is_callable($apacheRequestHeaderCallback)) { |
|
| 171 | + if (isset($server['HTTP_AUTHORIZATION']) || !is_callable($apacheRequestHeaderCallback)) { |
|
| 172 | 172 | return $server; |
| 173 | 173 | } |
| 174 | 174 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public function isCorsRequest(ServerRequestInterface $request): bool |
| 59 | 59 | { |
| 60 | - return $request->hasHeader('Origin') && ! $this->isSameHost($request); |
|
| 60 | + return $request->hasHeader('Origin') && !$this->isSameHost($request); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | public function isPreflightRequest(ServerRequestInterface $request): bool |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | return true; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - if (! $request->hasHeader('Origin')) { |
|
| 97 | + if (!$request->hasHeader('Origin')) { |
|
| 98 | 98 | return false; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -127,9 +127,9 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | public function varyHeader(ResponseInterface $response, $header): ResponseInterface |
| 129 | 129 | { |
| 130 | - if (! $response->hasHeader('Vary')) { |
|
| 130 | + if (!$response->hasHeader('Vary')) { |
|
| 131 | 131 | $response = $response->withHeader('Vary', $header); |
| 132 | - } elseif (! in_array($header, explode(', ', $response->getHeaderLine('Vary')), true)) { |
|
| 132 | + } elseif (!in_array($header, explode(', ', $response->getHeaderLine('Vary')), true)) { |
|
| 133 | 133 | $response = $response->withHeader('Vary', $response->getHeaderLine('Vary') . ', ' . $header); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | protected function configureAllowedOrigin(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface |
| 140 | 140 | { |
| 141 | - if ($this->options['allowedOrigins'] === true && ! $this->options['supportsCredentials']) { |
|
| 141 | + if ($this->options['allowedOrigins'] === true && !$this->options['supportsCredentials']) { |
|
| 142 | 142 | // Sûr+cacheable, tout autoriser |
| 143 | 143 | $response = $response->withHeader('Access-Control-Allow-Origin', '*'); |
| 144 | 144 | } elseif ($this->isSingleOriginAllowed()) { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | protected function isSingleOriginAllowed(): bool |
| 160 | 160 | { |
| 161 | - if ($this->options['allowedOrigins'] === true || ! empty($this->options['allowedOriginsPatterns'])) { |
|
| 161 | + if ($this->options['allowedOrigins'] === true || !empty($this->options['allowedOriginsPatterns'])) { |
|
| 162 | 162 | return false; |
| 163 | 163 | } |
| 164 | 164 | |
@@ -138,7 +138,7 @@ |
||
| 138 | 138 | $response = $this->cors->varyHeader($response, 'Access-Control-Request-Method'); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - if (! $response->hasHeader('Access-Control-Allow-Origin')) { |
|
| 141 | + if (!$response->hasHeader('Access-Control-Allow-Origin')) { |
|
| 142 | 142 | $response = $this->cors->addActualRequestHeaders($request, $response); |
| 143 | 143 | } |
| 144 | 144 | |