Problem/Motivation
PHP 8.4 has deprecated implicit nullable types.
Steps to reproduce
Use in a PHP 8.4 environment
Deprecated: Drupal\oembed_providers\OEmbed\ProviderRepositoryDecorator::__construct(): Implicitly marking parameter $key_value_factory as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/oembed_providers/src/OEmbed/ProviderRepositoryDecorator.php on line 116
Deprecated: Drupal\oembed_providers\OEmbed\ProviderRepositoryDecorator::__construct(): Implicitly marking parameter $logger_factory as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/oembed_providers/src/OEmbed/ProviderRepositoryDecorator.php on line 116
Issue fork oembed_providers-3528538
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
pcambraComment #4
pcambraComment #5
steinmb commentedLets try a keep PHP 8.4 happy, RTBC
Comment #6
chris burge commentedA number of tests are failing with the following output:
Test code or tested code printed unexpected output:
Deprecated: Optional parameter $key_value_factory declared before required parameter $module_handler is implicitly treated as a required parameter in /builds/issue/oembed_providers-3528538/src/OEmbed/ProviderRepositoryDecorator.php on line 116
Deprecated: Optional parameter $logger_factory declared before required parameter $module_handler is implicitly treated as a required parameter in /builds/issue/oembed_providers-3528538/src/OEmbed/ProviderRepositoryDecorator.php on line 116
The
ProviderRepositoryconstructor change in D10, and the$key_value_factoryand$logger_factoryparameters are no longer optional: __construct() in D10 vs __construct() in D9.D9 is no longer supported by this module, so all we need to do is make the parameters required:
Comment #8
liuyuanchao commented> D9 is no longer supported by this module, so all we need to do is make the parameters required:
You are right, I change the parameters not nullable, the phpunit passed.
And by the way, fix phpcs and phpstan warnings.
Please review.
Comment #10
chris burge commentedComment #12
pcambraCould we please get a release for this? thanks!
Comment #13
chris burge commentedReleased in 2.2.3.
Comment #14
pcambraThank you!!