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 Query) { |
||
36 | throw new InvalidQueryException(\sprintf( |
||
37 | 'Query must implement "%s" interface, "%s" given.', |
||
38 | Query::class, |
||
39 | \is_object($command) ? \get_class($command) : \gettype($command) |
||
40 | )); |
||
41 | } |
||
42 | |||
43 | if (!$handler instanceof QueryHandler) { |
||
44 | throw new InvalidQueryHandlerException(\sprintf( |
||
45 | 'Query handler must implement "%s" interface, "%s" given.', |
||
46 | QueryHandler::class, |
||
47 | \is_object($handler) ? \get_class($handler) : \gettype($handler) |
||
48 | )); |
||
49 | } |
||
50 | |||
51 | return 'handle'; |
||
52 | } |
||
54 |