1 | <?php |
||
14 | abstract class BaseCommand extends Command |
||
15 | { |
||
16 | /** |
||
17 | * Reference to the stub manager. |
||
18 | * |
||
19 | * @var \Enzyme\Axiom\Console\Stubs\Manager |
||
20 | */ |
||
21 | protected $stub_manager; |
||
22 | |||
23 | /** |
||
24 | * The namespace this generated class falls under. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $namespace; |
||
29 | |||
30 | /** |
||
31 | * The location this generated class will be saved at. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $location; |
||
36 | |||
37 | /** |
||
38 | * The global configuration manager. |
||
39 | * |
||
40 | * @var \Enzyme\Axiom\Console\Config |
||
41 | */ |
||
42 | protected $config; |
||
43 | |||
44 | /** |
||
45 | * Instantiate a new command. |
||
46 | * |
||
47 | * @param \Enzyme\Axiom\Console\Stubs\Manager $stub_manager |
||
48 | * @param \Enzyme\Axiom\Console\Config $config |
||
49 | */ |
||
50 | public function __construct(StubManager $stub_manager, Config $config) |
||
59 | |||
60 | /** |
||
61 | * The generator type this class is handling, eg: "factory". |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | abstract protected function getGeneratorType(); |
||
66 | |||
67 | /** |
||
68 | * {@inheritDoc} |
||
69 | */ |
||
70 | protected function configure() |
||
95 | |||
96 | /** |
||
97 | * {@inheritDoc} |
||
98 | * |
||
99 | * @throws Exception If there is no namespace or location defined for the |
||
100 | * class type(s) being generated. |
||
101 | */ |
||
102 | protected function execute(InputInterface $input, OutputInterface $output) |
||
127 | |||
128 | /** |
||
129 | * Execute a generation command - make a single usuable Axiom class. If |
||
130 | * $dont_affix_type is true, do not add the class type to the end of the |
||
131 | * name, this is useful for models which generally are just named as they |
||
132 | * are and don't have "Model" affixed, eg: "User", not "UserModel". |
||
133 | * |
||
134 | * @param \Symfony\Component\Console\Input\InputInterface $input |
||
135 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
136 | * @param bool $dont_affix_type |
||
137 | */ |
||
138 | protected function executeGeneration( |
||
164 | |||
165 | /** |
||
166 | * Print the results of the generate operation to the console window. |
||
167 | * |
||
168 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
169 | * @param string $name |
||
170 | * @param bool $dont_affix_type |
||
171 | */ |
||
172 | protected function printResults( |
||
190 | } |
||
191 |