diff --git a/core/lib/Drupal/Component/Datetime/Time.php b/core/lib/Drupal/Component/Datetime/Time.php index ec660094fc985c88d5c17948a80783ed38b54fe8..729c762f12a56d7754a62c03c0ed65bf432c20f6 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 065e301e52fbdea4daae08382ac340e8b2cc48fd..cb98bca41e82fea7b725b77bba61fb9deabf986d 100644 --- a/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php +++ b/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php @@ -464,7 +464,7 @@ protected function dumpValue($value) { * @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 a7099fbdb5e1e760820cb76e7325a0d2df4a5292..d6d1e37067eff06ff743eb6345ef2f425661ded8 100644 --- a/core/lib/Drupal/Component/Plugin/CategorizingPluginManagerInterface.php +++ b/core/lib/Drupal/Component/Plugin/CategorizingPluginManagerInterface.php @@ -25,7 +25,7 @@ public function getCategories(); * @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 @@ public function getSortedDefinitions(array $definitions = NULL); * 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 684f71afe9714fc7e27bfa4cacdacfc4db0b8e1f..10edb0265e014a85efeaae2bd8235f7d4cc33abb 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 7c0da9fe942e52e13df05d8a106366be98a12149..af87c4f8e2148f7b303d06fc61b014d8aa55be45 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 9e6a0a06cc02845dfe7fcf6804c2be2f94613680..f1345d03b1fd3344b590846df3578c612a944ee1 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 354d58183201f4c244c735e526499e1611914a69..6d6d8b9ef58a46a5ebd329662c57560b1d933453 100644 --- a/core/lib/Drupal/Component/Utility/NestedArray.php +++ b/core/lib/Drupal/Component/Utility/NestedArray.php @@ -358,7 +358,7 @@ public static function mergeDeepArray(array $arrays, $preserve_integer_keys = FA * @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 2c143cddf84b0b6339690db659cf859c05969c5f..9f584bbf5aa5a2173e1cdc8523a0f34976c8c485 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; }