Skip to content

Compilation error: Implicitly marking parameter $resource as nullable is deprecated #77

@mjschenk

Description

@mjschenk

Module version: 1.0.52
Magento version: 2.4.8-p3
PHP version: PHP 8.4.6

/data/web/magento2/bin/magento setup:di:compile

Results in:

Compilation was started.
Repositories code generation... 1/9 [===>------------------------]  11% < 1 sec 58.0 MiBPHP Deprecated:  DHLParcel\Shipping\Model\Config\Backend\ImportRate::__construct(): Implicitly marking parameter $resource as nullable is deprecated, the explicit nullable type must be used instead in /data/web/magento2/vendor/dhlparcel/magento2-plugin/Model/Config/Backend/ImportRate.php on line 14
PHP Deprecated:  DHLParcel\Shipping\Model\Config\Backend\ImportRate::__construct(): Implicitly marking parameter $resourceCollection as nullable is deprecated, the explicit nullable type must be used instead in /data/web/magento2/vendor/dhlparcel/magento2-plugin/Model/Config/Backend/ImportRate.php on line 14
Plugin list generation... 9/9 [============================] 100% 35 secs 300.0 MiB

Source:

\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,

Fix:

        ?\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        ?\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions