@@ -10,7 +10,7 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public static function encode( |
| 12 | 12 | mixed $data, |
| 13 | - int $flags = JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR |
|
| 13 | + int $flags = JSON_UNESCAPED_SLASHES|JSON_THROW_ON_ERROR |
|
| 14 | 14 | ): string { |
| 15 | 15 | if ($data instanceof Traversable) { |
| 16 | 16 | return json_encode(iterator_to_array($data), $flags); |
@@ -131,13 +131,13 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | /** @psalm-suppress RedundantPropertyInitializationCheck */ |
| 133 | 133 | if (!isset($this->attributes)) { |
| 134 | - $this->attributes = array_map(function ($attribute) { |
|
| 134 | + $this->attributes = array_map(function($attribute) { |
|
| 135 | 135 | return $attribute->newInstance(); |
| 136 | 136 | }, $reflector->getAttributes()); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | if ($filter) { |
| 140 | - return array_filter($this->attributes, function ($attribute) use ($filter) { |
|
| 140 | + return array_filter($this->attributes, function($attribute) use ($filter) { |
|
| 141 | 141 | return $attribute instanceof $filter; |
| 142 | 142 | }); |
| 143 | 143 | } |
@@ -202,11 +202,9 @@ discard block |
||
| 202 | 202 | try { |
| 203 | 203 | $args[$name] = match ((string)$param->getType()) { |
| 204 | 204 | 'int' => is_numeric($this->routeArgs[$name]) ? |
| 205 | - (int)$this->routeArgs[$name] : |
|
| 206 | - throw new RuntimeException($errMsg . "Cannot cast '{$name}' to int"), |
|
| 205 | + (int)$this->routeArgs[$name] : throw new RuntimeException($errMsg . "Cannot cast '{$name}' to int"), |
|
| 207 | 206 | 'float' => is_numeric($this->routeArgs[$name]) ? |
| 208 | - (float)$this->routeArgs[$name] : |
|
| 209 | - throw new RuntimeException($errMsg . "Cannot cast '{$name}' to float"), |
|
| 207 | + (float)$this->routeArgs[$name] : throw new RuntimeException($errMsg . "Cannot cast '{$name}' to float"), |
|
| 210 | 208 | 'string' => $this->routeArgs[$name], |
| 211 | 209 | default => $this->registry->resolveParam($param), |
| 212 | 210 | }; |