Conditions | 4 |
Paths | 5 |
Total Lines | 24 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
20 | public function proceed() |
||
21 | { |
||
22 | if (isset($this->advices[$this->current])) { |
||
23 | /** @var $currentInterceptor \Go\Aop\Intercept\Interceptor */ |
||
24 | $currentInterceptor = $this->advices[$this->current++]; |
||
25 | |||
26 | return $currentInterceptor->invoke($this); |
||
27 | } |
||
28 | |||
29 | // Fill the closure only once if it's empty |
||
30 | if (!$this->closureToCall) { |
||
31 | $this->closureToCall = $this->reflectionMethod->getClosure($this->instance); |
||
32 | } |
||
33 | |||
34 | // Rebind the closure if instance was changed since last time |
||
35 | if ($this->previousInstance !== $this->instance) { |
||
36 | $this->closureToCall = $this->closureToCall->bindTo($this->instance, $this->reflectionMethod->class); |
||
37 | $this->previousInstance = $this->instance; |
||
38 | } |
||
39 | |||
40 | $closureToCall = $this->closureToCall; |
||
41 | |||
42 | return $closureToCall(...$this->arguments); |
||
43 | } |
||
44 | } |
||
45 |