Passed
Pull Request — master (#737)
by butschster
18:08 queued 05:08
created
src/Framework/Domain/FilterWithAttributeInterceptor.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,8 @@  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 48
             return $this->renderersCache[$filterClass]->render($filter);
48 49
         }
49 50
 
@@ -54,7 +55,8 @@  discard block
 block discarded – undo
54 55
     {
55 56
         parent::buildCache($parameter, $class, $key);
56 57
 
57
-        if (null !== ($renderWith = $this->reader->firstClassMetadata($class, RenderWith::class))) {
58
+        if (null !== ($renderWith = $this->reader->firstClassMetadata($class, RenderWith::class)))
59
+        {
58 60
             $this->renderersCache[$class->getName()] = $this->container->get($renderWith->getRenderer());
59 61
         }
60 62
     }
Please login to merge, or discard this patch.
src/Framework/Domain/FilterInterceptor.php 1 patch
Braces   +25 added lines, -12 removed lines patch added patch discarded remove patch
@@ -49,20 +49,24 @@  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
+        {
54
+            if (isset($parameters[$parameter]))
55
+            {
54 56
                 continue;
55 57
             }
56 58
 
57 59
             /** @var FilterInterface $filter */
58 60
             $filter = $this->container->get($filterClass);
59 61
 
60
-            if (isset($parameters['@context'])) {
62
+            if (isset($parameters['@context']))
63
+            {
61 64
                 // other interceptors can define the validation context
62 65
                 $filter->setContext($parameters['@context']);
63 66
             }
64 67
 
65
-            if (!$filter->isValid()) {
68
+            if (!$filter->isValid())
69
+            {
66 70
                 return $this->renderInvalid($filter);
67 71
             }
68 72
 
@@ -83,25 +87,32 @@  discard block
 block discarded – undo
83 87
     private function getDeclaredFilters(string $controller, string $action): array
84 88
     {
85 89
         $key = sprintf('%s:%s', $controller, $action);
86
-        if (array_key_exists($key, $this->cache)) {
90
+        if (array_key_exists($key, $this->cache))
91
+        {
87 92
             return $this->cache[$key];
88 93
         }
89 94
 
90 95
         $this->cache[$key] = [];
91
-        try {
96
+        try
97
+        {
92 98
             $method = new \ReflectionMethod($controller, $action);
93
-        } catch (\ReflectionException $e) {
99
+        }
100
+        catch (\ReflectionException $e)
101
+        {
94 102
             return [];
95 103
         }
96 104
 
97
-        foreach ($method->getParameters() as $parameter) {
105
+        foreach ($method->getParameters() as $parameter)
106
+        {
98 107
             $class = $this->getParameterClass($parameter);
99 108
 
100
-            if ($class === null) {
109
+            if ($class === null)
110
+            {
101 111
                 continue;
102 112
             }
103 113
 
104
-            if ($class->implementsInterface(FilterInterface::class)) {
114
+            if ($class->implementsInterface(FilterInterface::class))
115
+            {
105 116
                 $this->buildCache($parameter, $class, $key);
106 117
             }
107 118
         }
@@ -113,11 +124,13 @@  discard block
 block discarded – undo
113 124
     {
114 125
         $type = $parameter->getType();
115 126
 
116
-        if (!$type instanceof \ReflectionNamedType) {
127
+        if (!$type instanceof \ReflectionNamedType)
128
+        {
117 129
             return null;
118 130
         }
119 131
 
120
-        if ($type->isBuiltin()) {
132
+        if ($type->isBuiltin())
133
+        {
121 134
             return null;
122 135
         }
123 136
 
Please login to merge, or discard this patch.