New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update CreateDatabaseDoctrineCommand.php #798
Conversation
Setting the path dynamically, which is useful to switch between in memory and path based SQLite dbs, with an env var requires setting the key `path` on the params. Isset returns true in this case even if the path is empty. `!empty` is a better check with this in mind.
@@ -72,7 +72,7 @@ protected function execute(InputInterface $input, OutputInterface $output) | |||
} | |||
} | |||
|
|||
$hasPath = isset($params['path']); | |||
$hasPath = !empty($params['path']); |
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.
Could the same not be archived with "isset($params['path']) && $params['path'] !== ''" ?
That way we can avoid empty() :)
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 kind of change requires test additions
@themizzi Are you able to provide the needed changes? |
After taking another look, we've decided not to merge this. An empty path is very much valid in this context, which is why we use Luckily, Symfony 4.3 will ship with a |
Setting the path dynamically, which is useful to switch between in memory and path based SQLite dbs, with an env var requires setting the key
path
on the params. Isset returns true in this case even if the path is empty.!empty
is a better check with this in mind.