@@ -67,8 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | $message = empty($this->tag) ? |
70 | - 'Unresolvable id: ' . $id : |
|
71 | - 'Unresolvable tagged id: ' . $this->tag . '::' . $id; |
|
70 | + 'Unresolvable id: ' . $id : 'Unresolvable tagged id: ' . $this->tag . '::' . $id; |
|
72 | 71 | |
73 | 72 | throw new NotFoundException($message); |
74 | 73 | } |
@@ -135,8 +134,7 @@ discard block |
||
135 | 134 | // If $paramName is emtpy an existing unbound entry should |
136 | 135 | // be found on first try. |
137 | 136 | return isset($this->entries[$id . $paramName]) ? |
138 | - $this->resolveEntry($this->entries[$id . $paramName]) : |
|
139 | - $this->get($id); |
|
137 | + $this->resolveEntry($this->entries[$id . $paramName]) : $this->get($id); |
|
140 | 138 | } |
141 | 139 | |
142 | 140 | protected function reifyAndReturn(Entry $entry, mixed $value): mixed |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | $reflector = new ReflectionFunction($this->closure); |
126 | 126 | |
127 | 127 | if (!isset($this->attributes)) { |
128 | - $this->attributes = array_map(function ($attribute) { |
|
128 | + $this->attributes = array_map(function($attribute) { |
|
129 | 129 | return $attribute->newInstance(); |
130 | 130 | }, $reflector->getAttributes()); |
131 | 131 | } |
132 | 132 | |
133 | 133 | if ($filter) { |
134 | - return array_filter($this->attributes, function ($attribute) use ($filter) { |
|
134 | + return array_filter($this->attributes, function($attribute) use ($filter) { |
|
135 | 135 | return $attribute instanceof $filter; |
136 | 136 | }); |
137 | 137 | } |
@@ -218,11 +218,9 @@ discard block |
||
218 | 218 | try { |
219 | 219 | $args[$name] = match ((string)$param->getType()) { |
220 | 220 | 'int' => is_numeric($this->routeArgs[$name]) ? |
221 | - (int)$this->routeArgs[$name] : |
|
222 | - throw new RuntimeException($errMsg . "Cannot cast '{$name}' to int"), |
|
221 | + (int)$this->routeArgs[$name] : throw new RuntimeException($errMsg . "Cannot cast '{$name}' to int"), |
|
223 | 222 | 'float' => is_numeric($this->routeArgs[$name]) ? |
224 | - (float)$this->routeArgs[$name] : |
|
225 | - throw new RuntimeException($errMsg . "Cannot cast '{$name}' to float"), |
|
223 | + (float)$this->routeArgs[$name] : throw new RuntimeException($errMsg . "Cannot cast '{$name}' to float"), |
|
226 | 224 | 'string' => $this->routeArgs[$name], |
227 | 225 | default => (new Resolver($this->registry))->resolveParam($param), |
228 | 226 | }; |