Skip to content

Commit

Permalink
Match expected name in vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbowers committed Sep 7, 2018
1 parent 7c6f033 commit 6dcc93d
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->config_file = $this->config_path . '/config.json';

$this->config = [
'vendor' => null,
'vendor_namespace' => null,
'author_name' => null,
'author_username' => null,
'author_email' => null,
'vendor' => null,
'namespace_vendor' => null,
];

if (!$filesystem->exists($this->config_path)) {
Expand Down Expand Up @@ -73,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
case 'author_username':
$question = new Question("What is your username? [alexbowers]", "Alex Bowers");
break;
case 'vendor_namespace':
case 'namespace_vendor':
$question = new Question("What is your vendor namespace? [alexbowers]", "alexbowers");
$question->setNormalizer(function ($value) {
return str_replace(' ', '', $value);
Expand All @@ -95,7 +95,8 @@ protected function execute(InputInterface $input, OutputInterface $output)

$this->package = [
'package_name' => null,
'package_namespace' => null,
'package_description' => null,
'namespace_tool_name' => null,
];

foreach ($this->package as $package_option => $package_value) {
Expand All @@ -109,7 +110,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
return strtolower($value);
});
break;
case 'package_namespace':
case 'package_description':
$question = new Question("What is your package description? [My package description]", "My package description");
$question->setNormalizer(function ($value) {
$value = str_replace(' ', '-', $value);
return strtolower($value);
});
break;
case 'namespace_tool_name':
$question = new Question("What is your package namespace? [MyNovaPackage]", "MyNovaPackage");
$question->setNormalizer(function ($value) {
return str_replace(' ', '', $value);
Expand Down

0 comments on commit 6dcc93d

Please sign in to comment.