Skip to content

Fix implicit nullable parameter deprecations for PHP 8.4#52

Open
nige-one wants to merge 1 commit into
degdigital:masterfrom
nige-one:fix/php84-implicit-nullable
Open

Fix implicit nullable parameter deprecations for PHP 8.4#52
nige-one wants to merge 1 commit into
degdigital:masterfrom
nige-one:fix/php84-implicit-nullable

Conversation

@nige-one

@nige-one nige-one commented Jun 5, 2026

Copy link
Copy Markdown

PHP 8.4 deprecates implicitly nullable parameters (typed parameters with a null default but no explicit nullable type). Loading these classes on PHP 8.4 raises:

Deprecated Functionality: DEG\CustomReports\Model\GenericReportCollection::__construct(): Implicitly marking parameter $resourceConnection as nullable is deprecated, the explicit nullable type must be used instead

In Magento developer mode this deprecation is escalated to an exception by Magento\Framework\App\ErrorHandler, which breaks setup:di:compile (proxy/repository code generation reflects these constructors).

This PR adds the explicit ? nullable type to the four affected parameters:

  • Model/CustomReport.php: $resource, $resourceCollection
  • Model/GenericReportCollection.php: $connection, $resourceConnection

No behavior change — the explicit nullable type is identical to the previous implicit semantics and remains compatible with PHP 7.1+.

Related: #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant