1 | <?php |
||
22 | class PostmanCollectionBuildCommand extends Command |
||
23 | { |
||
24 | /** |
||
25 | * @var CollectionGenerator |
||
26 | */ |
||
27 | private $collectionGenerator; |
||
28 | |||
29 | /** |
||
30 | * @var NormalizerInterface |
||
31 | */ |
||
32 | private $normalizer; |
||
33 | |||
34 | /** |
||
35 | * @var CommandParserChain |
||
36 | */ |
||
37 | private $commandParserChain; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $collectionName; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | */ |
||
47 | private $rootDir; |
||
48 | |||
49 | /** |
||
50 | * @param CollectionGenerator $collectionGenerator |
||
51 | * @param NormalizerInterface $normalizer |
||
52 | * @param CommandParserChain $commandParserChain |
||
53 | * @param string $collectionName |
||
54 | * @param string $rootDir |
||
55 | */ |
||
56 | public function __construct( |
||
57 | CollectionGenerator $collectionGenerator, |
||
58 | NormalizerInterface $normalizer, |
||
59 | CommandParserChain $commandParserChain, |
||
60 | $collectionName, |
||
61 | $rootDir |
||
62 | ) { |
||
63 | parent::__construct('postman:collection:build'); |
||
64 | |||
65 | $this->collectionGenerator = $collectionGenerator; |
||
66 | $this->normalizer = $normalizer; |
||
67 | $this->commandParserChain = $commandParserChain; |
||
68 | $this->collectionName = $collectionName; |
||
69 | $this->rootDir = $rootDir; |
||
70 | |||
71 | $this |
||
72 | ->setDescription('Build Postman collection') |
||
73 | ->setHelp(<<<EOT |
||
74 | The <info>postman:collection:build</info> command helps you generate a Postman |
||
75 | collection according to your project configuration: |
||
76 | |||
77 | <info>php app/console postman:collection:build</info> |
||
78 | |||
79 | If any of the options is missing, the command will ask for their values interactively. |
||
80 | If you want to disable any user interaction, use <comment>--no-interaction</comment>, |
||
81 | but don't forget to pass all required arguments. |
||
82 | EOT |
||
83 | ) |
||
84 | ; |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | */ |
||
90 | protected function interact(InputInterface $input, OutputInterface $output) |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | protected function execute(InputInterface $input, OutputInterface $output) |
||
114 | } |
||
115 |