Passed
Pull Request — master (#370)
by Valentin
04:34
created
src/Framework/Domain/PipelineInterceptor.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
     public function process(string $controller, string $action, array $parameters, CoreInterface $core)
45 45
     {
46 46
         $annotation = $this->readAnnotation($controller, $action);
47
-        if ($core instanceof InterceptorPipeline && $annotation->skipNext) {
47
+        if ($core instanceof InterceptorPipeline && $annotation->skipNext){
48 48
             $this->cleanOriginalPipeline($core);
49 49
         }
50 50
 
51 51
         $pipeline = $this->getCachedPipeline($controller, $action, $annotation);
52
-        if (!empty($pipeline)) {
52
+        if (!empty($pipeline)){
53 53
             $core = $core instanceof InterceptorPipeline ? $core : new InterceptableCore($core);
54
-            foreach ($pipeline as $interceptor) {
54
+            foreach ($pipeline as $interceptor){
55 55
                 $core->addInterceptor($interceptor);
56 56
             }
57 57
         }
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
      */
67 67
     private function readAnnotation(string $controller, string $action): Pipeline
68 68
     {
69
-        try {
69
+        try{
70 70
             $method = new \ReflectionMethod($controller, $action);
71
-        } catch (\ReflectionException $e) {
71
+        }catch (\ReflectionException $e){
72 72
             return new Pipeline();
73 73
         }
74 74
 
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
 
88 88
         $oldInterceptors = $pipelineReflection->getValue($pipeline);
89 89
         $newInterceptors = [];
90
-        foreach ($oldInterceptors as $interceptor) {
90
+        foreach ($oldInterceptors as $interceptor){
91 91
             $newInterceptors[] = $interceptor;
92
-            if ($interceptor instanceof self) {
92
+            if ($interceptor instanceof self){
93 93
                 break;
94 94
             }
95 95
         }
96 96
 
97
-        if (count($newInterceptors) !== count($oldInterceptors)) {
97
+        if (count($newInterceptors) !== count($oldInterceptors)){
98 98
             $pipelineReflection->setValue($pipeline, $newInterceptors);
99 99
         }
100 100
         $pipelineReflection->setAccessible(false);
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     private function getCachedPipeline(string $controller, string $action, Pipeline $annotation): array
110 110
     {
111 111
         $key = "{$controller}:{$action}";
112
-        if (!array_key_exists($key, $this->cache)) {
112
+        if (!array_key_exists($key, $this->cache)){
113 113
             $this->cache[$key] = $this->extractAnnotationPipeline($annotation);
114 114
         }
115 115
 
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
     private function extractAnnotationPipeline(Pipeline $annotation): array
124 124
     {
125 125
         $interceptors = [];
126
-        foreach ($annotation->pipeline as $interceptor) {
127
-            try {
126
+        foreach ($annotation->pipeline as $interceptor){
127
+            try{
128 128
                 $interceptors[] = $this->container->get($interceptor);
129
-            } catch (\Throwable $e) {
129
+            }catch (\Throwable $e){
130 130
             }
131 131
         }
132 132
 
Please login to merge, or discard this patch.