Skip to content

Commit afa9f71

Browse files
authored
Merge pull request #286 from klausi/php-8.4-nullable
fix(php): Fix PHP 8.4 nullable types warnings
2 parents 7757faa + a6825d3 commit afa9f71

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/Drupal/Driver/Cores/AbstractCore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class AbstractCore implements CoreInterface {
3434
/**
3535
* {@inheritdoc}
3636
*/
37-
public function __construct($drupal_root, $uri = 'default', Random $random = NULL) {
37+
public function __construct($drupal_root, $uri = 'default', ?Random $random = NULL) {
3838
$this->drupalRoot = realpath($drupal_root);
3939
$this->uri = $uri;
4040
if (!isset($random)) {

src/Drupal/Driver/Cores/CoreInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface CoreInterface {
1919
* @param \Drupal\Component\Utility\Random $random
2020
* Random string generator.
2121
*/
22-
public function __construct($drupal_root, $uri = 'default', Random $random = NULL);
22+
public function __construct($drupal_root, $uri = 'default', ?Random $random = NULL);
2323

2424
/**
2525
* Return random generator.

src/Drupal/Driver/DrushDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class DrushDriver extends BaseDriver {
7878
* @throws \Drupal\Driver\Exception\BootstrapException
7979
* Thrown when a required parameter is missing.
8080
*/
81-
public function __construct($alias = NULL, $root_path = NULL, $binary = 'drush', Random $random = NULL) {
81+
public function __construct($alias = NULL, $root_path = NULL, $binary = 'drush', ?Random $random = NULL) {
8282
if (!empty($alias)) {
8383
// Trim off the '@' symbol if it has been added.
8484
$alias = ltrim($alias, '@');

src/Drupal/Driver/Exception/BootstrapException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class BootstrapException extends Exception {
1717
* @param \Exception $previous
1818
* Optional previous exception that was thrown.
1919
*/
20-
public function __construct($message, $code = 0, \Exception $previous = NULL) {
20+
public function __construct($message, $code = 0, ?\Exception $previous = NULL) {
2121
parent::__construct($message, NULL, $code, $previous);
2222
}
2323

src/Drupal/Driver/Exception/Exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ abstract class Exception extends \Exception {
2828
* @param \Exception $previous
2929
* Optional previous exception that was thrown.
3030
*/
31-
public function __construct($message, DriverInterface $driver = NULL, $code = 0, \Exception $previous = NULL) {
31+
public function __construct($message, ?DriverInterface $driver = NULL, $code = 0, ?\Exception $previous = NULL) {
3232
$this->driver = $driver;
3333

3434
parent::__construct($message, $code, $previous);

src/Drupal/Driver/Exception/UnsupportedDriverActionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class UnsupportedDriverActionException extends Exception {
2121
* @param \Exception $previous
2222
* Previous exception.
2323
*/
24-
public function __construct($template, DriverInterface $driver, $code = 0, \Exception $previous = NULL) {
24+
public function __construct($template, DriverInterface $driver, $code = 0, ?\Exception $previous = NULL) {
2525
$message = sprintf($template, get_class($driver));
2626

2727
parent::__construct($message, $driver, $code, $previous);

0 commit comments

Comments
 (0)