Skip to content
Snippets Groups Projects
Commit 458a68c2 authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[TASK] Avoid implicitly nullable class method parameter in `EXT:dashboard`

With PHP 8.4 marking method parameter implicitly nullable
is deprecated and will emit a `E_DEPRECATED` warning. One
recommended way to resolve this, is making it explicitly
nullable using the `?` nullable operator or adding a null
type to an union type definition. [1]

This prepares the way towards PHP 8.4 compatibility.

[1] https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated

Resolves: #104263
Releases: main, 12.4, 11.5
Change-Id: I7f132b2d3f7df9ba620b26656bbfca7fd038f32a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85015


Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarMogens Fiebrandt <mogens.fiebrandt@googlemail.com>
Tested-by: default avatarMogens Fiebrandt <mogens.fiebrandt@googlemail.com>
parent 6da39dc0
Branches
Tags
No related merge requests found
......@@ -83,7 +83,7 @@ class ServiceProvider extends AbstractServiceProvider
public static function configureDashboardPresetRegistry(
ContainerInterface $container,
DashboardPresetRegistry $dashboardPresetRegistry = null
?DashboardPresetRegistry $dashboardPresetRegistry = null
): DashboardPresetRegistry {
$dashboardPresetRegistry = $dashboardPresetRegistry ?? self::new($container, DashboardPresetRegistry::class);
$cache = $container->get('cache.core');
......@@ -111,7 +111,7 @@ class ServiceProvider extends AbstractServiceProvider
public static function configureWidgetGroupRegistry(
ContainerInterface $container,
WidgetGroupRegistry $widgetGroupRegistry = null
?WidgetGroupRegistry $widgetGroupRegistry = null
): WidgetGroupRegistry {
$widgetGroupRegistry = $widgetGroupRegistry ?? self::new($container, WidgetGroupRegistry::class);
$cache = $container->get('cache.core');
......@@ -158,10 +158,10 @@ class ServiceProvider extends AbstractServiceProvider
/**
* @param ContainerInterface $container
* @param ArrayObject $widgetGroups
* @param string $path supplied when invoked internally through PseudoServiceProvider
* @param string|null $path supplied when invoked internally through PseudoServiceProvider
* @return ArrayObject
*/
public static function configureWidgetGroups(ContainerInterface $container, ArrayObject $widgetGroups, string $path = null): ArrayObject
public static function configureWidgetGroups(ContainerInterface $container, ArrayObject $widgetGroups, ?string $path = null): ArrayObject
{
$paths = self::getPathsOfInstalledPackages();
......@@ -180,10 +180,10 @@ class ServiceProvider extends AbstractServiceProvider
/**
* @param ContainerInterface $container
* @param ArrayObject $widgets
* @param string $path supplied when invoked internally through PseudoServiceProvider
* @param string|null $path supplied when invoked internally through PseudoServiceProvider
* @return ArrayObject
*/
public static function configureWidgets(ContainerInterface $container, ArrayObject $widgets, string $path = null): ArrayObject
public static function configureWidgets(ContainerInterface $container, ArrayObject $widgets, ?string $path = null): ArrayObject
{
$paths = self::getPathsOfInstalledPackages();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment