@@ -186,7 +186,7 @@ |
||
186 | 186 | { |
187 | 187 | $callback = explode('@', $callback); |
188 | 188 | $method = isset($callback[1]) ? $callback[1] : 'handle'; |
189 | - if(class_exists($callback[0])) { |
|
189 | + if (class_exists($callback[0])) { |
|
190 | 190 | $instance = call_user_func($this->router->getConfig()['di'], $callback[0]); |
191 | 191 | if (method_exists($instance, $method)) { |
192 | 192 | $reflectionMethod = new ReflectionMethod($instance, $method); |
@@ -102,7 +102,9 @@ discard block |
||
102 | 102 | if (isset($this->middleware[$action]['global_middleware'])) { |
103 | 103 | foreach ($this->middleware[$action]['global_middleware'] as $callback) { |
104 | 104 | $response = $this->callHandler($callback); |
105 | - if ($response instanceof ResponseInterface) return $response; |
|
105 | + if ($response instanceof ResponseInterface) { |
|
106 | + return $response; |
|
107 | + } |
|
106 | 108 | } |
107 | 109 | } |
108 | 110 | return true; |
@@ -121,7 +123,9 @@ discard block |
||
121 | 123 | if (is_array($blocks)) { |
122 | 124 | foreach ($blocks as $block) { |
123 | 125 | $response = $this->callHandler($block); |
124 | - if ($response instanceof ResponseInterface) return $response; |
|
126 | + if ($response instanceof ResponseInterface) { |
|
127 | + return $response; |
|
128 | + } |
|
125 | 129 | } |
126 | 130 | } elseif (is_string($blocks)) { |
127 | 131 | return $this->callHandler($blocks); |
@@ -145,7 +149,9 @@ discard block |
||
145 | 149 | if (is_array($classes)) { |
146 | 150 | foreach ($classes as $class) { |
147 | 151 | $response = $this->callHandler($class); |
148 | - if ($response instanceof ResponseInterface) return $response; |
|
152 | + if ($response instanceof ResponseInterface) { |
|
153 | + return $response; |
|
154 | + } |
|
149 | 155 | } |
150 | 156 | } elseif (is_string($classes)) { |
151 | 157 | return $this->callHandler($classes); |
@@ -168,7 +174,9 @@ discard block |
||
168 | 174 | if (is_array($classes)) { |
169 | 175 | foreach ($classes as $class) { |
170 | 176 | $response = $this->callHandler($class); |
171 | - if ($response instanceof ResponseInterface) return $response; |
|
177 | + if ($response instanceof ResponseInterface) { |
|
178 | + return $response; |
|
179 | + } |
|
172 | 180 | } |
173 | 181 | } elseif (is_string($classes)) { |
174 | 182 | return $this->callHandler($classes); |