1 | <?php |
||
10 | abstract class AbstractTemplatableCommand extends Command |
||
11 | { |
||
12 | const OPTION_TEMPLATE = 'template'; |
||
13 | |||
14 | /** @var ConfigurationLoaderInterface */ |
||
15 | private $configurationLoader; |
||
16 | |||
17 | /** |
||
18 | * @param ConfigurationLoaderInterface $configurationLoader |
||
19 | */ |
||
20 | public function __construct(ConfigurationLoaderInterface $configurationLoader) |
||
21 | { |
||
22 | parent::__construct(); |
||
23 | $this->configurationLoader = $configurationLoader; |
||
24 | } |
||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | protected function configure() |
||
29 | { |
||
30 | $this |
||
31 | ->addOption( |
||
32 | self::OPTION_TEMPLATE, |
||
33 | null, |
||
34 | InputOption::VALUE_REQUIRED, |
||
35 | 'Path of the json template file. Will be used as default values.' |
||
36 | ) |
||
37 | ; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return ConfigurationLoaderInterface |
||
42 | */ |
||
43 | public function getConfigurationLoader() |
||
47 | |||
48 | /** |
||
49 | * @param InputInterface $input |
||
50 | * |
||
51 | * @return null|Configuration |
||
52 | */ |
||
53 | protected function loadTemplateConfiguration(InputInterface $input) |
||
69 | } |
||
70 |