Passed
Pull Request — master (#737)
by butschster
18:08 queued 05:08
created
src/Framework/Domain/FilterWithAttributeInterceptor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         ReaderInterface $reader,
31 31
         ?RenderErrorsInterface $renderErrors = null,
32 32
         int $strategy = self::STRATEGY_JSON_RESPONSE
33
-    ) {
33
+    ){
34 34
         parent::__construct($container, $strategy, $renderErrors);
35 35
 
36 36
         $this->reader = $reader;
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $filterClass = get_class($filter);
45 45
 
46
-        if (isset($this->renderersCache[$filterClass])) {
46
+        if (isset($this->renderersCache[$filterClass])){
47 47
             return $this->renderersCache[$filterClass]->render($filter);
48 48
         }
49 49
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         parent::buildCache($parameter, $class, $key);
56 56
 
57
-        if (null !== ($renderWith = $this->reader->firstClassMetadata($class, RenderWith::class))) {
57
+        if (null !== ($renderWith = $this->reader->firstClassMetadata($class, RenderWith::class))){
58 58
             $this->renderersCache[$class->getName()] = $this->container->get($renderWith->getRenderer());
59 59
         }
60 60
     }
Please login to merge, or discard this patch.
src/Framework/Domain/FilterInterceptor.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         ContainerInterface $container,
39 39
         int $strategy = self::STRATEGY_JSON_RESPONSE,
40 40
         ?RenderErrorsInterface $renderErrors = null
41
-    ) {
41
+    ){
42 42
         $this->container = $container;
43 43
         $this->strategy = $strategy;
44 44
         $this->renderErrors = $renderErrors ?? new DefaultFilterErrorsRendererInterface($strategy);
@@ -49,20 +49,20 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function process(string $controller, string $action, array $parameters, CoreInterface $core)
51 51
     {
52
-        foreach ($this->getDeclaredFilters($controller, $action) as $parameter => $filterClass) {
53
-            if (isset($parameters[$parameter])) {
52
+        foreach ($this->getDeclaredFilters($controller, $action) as $parameter => $filterClass){
53
+            if (isset($parameters[$parameter])){
54 54
                 continue;
55 55
             }
56 56
 
57 57
             /** @var FilterInterface $filter */
58 58
             $filter = $this->container->get($filterClass);
59 59
 
60
-            if (isset($parameters['@context'])) {
60
+            if (isset($parameters['@context'])){
61 61
                 // other interceptors can define the validation context
62 62
                 $filter->setContext($parameters['@context']);
63 63
             }
64 64
 
65
-            if (!$filter->isValid()) {
65
+            if (!$filter->isValid()){
66 66
                 return $this->renderInvalid($filter);
67 67
             }
68 68
 
@@ -83,25 +83,25 @@  discard block
 block discarded – undo
83 83
     private function getDeclaredFilters(string $controller, string $action): array
84 84
     {
85 85
         $key = sprintf('%s:%s', $controller, $action);
86
-        if (array_key_exists($key, $this->cache)) {
86
+        if (array_key_exists($key, $this->cache)){
87 87
             return $this->cache[$key];
88 88
         }
89 89
 
90 90
         $this->cache[$key] = [];
91
-        try {
91
+        try{
92 92
             $method = new \ReflectionMethod($controller, $action);
93
-        } catch (\ReflectionException $e) {
93
+        }catch (\ReflectionException $e){
94 94
             return [];
95 95
         }
96 96
 
97
-        foreach ($method->getParameters() as $parameter) {
97
+        foreach ($method->getParameters() as $parameter){
98 98
             $class = $this->getParameterClass($parameter);
99 99
 
100
-            if ($class === null) {
100
+            if ($class === null){
101 101
                 continue;
102 102
             }
103 103
 
104
-            if ($class->implementsInterface(FilterInterface::class)) {
104
+            if ($class->implementsInterface(FilterInterface::class)){
105 105
                 $this->buildCache($parameter, $class, $key);
106 106
             }
107 107
         }
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
     {
114 114
         $type = $parameter->getType();
115 115
 
116
-        if (!$type instanceof \ReflectionNamedType) {
116
+        if (!$type instanceof \ReflectionNamedType){
117 117
             return null;
118 118
         }
119 119
 
120
-        if ($type->isBuiltin()) {
120
+        if ($type->isBuiltin()){
121 121
             return null;
122 122
         }
123 123
 
Please login to merge, or discard this patch.