1 | <?php |
||
16 | class Prompts |
||
17 | { |
||
18 | /** |
||
19 | * @var PromptInterface[] |
||
20 | */ |
||
21 | private $prompts; |
||
22 | |||
23 | /** |
||
24 | * @var Client |
||
25 | */ |
||
26 | private $github; |
||
27 | |||
28 | /** |
||
29 | * @var GitConfig |
||
30 | */ |
||
31 | private $gitConfig; |
||
32 | |||
33 | /** |
||
34 | * @var Inflector |
||
35 | */ |
||
36 | private $inflector; |
||
37 | |||
38 | 1 | public function __construct(GitConfig $gitConfig, Client $github, Inflector $inflector) |
|
39 | { |
||
40 | 1 | $this->github = $github; |
|
41 | 1 | $this->gitConfig = $gitConfig; |
|
42 | 1 | $this->inflector = $inflector; |
|
43 | |||
44 | 1 | $this->add('author_email', new AuthorEmailPrompt($this->gitConfig)); |
|
45 | 1 | $this->add('author_name', new AuthorNamePrompt($this->gitConfig)); |
|
46 | 1 | $this->add('bugs', new BugsPrompt($this->gitConfig, $this->github)); |
|
47 | 1 | $this->add('copyright', new CopyrightPrompt($this->gitConfig, $this->github)); |
|
48 | 1 | $this->add('description', new DescriptionPrompt($this->gitConfig, $this->github)); |
|
49 | 1 | $this->add('php_namespace', new PhpNamespacePrompt($this->gitConfig, $this->inflector)); |
|
50 | 1 | $this->add('package_name', new PackageNamePrompt($this->gitConfig)); |
|
51 | 1 | $this->add('slack_notification', new SlackNotificationPrompt()); |
|
52 | 1 | $this->add('title', new TitlePrompt($this->gitConfig, $this->github, $this->inflector)); |
|
53 | 1 | } |
|
54 | |||
55 | /** |
||
56 | * @return Client |
||
57 | */ |
||
58 | 1 | public function getGithub() |
|
62 | |||
63 | /** |
||
64 | * @return GitConfig |
||
65 | */ |
||
66 | 1 | public function getGitConfig() |
|
70 | |||
71 | /** |
||
72 | * @return Inflector |
||
73 | */ |
||
74 | 1 | public function getInflector() |
|
78 | |||
79 | /** |
||
80 | * @return Container |
||
81 | */ |
||
82 | 1 | public function get($name) |
|
86 | |||
87 | 1 | public function add($name, PromptInterface $prompt) |
|
91 | |||
92 | /** |
||
93 | * @param array $prompts |
||
94 | * @param OutputInterface $output |
||
95 | * @param DialogHelper $dialog |
||
96 | * @return array |
||
97 | */ |
||
98 | 1 | public function getValues(array $prompts, OutputInterface $output, DialogHelper $dialog) |
|
113 | } |
||
114 | |||
115 |