mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-27 02:05:02 +02:00
[ticket/17496] Fix Implicitly marking parameters as nullable PHP deprecations
Also use union types consistently instead of question marks. Fixed with php-cs-fixer. PHPBB-17496
This commit is contained in:
@@ -73,10 +73,10 @@ class connection_factory
|
||||
public static function get_connection_from_params(
|
||||
string $driver,
|
||||
string $host,
|
||||
?string $user = null,
|
||||
?string $password = null,
|
||||
?string $name = null,
|
||||
?string $port = null): Connection
|
||||
string|null $user = null,
|
||||
string|null $password = null,
|
||||
string|null $name = null,
|
||||
string|null $port = null): Connection
|
||||
{
|
||||
$available_drivers = DriverManager::getAvailableDrivers();
|
||||
if (!in_array($driver, $available_drivers))
|
||||
|
@@ -37,11 +37,11 @@ class connection_parameter_factory
|
||||
*/
|
||||
public static function get_configuration(
|
||||
string $driver,
|
||||
?string $host = null,
|
||||
?string $user = null,
|
||||
?string $password = null,
|
||||
?string $name = null,
|
||||
?string $port = null) : array
|
||||
string|null $host = null,
|
||||
string|null $user = null,
|
||||
string|null $password = null,
|
||||
string|null $name = null,
|
||||
string|null $port = null) : array
|
||||
{
|
||||
$params = [
|
||||
'driver' => $driver,
|
||||
@@ -73,11 +73,11 @@ class connection_parameter_factory
|
||||
*/
|
||||
private static function build_connection_parameters(
|
||||
array $params,
|
||||
?string $host = null,
|
||||
?string $user = null,
|
||||
?string $password = null,
|
||||
?string $name = null,
|
||||
?string $port = null) : array
|
||||
string|null $host = null,
|
||||
string|null $user = null,
|
||||
string|null $password = null,
|
||||
string|null $name = null,
|
||||
string|null $port = null) : array
|
||||
{
|
||||
if ($params['driver'] === 'pdo_sqlite')
|
||||
{
|
||||
@@ -120,7 +120,7 @@ class connection_parameter_factory
|
||||
*
|
||||
* @return array Doctrine's DBAL configuration for SQLite.
|
||||
*/
|
||||
private static function build_sqlite_parameters(array $params, string $path, ?string $user, ?string $password) : array
|
||||
private static function build_sqlite_parameters(array $params, string $path, string|null $user, string|null $password) : array
|
||||
{
|
||||
$params['path'] = $path;
|
||||
|
||||
|
@@ -29,7 +29,7 @@ abstract class container_aware_migration extends migration implements ContainerA
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
public function setContainer(ContainerInterface|null $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
@@ -240,7 +240,7 @@ class schema_generator
|
||||
* @param mixed $data Array of values to be set.
|
||||
* @param callable|null $value_transform Callback to transform the value being set.
|
||||
*/
|
||||
private static function set_all(&$schema, $data, ?callable $value_transform = null)
|
||||
private static function set_all(&$schema, $data, callable|null $value_transform = null)
|
||||
{
|
||||
$data = (!is_array($data)) ? [$data] : $data;
|
||||
foreach ($data as $key => $change)
|
||||
@@ -317,7 +317,7 @@ class schema_generator
|
||||
*
|
||||
* @return Closure|null The value transformation callback or null if it is not needed.
|
||||
*/
|
||||
private static function get_value_transform(string $change_type, string $schema_type) : ?Closure
|
||||
private static function get_value_transform(string $change_type, string $schema_type) : Closure|null
|
||||
{
|
||||
if ($change_type !== 'add')
|
||||
{
|
||||
|
Reference in New Issue
Block a user