@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @param string|null $contentType |
23 | 23 | */ |
24 | 24 | public function __construct( |
25 | - protected readonly Media|iterable|stdClass|string $media, |
|
25 | + protected readonly Media | iterable | stdClass | string $media, |
|
26 | 26 | IMapper $mapper, |
27 | 27 | ?string $contentType = null, |
28 | 28 | ) |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * Get response data |
35 | 35 | * @inheritDoc |
36 | 36 | */ |
37 | - public function getData(): iterable|stdClass|string |
|
37 | + public function getData(): iterable | stdClass | string |
|
38 | 38 | { |
39 | 39 | return ($this->media instanceof Media) |
40 | 40 | ? $this->media->getContent() |
@@ -27,7 +27,7 @@ |
||
27 | 27 | */ |
28 | 28 | public function __construct( |
29 | 29 | string $mask, |
30 | - array|string $metadata = [], |
|
30 | + array | string $metadata = [], |
|
31 | 31 | int $flags = IResourceRouter::CRUD |
32 | 32 | ) |
33 | 33 | { |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * @param Http\IRequest $httpRequest |
50 | 50 | * @return array<string, string>|null |
51 | 51 | */ |
52 | - public function match(Http\IRequest $httpRequest): ?array |
|
52 | + public function match(Http\IRequest $httpRequest) : ?array |
|
53 | 53 | { |
54 | 54 | $path = $httpRequest->getUrl()->getPathInfo(); |
55 | 55 | if (!str_contains($path, $this->prefix)) { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function __construct( |
39 | 39 | string $mask, |
40 | - array|string $metadata = [], |
|
40 | + array | string $metadata = [], |
|
41 | 41 | int $flags = IResourceRouter::GET |
42 | 42 | ) |
43 | 43 | { |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | protected static function formatActionName(string $action, array $parameters): string |
141 | 141 | { |
142 | - return Strings::replace($action, "@<([0-9a-zA-Z_-]+)>@i", function ($m) use ($parameters) { |
|
142 | + return Strings::replace($action, "@<([0-9a-zA-Z_-]+)>@i", function($m) use ($parameters) { |
|
143 | 143 | $key = strtolower((string) $m[1]); |
144 | 144 | return $parameters[$key] ?? ''; |
145 | 145 | }); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @param ReflectionClass<object>|ReflectionMethod $element |
56 | 56 | * @return void |
57 | 57 | */ |
58 | - public function checkRequirements(ReflectionClass|ReflectionMethod $element): void |
|
58 | + public function checkRequirements(ReflectionClass | ReflectionMethod $element): void |
|
59 | 59 | { |
60 | 60 | try { |
61 | 61 | parent::checkRequirements($element); |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $urlQuery = (array) $this->httpRequest->getQuery(); |
52 | 52 | $requestBody = $this->parseRequestBody(); |
53 | 53 | |
54 | - return array_merge($urlQuery, $postQuery, $requestBody); // $requestBody must be the last one!!! |
|
54 | + return array_merge($urlQuery, $postQuery, $requestBody); // $requestBody must be the last one!!! |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -71,7 +71,7 @@ |
||
71 | 71 | * @param Nette\Routing\RouteList|iterable<object> $routeList |
72 | 72 | * @return array<IResourceRouter> |
73 | 73 | */ |
74 | - private function getResourceRoutes(iterable|Nette\Routing\RouteList $routeList): array |
|
74 | + private function getResourceRoutes(iterable | Nette\Routing\RouteList $routeList): array |
|
75 | 75 | { |
76 | 76 | static $resourceRoutes = []; |
77 | 77 | $iter = is_object($routeList) && is_a($routeList, Nette\Routing\RouteList::class) |
@@ -113,7 +113,7 @@ |
||
113 | 113 | */ |
114 | 114 | public static function install(Configurator $configurator): void |
115 | 115 | { |
116 | - $configurator->onCompile[] = function ($configurator, $compiler): void { |
|
116 | + $configurator->onCompile[] = function($configurator, $compiler): void { |
|
117 | 117 | $compiler->addExtension('restful', new RestfulExtension); |
118 | 118 | }; |
119 | 119 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @return string |
25 | 25 | * |
26 | 26 | */ |
27 | - public function stringify(iterable|string|object $data, bool $prettyPrint = true): string |
|
27 | + public function stringify(iterable | string | object $data, bool $prettyPrint = true): string |
|
28 | 28 | { |
29 | 29 | if (!$data instanceof Media) { |
30 | 30 | throw new InvalidArgumentException( |