Fix PHP 8.4 implicit nullable deprecation

Created on 20 August 2025, 10 days ago

Problem/Motivation

PHP 8.4 has been released, and this module is triggering a "use explicit nullable type" deprecation.

This is part of Drupal's coding standards now, but since the issues to fix phpcs in this module have stalled, I'm opening up this issue to fix this single deprecation to avoid the warnings on PHP 8.4.

After updating to PHP 8.4:

PHP Deprecated:  Drupal\social_media\Plugin\Field\FieldType\SocialMediaItem::getPossibleValues(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/social_media/src/Plugin/Field/FieldType/SocialMediaItem.php on line 88

Deprecated: Drupal\social_media\Plugin\Field\FieldType\SocialMediaItem::getPossibleValues(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/social_media/src/Plugin/Field/FieldType/SocialMediaItem.php on line 88
PHP Deprecated:  Drupal\social_media\Plugin\Field\FieldType\SocialMediaItem::getPossibleOptions(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/social_media/src/Plugin/Field/FieldType/SocialMediaItem.php on line 95

Deprecated: Drupal\social_media\Plugin\Field\FieldType\SocialMediaItem::getPossibleOptions(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/social_media/src/Plugin/Field/FieldType/SocialMediaItem.php on line 95
PHP Deprecated:  Drupal\social_media\Plugin\Field\FieldType\SocialMediaItem::getSettableValues(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/social_media/src/Plugin/Field/FieldType/SocialMediaItem.php on line 105

Deprecated: Drupal\social_media\Plugin\Field\FieldType\SocialMediaItem::getSettableValues(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/social_media/src/Plugin/Field/FieldType/SocialMediaItem.php on line 105
PHP Deprecated:  Drupal\social_media\Plugin\Field\FieldType\SocialMediaItem::getSettableOptions(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/social_media/src/Plugin/Field/FieldType/SocialMediaItem.php on line 112

Deprecated: Drupal\social_media\Plugin\Field\FieldType\SocialMediaItem::getSettableOptions(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/social_media/src/Plugin/Field/FieldType/SocialMediaItem.php on line 112

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΎUruguay ruby232 Montevideo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024