| Conditions | 5 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | public function inflect($command, $handler): string |
||
| 34 | { |
||
| 35 | if (!$command instanceof Command) { |
||
| 36 | throw new InvalidCommandException(\sprintf( |
||
| 37 | 'Command must implement "%s" interface, "%s" given.', |
||
| 38 | Command::class, |
||
| 39 | \is_object($command) ? \get_class($command) : \gettype($command) |
||
| 40 | )); |
||
| 41 | } |
||
| 42 | |||
| 43 | if (!$handler instanceof CommandHandler) { |
||
| 44 | throw new InvalidCommandHandlerException(\sprintf( |
||
| 45 | 'Command handler must implement "%s" interface, "%s" given.', |
||
| 46 | CommandHandler::class, |
||
| 47 | \is_object($handler) ? \get_class($handler) : \gettype($handler) |
||
| 48 | )); |
||
| 49 | } |
||
| 50 | |||
| 51 | return 'handle'; |
||
| 52 | } |
||
| 54 |