PHP 8.4 Deprecation: explicit nullable type must be used

Created on 19 August 2025, 14 days ago

Problem/Motivation

Deprecated: Drupal\disqus\DisqusCommentManager::__construct(): Implicitly marking parameter $file_url_generator as nullable is deprecated, the explicit nullable type must be used instead in /app/web/modules/contrib/disqus/src/DisqusCommentManager.php on line 77

is displayed on content types where disqus commenting is disabled.

Reguardless PHP 8.4 best practices dictate we declare this as possibly being nullable. To extend the PHP compatibility for the must versions of PHP, we can use the PHP 7.1 added support for nullable types, which introduced the ?TYPE syntax to declare the types as nullable:

 public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, AccountInterface $current_user, ModuleHandlerInterface $module_handler, ConfigFactory $config_factory, ?FileUrlGeneratorInterface $file_url_generator = NULL) {
}
πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States generalredneck Texas, USA πŸ‡ΊπŸ‡Έ

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

Comments & Activities

Production build 0.71.5 2024