@@ 22-39 (lines=18) @@ | ||
19 | * |
|
20 | * @author Ivannis Suárez Jerez <[email protected]> |
|
21 | */ |
|
22 | class FromCommandNamedResolver extends FromMessageNamedResolver |
|
23 | { |
|
24 | /** |
|
25 | * {@inheritdoc} |
|
26 | */ |
|
27 | public function resolve(MessageInterface $message) |
|
28 | { |
|
29 | if ($message instanceof CommandNamedInterface) { |
|
30 | return $message->named(); |
|
31 | } |
|
32 | ||
33 | throw new \InvalidArgumentException(sprintf( |
|
34 | 'The object of type %s should implement the %s interface', |
|
35 | get_class($message), |
|
36 | CommandNamedInterface::class |
|
37 | )); |
|
38 | } |
|
39 | } |
|
40 |
@@ 22-39 (lines=18) @@ | ||
19 | * |
|
20 | * @author Ivannis Suárez Jerez <[email protected]> |
|
21 | */ |
|
22 | class FromQueryNamedResolver extends FromMessageNamedResolver |
|
23 | { |
|
24 | /** |
|
25 | * {@inheritdoc} |
|
26 | */ |
|
27 | public function resolve(MessageInterface $message) |
|
28 | { |
|
29 | if ($message instanceof QueryNamedInterface) { |
|
30 | return $message->named(); |
|
31 | } |
|
32 | ||
33 | throw new \InvalidArgumentException(sprintf( |
|
34 | 'The object of type %s should implement the %s interface', |
|
35 | get_class($message), |
|
36 | QueryNamedInterface::class |
|
37 | )); |
|
38 | } |
|
39 | } |
|
40 |