Conditions | 4 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.128 |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
38 | 7 | public function proceed() |
|
39 | { |
||
40 | 7 | if (isset($this->advices[$this->current])) { |
|
41 | 1 | return ($this->advices[$this->current++])->invoke($this); |
|
42 | } |
||
43 | |||
44 | // Fill the closure only once if it's empty |
||
45 | 7 | if ($this->closureToCall === null) { |
|
46 | 7 | $this->closureToCall = $this->reflectionMethod->getClosure($this->instance); |
|
47 | 7 | $this->previousInstance = $this->instance; |
|
48 | } |
||
49 | |||
50 | // Rebind the closure if instance was changed since last time |
||
51 | 7 | if ($this->previousInstance !== $this->instance) { |
|
52 | $this->closureToCall = $this->closureToCall->bindTo($this->instance, $this->reflectionMethod->class); |
||
53 | $this->previousInstance = $this->instance; |
||
54 | } |
||
55 | |||
56 | 7 | return ($this->closureToCall)(...$this->arguments); |
|
57 | } |
||
58 | } |
||
59 |