@@ -57,20 +57,20 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function process(string $controller, string $action, array $parameters, CoreInterface $core) |
| 59 | 59 | { |
| 60 | - foreach ($this->getDeclaredFilters($controller, $action) as $parameter => $filterClass) { |
|
| 61 | - if (isset($parameters[$parameter])) { |
|
| 60 | + foreach ($this->getDeclaredFilters($controller, $action) as $parameter => $filterClass){ |
|
| 61 | + if (isset($parameters[$parameter])){ |
|
| 62 | 62 | continue; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** @var FilterInterface $filter */ |
| 66 | 66 | $filter = $this->container->get($filterClass); |
| 67 | 67 | |
| 68 | - if (isset($parameters['@context'])) { |
|
| 68 | + if (isset($parameters['@context'])){ |
|
| 69 | 69 | // other interceptors can define the validation contex |
| 70 | 70 | $filter->setContext($parameters['@context']); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if (!$filter->isValid()) { |
|
| 73 | + if (!$filter->isValid()){ |
|
| 74 | 74 | return $this->renderInvalid($filter); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -99,28 +99,28 @@ discard block |
||
| 99 | 99 | private function getDeclaredFilters(string $controller, string $action): array |
| 100 | 100 | { |
| 101 | 101 | $key = sprintf('%s:%s', $controller, $action); |
| 102 | - if (array_key_exists($key, $this->cache)) { |
|
| 102 | + if (array_key_exists($key, $this->cache)){ |
|
| 103 | 103 | return $this->cache[$key]; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $this->cache[$key] = []; |
| 107 | - try { |
|
| 107 | + try{ |
|
| 108 | 108 | $method = new \ReflectionMethod($controller, $action); |
| 109 | - } catch (\ReflectionException $e) { |
|
| 109 | + }catch (\ReflectionException $e){ |
|
| 110 | 110 | return []; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - foreach ($method->getParameters() as $parameter) { |
|
| 113 | + foreach ($method->getParameters() as $parameter){ |
|
| 114 | 114 | $class = $this->getParameterClass($parameter); |
| 115 | 115 | |
| 116 | - if ($class === null) { |
|
| 116 | + if ($class === null){ |
|
| 117 | 117 | continue; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - if ($class->implementsInterface(FilterInterface::class)) { |
|
| 120 | + if ($class->implementsInterface(FilterInterface::class)){ |
|
| 121 | 121 | $this->cache[$key][$parameter->getName()] = $class->getName(); |
| 122 | 122 | |
| 123 | - if (null !== ($renderWith = $this->reader->firstClassMetadata($class, RenderWith::class))) { |
|
| 123 | + if (null !== ($renderWith = $this->reader->firstClassMetadata($class, RenderWith::class))){ |
|
| 124 | 124 | $this->renderersCache[$class->getName()] = $this->container->get($renderWith->getRenderer()); |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -139,11 +139,11 @@ discard block |
||
| 139 | 139 | { |
| 140 | 140 | $type = $parameter->getType(); |
| 141 | 141 | |
| 142 | - if (!$type instanceof \ReflectionNamedType) { |
|
| 142 | + if (!$type instanceof \ReflectionNamedType){ |
|
| 143 | 143 | return null; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - if ($type->isBuiltin()) { |
|
| 146 | + if ($type->isBuiltin()){ |
|
| 147 | 147 | return null; |
| 148 | 148 | } |
| 149 | 149 | |