-
Notifications
You must be signed in to change notification settings - Fork 14
Fix install:git, make:database, update:env commands #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've added some comments/questions as a review 😄
src/Commands/Databases/Make.php
Outdated
@@ -27,6 +28,7 @@ public function configure() | |||
->addArgument('server', InputArgument::REQUIRED, 'The id of the server to create the database on.') | |||
->addOption('user', null, InputOption::VALUE_REQUIRED, 'The username of an (optional) database user to create.', null) | |||
->addOption('password', null, InputOption::VALUE_REQUIRED, 'The password of the database user. Required with "user".', null) | |||
->addOption('name', null, InputOption::VALUE_REQUIRED, 'The name of the database user.', null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually the name of the database to create, not the name of the database user 🙂
/** | ||
* @var array | ||
*/ | ||
protected $optionMap = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required when the keys are the same as the values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fillData()
returns an empty array in this case...
/** | ||
* @var array | ||
*/ | ||
protected $optionMap = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required when the keys are the same as the values.
src/Commands/BaseCommand.php
Outdated
@@ -87,7 +87,7 @@ protected function getFileContent(InputInterface $input, $option) | |||
return $filename; | |||
} | |||
|
|||
if ($filename && ftell(STDIN) === 0) { | |||
if ($filename && ftell(STDIN)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this? ftell()
returns the position of the pointer. I'd be happy to use ftell(STDIN) !== false
if you were looking for more type-safety here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree)
Thank you! |
Add necessary
optionMap
to some commands