1 | <?php |
||
13 | class BotCommand extends Command implements AdapterInterface |
||
14 | { |
||
15 | private $adapter; |
||
16 | |||
17 | /** |
||
18 | * @param ConsoleAdapter $adapter |
||
19 | * @param string $name |
||
20 | */ |
||
21 | 6 | public function __construct(ConsoleAdapter $adapter, $name = 'bot_command') |
|
22 | { |
||
23 | 6 | parent::__construct($name); |
|
24 | |||
25 | 6 | $this->adapter = $adapter; |
|
26 | 6 | } |
|
27 | |||
28 | /** |
||
29 | * @param Mainframe $mainframe |
||
30 | * |
||
31 | * @return self |
||
32 | */ |
||
33 | 1 | public function setMainframe(Mainframe $mainframe) |
|
34 | { |
||
35 | 1 | $this->adapter->setMainframe($mainframe); |
|
36 | |||
37 | 1 | return $this; |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return \Crummy\Phlack\WebHook\Converter\ConverterInterface |
||
42 | */ |
||
43 | 1 | public function getConverter() |
|
47 | |||
48 | /** |
||
49 | * @param BotInterface $bot |
||
50 | * @param MatcherInterface|callable $matcher |
||
51 | * @param int $priority |
||
52 | * |
||
53 | * @return self |
||
54 | */ |
||
55 | 1 | public function attach(BotInterface $bot, $matcher = null, $priority = 0) |
|
56 | { |
||
57 | 1 | $this->adapter->attach($bot, $matcher, $priority); |
|
58 | |||
59 | 1 | return $this; |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | protected function execute(InputInterface $input, OutputInterface $output) |
||
69 | } |
||
70 |