| @@ -50,20 +50,20 @@ discard block | ||
| 50 | 50 | */ | 
| 51 | 51 | public function process(string $controller, string $action, array $parameters, CoreInterface $core) | 
| 52 | 52 |      { | 
| 53 | -        foreach ($this->getDeclaredFilters($controller, $action) as $parameter => $filterClass) { | |
| 54 | -            if (isset($parameters[$parameter])) { | |
| 53 | +        foreach ($this->getDeclaredFilters($controller, $action) as $parameter => $filterClass){ | |
| 54 | +            if (isset($parameters[$parameter])){ | |
| 55 | 55 | continue; | 
| 56 | 56 | } | 
| 57 | 57 | |
| 58 | 58 | /** @var FilterInterface $filter */ | 
| 59 | 59 | $filter = $this->container->get($filterClass); | 
| 60 | 60 | |
| 61 | -            if (isset($parameters['@context'])) { | |
| 61 | +            if (isset($parameters['@context'])){ | |
| 62 | 62 | // other interceptors can define the validation contex | 
| 63 | 63 | $filter->setContext($parameters['@context']); | 
| 64 | 64 | } | 
| 65 | 65 | |
| 66 | -            if (!$filter->isValid()) { | |
| 66 | +            if (!$filter->isValid()){ | |
| 67 | 67 | return $this->renderInvalid($filter); | 
| 68 | 68 | } | 
| 69 | 69 | |
| @@ -81,11 +81,11 @@ discard block | ||
| 81 | 81 | */ | 
| 82 | 82 | protected function renderInvalid(FilterInterface $filter) | 
| 83 | 83 |      { | 
| 84 | -        if ($filter instanceof ShouldRenderErrors) { | |
| 84 | +        if ($filter instanceof ShouldRenderErrors){ | |
| 85 | 85 | return $filter->render(); | 
| 86 | 86 | } | 
| 87 | 87 | |
| 88 | -        switch ($this->strategy) { | |
| 88 | +        switch ($this->strategy){ | |
| 89 | 89 | case self::STRATEGY_JSON_RESPONSE: | 
| 90 | 90 | return [ | 
| 91 | 91 | 'status' => 400, | 
| @@ -104,25 +104,25 @@ discard block | ||
| 104 | 104 | private function getDeclaredFilters(string $controller, string $action): array | 
| 105 | 105 |      { | 
| 106 | 106 |          $key = sprintf('%s:%s', $controller, $action); | 
| 107 | -        if (array_key_exists($key, $this->cache)) { | |
| 107 | +        if (array_key_exists($key, $this->cache)){ | |
| 108 | 108 | return $this->cache[$key]; | 
| 109 | 109 | } | 
| 110 | 110 | |
| 111 | 111 | $this->cache[$key] = []; | 
| 112 | -        try { | |
| 112 | +        try{ | |
| 113 | 113 | $method = new \ReflectionMethod($controller, $action); | 
| 114 | -        } catch (\ReflectionException $e) { | |
| 114 | +        }catch (\ReflectionException $e){ | |
| 115 | 115 | return []; | 
| 116 | 116 | } | 
| 117 | 117 | |
| 118 | -        foreach ($method->getParameters() as $parameter) { | |
| 118 | +        foreach ($method->getParameters() as $parameter){ | |
| 119 | 119 | $class = $this->getParameterClass($parameter); | 
| 120 | 120 | |
| 121 | -            if ($class === null) { | |
| 121 | +            if ($class === null){ | |
| 122 | 122 | continue; | 
| 123 | 123 | } | 
| 124 | 124 | |
| 125 | -            if ($class->implementsInterface(FilterInterface::class)) { | |
| 125 | +            if ($class->implementsInterface(FilterInterface::class)){ | |
| 126 | 126 | $this->cache[$key][$parameter->getName()] = $class->getName(); | 
| 127 | 127 | } | 
| 128 | 128 | } | 
| @@ -140,11 +140,11 @@ discard block | ||
| 140 | 140 |      { | 
| 141 | 141 | $type = $parameter->getType(); | 
| 142 | 142 | |
| 143 | -        if (!$type instanceof \ReflectionNamedType) { | |
| 143 | +        if (!$type instanceof \ReflectionNamedType){ | |
| 144 | 144 | return null; | 
| 145 | 145 | } | 
| 146 | 146 | |
| 147 | -        if ($type->isBuiltin()) { | |
| 147 | +        if ($type->isBuiltin()){ | |
| 148 | 148 | return null; | 
| 149 | 149 | } | 
| 150 | 150 | |