@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | /** @var string|null $url */ |
45 | - $url = preg_replace_callback('~\{([^\}]+)\}~', function (array $matches) use (&$arguments) { |
|
45 | + $url = preg_replace_callback('~\{([^\}]+)\}~', function(array $matches) use (&$arguments) { |
|
46 | 46 | $argument = $matches[1]; |
47 | 47 | if (!array_key_exists($argument, $arguments)) { |
48 | 48 | throw new InvalidArgumentException('Missing parameter "' . $argument . '"'); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | return null; |
60 | 60 | } |
61 | 61 | |
62 | - $pattern = (new PatternReplacer())->replace($this->pattern, $this->tokens); |
|
62 | + $pattern = (new PatternReplacer())->replace($this->pattern, $this->tokens); |
|
63 | 63 | |
64 | 64 | $path = $request->getUri()->getPath(); |
65 | 65 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | public function replace(string $pattern, array $tokens): string |
12 | 12 | { |
13 | - return preg_replace_callback(self::REGEXP, function ($matches) use ($tokens) { |
|
13 | + return preg_replace_callback(self::REGEXP, function($matches) use ($tokens) { |
|
14 | 14 | $argument = $matches[1]; |
15 | 15 | $replace = $tokens[$argument] ?? '[^}]+'; |
16 | 16 | return '(?P<' . $argument . '>' . $replace . ')'; |