Skip to content

Issue #3532497: Fix PHP 8.4 implicit nullable types

PHP 8.4 throws a deprecation error if a function/method parameter type has a default value of NULL while not being marked as a nullable type. This patch addresses all instances in the smart_ip module where this occurs:

  • \Drupal\smart_ip\SmartIP
  • \Drupal\smart_ip\SmartIPLocation
  • \Drupal\smart_ip\WebServiceUtilityInterface
  • \Drupal\smart_ip\WebServiceUtilityBase
  • ...and all classes that derive from \Drupal\smart_ip\WebServiceUtilityBase in the submodules. As the default value is part of the function signature, the NULL default has been included in the interface definition for WebServiceUtilityInterface's methods which its inheritors all use.

Explicit declaration of a nullable type is now a Drupal standard, but the phpcs ticket that addresses it is much larger and has been open for a year. This MR specifically addresses the code required for PHP 8.4 forward compatibility.

Merge request reports

Loading