1 | <?php |
||
27 | abstract class AbstractCommand extends Command implements ContainerAwareInterface |
||
28 | { |
||
29 | /** |
||
30 | * @var ContainerInterface|ContainerBuilder $container |
||
31 | */ |
||
32 | protected $container; |
||
33 | |||
34 | /** |
||
35 | * @var InputInterface $input |
||
36 | */ |
||
37 | protected $input; |
||
38 | |||
39 | /** |
||
40 | * @var OutputInterface $output |
||
41 | */ |
||
42 | protected $output; |
||
43 | |||
44 | /** |
||
45 | * @type HelperSet |
||
46 | */ |
||
47 | protected $helperSet; |
||
48 | |||
49 | /** |
||
50 | * @return int |
||
51 | */ |
||
52 | abstract protected function doExecute(); |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | final protected function execute(InputInterface $input, OutputInterface $output) |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function setContainer(ContainerInterface $container = null) |
||
76 | |||
77 | /** |
||
78 | * @param string $name |
||
79 | * @param EventInterface $event |
||
80 | * |
||
81 | * @return $this |
||
82 | */ |
||
83 | public function addEvent($name, EventInterface $event) |
||
89 | |||
90 | /** |
||
91 | * @return Application |
||
92 | */ |
||
93 | public function getApplication() |
||
97 | |||
98 | /** |
||
99 | * @return InputInterface |
||
100 | */ |
||
101 | public function getInput() |
||
105 | |||
106 | /** |
||
107 | * @param InputInterface $input |
||
108 | * |
||
109 | * @return $this |
||
110 | */ |
||
111 | protected function setInput(InputInterface $input) |
||
117 | |||
118 | /** |
||
119 | * @return OutputInterface |
||
120 | */ |
||
121 | public function getOutput() |
||
125 | |||
126 | /** |
||
127 | * @param OutputInterface $output |
||
128 | * |
||
129 | * @return $this |
||
130 | */ |
||
131 | protected function setOutput(OutputInterface $output) |
||
137 | |||
138 | /** |
||
139 | * @return HelperSet |
||
140 | */ |
||
141 | public function getHelperSet() |
||
145 | |||
146 | /** |
||
147 | * @param HelperSet $helperSet |
||
148 | * |
||
149 | * @return AbstractCommand |
||
150 | */ |
||
151 | public function setHelperSet(HelperSet $helperSet) |
||
157 | } |
||
158 |