diff --git a/phpBB/phpbb/db/doctrine/connection_parameter_factory.php b/phpBB/phpbb/db/doctrine/connection_parameter_factory.php index bf0a18f5e8..4899f916f4 100644 --- a/phpBB/phpbb/db/doctrine/connection_parameter_factory.php +++ b/phpBB/phpbb/db/doctrine/connection_parameter_factory.php @@ -25,7 +25,7 @@ class connection_parameter_factory * Returns configuration options for Doctrine DBAL. * * @param string $driver Driver name. - * @param string $host Hostname. + * @param string|null $host Hostname. * @param string|null $user Username. * @param string|null $password Password. * @param string|null $name Database name. @@ -37,7 +37,7 @@ class connection_parameter_factory */ public static function get_configuration( string $driver, - string $host, + ?string $host = null, ?string $user = null, ?string $password = null, ?string $name = null, @@ -61,7 +61,7 @@ class connection_parameter_factory * Build Doctrine configuration array. * * @param array $params Parameter array. - * @param string $host Database hostname. + * @param string|null $host Database hostname. * @param string|null $user Username. * @param string|null $password Password. * @param string|null $name Database name. @@ -73,7 +73,7 @@ class connection_parameter_factory */ private static function build_connection_parameters( array $params, - string $host, + ?string $host = null, ?string $user = null, ?string $password = null, ?string $name = null, @@ -86,7 +86,7 @@ class connection_parameter_factory ); } - if (empty($host) || empty($user) || empty($name)) + if (empty($user) || empty($name)) { throw new InvalidArgumentException('Required database parameter is not set.'); }