diff --git a/Command/CreateDatabaseDoctrineCommand.php b/Command/CreateDatabaseDoctrineCommand.php index 6f8248d88..76a5dd575 100644 --- a/Command/CreateDatabaseDoctrineCommand.php +++ b/Command/CreateDatabaseDoctrineCommand.php @@ -67,7 +67,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $params = $params['master']; } - $name = isset($params['path']) ? $params['path'] : (isset($params['dbname']) ? $params['dbname'] : false); + $hasPath = isset($params['path']); + $name = $hasPath ? $params['path'] : (isset($params['dbname']) ? $params['dbname'] : false); if (!$name) { throw new \InvalidArgumentException("Connection does not contain a 'path' or 'dbname' parameter and cannot be dropped."); } @@ -78,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $shouldNotCreateDatabase = $ifNotExists && in_array($name, $tmpConnection->getSchemaManager()->listDatabases()); // Only quote if we don't have a path - if (!isset($params['path'])) { + if (!$hasPath) { $name = $tmpConnection->getDatabasePlatform()->quoteSingleIdentifier($name); }