mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-25 17:41:25 +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:
@@ -66,7 +66,7 @@ class environment extends \Twig\Environment
|
||||
* @param dispatcher_interface|null $phpbb_dispatcher Event dispatcher object
|
||||
* @param array $options Array of options to pass to Twig
|
||||
*/
|
||||
public function __construct(assets_bag $assets_bag, config $phpbb_config, filesystem $filesystem, path_helper $path_helper, $cache_path, manager $extension_manager = null, LoaderInterface $loader = null, dispatcher_interface $phpbb_dispatcher = null, $options = array())
|
||||
public function __construct(assets_bag $assets_bag, config $phpbb_config, filesystem $filesystem, path_helper $path_helper, $cache_path, manager|null $extension_manager = null, LoaderInterface|null $loader = null, dispatcher_interface|null $phpbb_dispatcher = null, $options = array())
|
||||
{
|
||||
$this->phpbb_config = $phpbb_config;
|
||||
|
||||
@@ -271,7 +271,7 @@ class environment extends \Twig\Environment
|
||||
* @return \Twig\Template A template instance representing the given template name
|
||||
* @throws \Twig\Error\LoaderError
|
||||
*/
|
||||
public function loadTemplate(string $cls, string $name, int $index = null) : \Twig\Template
|
||||
public function loadTemplate(string $cls, string $name, int|null $index = null) : \Twig\Template
|
||||
{
|
||||
if (strpos($name, '@') === false)
|
||||
{
|
||||
|
@@ -70,7 +70,7 @@ class avatar extends AbstractExtension
|
||||
*
|
||||
* @return string The avatar HTML for the specified mode
|
||||
*/
|
||||
public function get_avatar(environment $environment, string $mode, array $row, ?string $alt, ?bool $ignore_config, ?bool $lazy): string
|
||||
public function get_avatar(environment $environment, string $mode, array $row, string|null $alt, bool|null $ignore_config, bool|null $lazy): string
|
||||
{
|
||||
$alt = $alt ?? false;
|
||||
$ignore_config = $ignore_config ?? false;
|
||||
|
@@ -70,9 +70,9 @@ class twig extends \phpbb\template\base
|
||||
\phpbb\template\context $context,
|
||||
environment $twig_environment,
|
||||
$cache_path,
|
||||
\phpbb\user $user = null,
|
||||
\phpbb\user|null $user = null,
|
||||
$extensions = [],
|
||||
\phpbb\extension\manager $extension_manager = null
|
||||
\phpbb\extension\manager|null $extension_manager = null
|
||||
)
|
||||
{
|
||||
$this->path_helper = $path_helper;
|
||||
|
Reference in New Issue
Block a user