diff --git a/core/lib/Drupal/Component/Datetime/Time.php b/core/lib/Drupal/Component/Datetime/Time.php index ec660094fc9..729c762f12a 100644 --- a/core/lib/Drupal/Component/Datetime/Time.php +++ b/core/lib/Drupal/Component/Datetime/Time.php @@ -31,7 +31,7 @@ class Time implements TimeInterface { * @param \Symfony\Component\HttpFoundation\RequestStack|null $request_stack * (Optional) The request stack. */ - public function __construct(RequestStack $request_stack = NULL) { + public function __construct(?RequestStack $request_stack = NULL) { $this->requestStack = $request_stack; } diff --git a/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php b/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php index d4d794139e5..b2a271a284f 100644 --- a/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php +++ b/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php @@ -469,7 +469,7 @@ class OptimizedPhpArrayDumper extends Dumper { * @return string|object * A suitable representation of the service reference. */ - protected function getReferenceCall($id, Reference $reference = NULL) { + protected function getReferenceCall($id, ?Reference $reference = NULL) { $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE; if ($reference !== NULL) { diff --git a/core/lib/Drupal/Component/Plugin/CategorizingPluginManagerInterface.php b/core/lib/Drupal/Component/Plugin/CategorizingPluginManagerInterface.php index a7099fbdb5e..d6d1e37067e 100644 --- a/core/lib/Drupal/Component/Plugin/CategorizingPluginManagerInterface.php +++ b/core/lib/Drupal/Component/Plugin/CategorizingPluginManagerInterface.php @@ -25,7 +25,7 @@ interface CategorizingPluginManagerInterface extends PluginManagerInterface { * @return array[] * An array of plugin definitions, sorted by category and label. */ - public function getSortedDefinitions(array $definitions = NULL); + public function getSortedDefinitions(?array $definitions = NULL); /** * Gets sorted plugin definitions grouped by category. @@ -41,6 +41,6 @@ interface CategorizingPluginManagerInterface extends PluginManagerInterface { * Keys are category names, and values are arrays of which the keys are * plugin IDs and the values are plugin definitions. */ - public function getGroupedDefinitions(array $definitions = NULL); + public function getGroupedDefinitions(?array $definitions = NULL); } diff --git a/core/lib/Drupal/Component/Plugin/Exception/InvalidPluginDefinitionException.php b/core/lib/Drupal/Component/Plugin/Exception/InvalidPluginDefinitionException.php index 684f71afe97..10edb0265e0 100644 --- a/core/lib/Drupal/Component/Plugin/Exception/InvalidPluginDefinitionException.php +++ b/core/lib/Drupal/Component/Plugin/Exception/InvalidPluginDefinitionException.php @@ -28,7 +28,7 @@ class InvalidPluginDefinitionException extends PluginException { * * @see \Exception */ - public function __construct($plugin_id, $message = '', $code = 0, \Exception $previous = NULL) { + public function __construct($plugin_id, $message = '', $code = 0, ?\Exception $previous = NULL) { $this->pluginId = $plugin_id; parent::__construct($message, $code, $previous); } diff --git a/core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php b/core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php index 7c0da9fe942..af87c4f8e21 100644 --- a/core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php +++ b/core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php @@ -21,7 +21,7 @@ class PluginNotFoundException extends PluginException { * * @see \Exception */ - public function __construct($plugin_id, $message = '', $code = 0, \Exception $previous = NULL) { + public function __construct($plugin_id, $message = '', $code = 0, ?\Exception $previous = NULL) { if (empty($message)) { $message = sprintf("Plugin ID '%s' was not found.", $plugin_id); } diff --git a/core/lib/Drupal/Component/Utility/EmailValidator.php b/core/lib/Drupal/Component/Utility/EmailValidator.php index 9e6a0a06cc0..f1345d03b1f 100644 --- a/core/lib/Drupal/Component/Utility/EmailValidator.php +++ b/core/lib/Drupal/Component/Utility/EmailValidator.php @@ -23,7 +23,7 @@ class EmailValidator extends EmailValidatorUtility implements EmailValidatorInte * @return bool * TRUE if the address is valid. */ - public function isValid($email, EmailValidation $email_validation = NULL) { + public function isValid($email, ?EmailValidation $email_validation = NULL) { if ($email_validation) { throw new \BadMethodCallException('Calling \Drupal\Component\Utility\EmailValidator::isValid() with the second argument is not supported. See https://www.drupal.org/node/2997196'); } diff --git a/core/lib/Drupal/Component/Utility/NestedArray.php b/core/lib/Drupal/Component/Utility/NestedArray.php index 354d5818320..6d6d8b9ef58 100644 --- a/core/lib/Drupal/Component/Utility/NestedArray.php +++ b/core/lib/Drupal/Component/Utility/NestedArray.php @@ -358,7 +358,7 @@ class NestedArray { * @return array * The filtered array. */ - public static function filter(array $array, callable $callable = NULL) { + public static function filter(array $array, ?callable $callable = NULL) { $array = is_callable($callable) ? array_filter($array, $callable) : array_filter($array); foreach ($array as &$element) { if (is_array($element)) { diff --git a/core/lib/Drupal/Component/Utility/Xss.php b/core/lib/Drupal/Component/Utility/Xss.php index 2c143cddf84..9f584bbf5aa 100644 --- a/core/lib/Drupal/Component/Utility/Xss.php +++ b/core/lib/Drupal/Component/Utility/Xss.php @@ -56,7 +56,7 @@ class Xss { * * @ingroup sanitization */ - public static function filter($string, array $allowed_html_tags = NULL) { + public static function filter($string, ?array $allowed_html_tags = NULL) { if (is_null($allowed_html_tags)) { $allowed_html_tags = static::$htmlTags; }