| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 6 | public function update(\SplSubject $subject) |
|
| 18 | { |
||
| 19 | 6 | if (!$subject instanceof EventInterface) { |
|
| 20 | 2 | throw new \InvalidArgumentException('Command can only be attached to an event!'); |
|
| 21 | } |
||
| 22 | 4 | if (method_exists($this, '__invoke')) { |
|
| 23 | 2 | call_user_func_array($this, $subject->getInvokeArgs()); |
|
| 24 | 2 | } else { |
|
| 25 | 2 | throw new \Exception('Command should have at least one __invoke method'); |
|
| 26 | } |
||
| 27 | 2 | } |
|
| 28 | |||
| 39 |