-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PHP 8.4] Explicitly mark nullable parameters #22693
Conversation
Did you use a tool to convert the params or did you do it manually? |
@@ -174,7 +174,7 @@ public function getPrettyPercentFromQuotient($value) | |||
* This parameter is not currently supported and subject to change. | |||
* @api | |||
*/ | |||
public function formatMetrics(DataTable $dataTable, Report $report = null, $metricsToFormat = null, $formatAll = false) | |||
public function formatMetrics(DataTable $dataTable, ?Report $report = null, $metricsToFormat = null, $formatAll = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's annoying we can't use mixed
or union type here yet, however it looks like this can be typed to array
based on its use?
@@ -174,7 +174,7 @@ public function getPrettyPercentFromQuotient($value) | |||
* This parameter is not currently supported and subject to change. | |||
* @api | |||
*/ | |||
public function formatMetrics(DataTable $dataTable, Report $report = null, $metricsToFormat = null, $formatAll = false) | |||
public function formatMetrics(DataTable $dataTable, ?Report $report = null, $metricsToFormat = null, $formatAll = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function formatMetrics(DataTable $dataTable, ?Report $report = null, $metricsToFormat = null, $formatAll = false) | |
public function formatMetrics(DataTable $dataTable, ?Report $report = null, ?array $metricsToFormat = null, $formatAll = false) |
@@ -61,7 +61,7 @@ class Updater | |||
* for the plugin name. | |||
* @param Columns\Updater|null $columnsUpdater The dimensions updater instance. | |||
*/ | |||
public function __construct($pathUpdateFileCore = null, $pathUpdateFilePlugins = null, Columns\Updater $columnsUpdater = null) | |||
public function __construct($pathUpdateFileCore = null, $pathUpdateFilePlugins = null, ?Columns\Updater $columnsUpdater = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function __construct($pathUpdateFileCore = null, $pathUpdateFilePlugins = null, ?Columns\Updater $columnsUpdater = null) | |
public function __construct(?string $pathUpdateFileCore = null, ?string $pathUpdateFilePlugins = null, ?Columns\Updater $columnsUpdater = null) |
@michalkleiner I actually used a regex to find those and fixed them manually. Might be possible that I missed some though. |
Implicit nullable typed value. Fair enough. |
Description:
With PHP 8.4 implicitly marking parameters as nullable by only setting null as default value is deprecated.
To get rid of all the deprecation notices caused by our code, this PR aims to change all occurrences to explicitly mark the parameters as nullable.
refs #22471
Review