| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | 4 | public function execute($command, callable $next) |
|
| 40 | { |
||
| 41 | 4 | if (!$command instanceof SelfExecutingCommand) { |
|
| 42 | 1 | return $next($command); |
|
| 43 | } |
||
| 44 | 3 | if (!method_exists($command, 'handle')) { |
|
| 45 | 1 | throw new CommandHasNoHandleMethodException('Command does not have handle method'); |
|
| 46 | } |
||
| 47 | 2 | return $this->container->call([$command, 'handle']); |
|
| 48 | } |
||
| 49 | } |
||
| 50 |