Problem/Motivation
PHP 8.4 deprecates implicitly marking parameters as nullable. A fresh install of metatag results in deprecation warnings like this:
Deprecated: Drupal\metatag\MetatagToken::replace(): Implicitly marking parameter $bubbleable_metadata as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/metatag/src/MetatagToken.php on line 60
Deprecated: Drupal\metatag\MetatagManager::form(): Implicitly marking parameter $included_groups as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/metatag/src/MetatagManager.php on line 327
Deprecated: Drupal\metatag\MetatagManager::form(): Implicitly marking parameter $included_tags as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/metatag/src/MetatagManager.php on line 327
Deprecated: Drupal\metatag\MetatagManager::getDefaultMetatags(): Implicitly marking parameter $entity as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/metatag/src/MetatagManager.php on line 458
Deprecated: Drupal\metatag\MetatagManager::generateRawElements(): Implicitly marking parameter $cache as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/metatag/src/MetatagManager.php on line 582
This is fixed by the latest Drupal coding standards, but the phpcs issue for this module is stalled (#3484975: Resolve phpcs issues), so I'm creating a fix for only the nullable deprecation warning here.
Comments
Comment #3
ptmkenny commentedComment #4
nickdickinsonwildeworking for me, thanks
Comment #5
damienmckennaComment #6
klausiThank you! Here is the patch file for composer patches.
@damienmckenna can you merge and make a new release?
Comment #7
damienmckennaComment #9
damienmckennaCommitted. Thank you all.