@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | $attributes = []; |
| 36 | 36 | foreach ($matches as $key => $value) { |
| 37 | - if (! (is_int($key) || '' === $value)) { |
|
| 37 | + if (!(is_int($key) || '' === $value)) { |
|
| 38 | 38 | $attributes[$key] = $value; |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $regex = '/{([0-9A-Za-z_]+)(?:<([^<#>]+)>)?}/'; |
| 40 | 40 | |
| 41 | - return preg_replace_callback($regex, function ($match) use ($path, $attributes, $strict) { |
|
| 41 | + return preg_replace_callback($regex, function($match) use ($path, $attributes, $strict) { |
|
| 42 | 42 | if (!isset($attributes[$match[1]])) { |
| 43 | 43 | throw new InvalidArgumentException( |
| 44 | 44 | sprintf('[%s] missing attribute "%s".', $path, $match[1]) |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $attributes[$match[1]] = (string) $attributes[$match[1]]; |
| 49 | 49 | |
| 50 | 50 | if ($strict && isset($match[2])) { |
| 51 | - if (!preg_match('#'.$match[2].'#u', $attributes[$match[1]])) { |
|
| 51 | + if (!preg_match('#' . $match[2] . '#u', $attributes[$match[1]])) { |
|
| 52 | 52 | throw new InvalidArgumentException( |
| 53 | 53 | sprintf('[%s] "%s" must match "%s".', $path, $match[1], $match[2]) |
| 54 | 54 | ); |
@@ -37,15 +37,15 @@ |
||
| 37 | 37 | preg_match_all('/{([0-9A-Za-z_]+)(?:<([^<#>]+)>)?}/', $path, $matches, PREG_SET_ORDER); |
| 38 | 38 | |
| 39 | 39 | foreach ($matches as $match) { |
| 40 | - $path = str_replace($match[0], '{'.$match[1].'}', $path); |
|
| 40 | + $path = str_replace($match[0], '{' . $match[1] . '}', $path); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $path = addcslashes($path, '#$*+-.?[\]^|'); |
| 44 | 44 | $path = str_replace(['(', ')'], ['(?:', ')?'], $path); |
| 45 | 45 | |
| 46 | 46 | foreach ($matches as $match) { |
| 47 | - $path = str_replace('{'.$match[1].'}', '(?<'.$match[1].'>'.($match[2] ?? '[^/]+').')', $path); |
|
| 47 | + $path = str_replace('{' . $match[1] . '}', '(?<' . $match[1] . '>' . ($match[2] ?? '[^/]+') . ')', $path); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - return '#^'.$path.'$#uD'; |
|
| 50 | + return '#^' . $path . '$#uD'; |
|
| 51 | 51 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public static function setUpBeforeClass() : void |
| 30 | 30 | { |
| 31 | - if (! class_exists('Route')) { |
|
| 31 | + if (!class_exists('Route')) { |
|
| 32 | 32 | class_alias(AnnotationRoute::class, 'Route'); |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | */ |
| 73 | 73 | public function handle(ServerRequestInterface $request) : ResponseInterface |
| 74 | 74 | { |
| 75 | - if (! $this->queue->isEmpty()) { |
|
| 75 | + if (!$this->queue->isEmpty()) { |
|
| 76 | 76 | return $this->queue->dequeue()->process($request, $this); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | $method = $request->getMethod(); |
| 86 | - if (! isset($routes[$method])) { |
|
| 86 | + if (!isset($routes[$method])) { |
|
| 87 | 87 | throw new MethodNotAllowedException( |
| 88 | 88 | array_keys($routes) |
| 89 | 89 | ); |