From 53e5973d7ad3263eb992bb62c09f22089299c1fc Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 31 Mar 2024 10:51:58 +0100 Subject: [PATCH] Fixes for PHP 8.4 deprecation --- .php-cs-fixer.dist.php | 1 + src/Command.php | 2 +- src/Exception/CommandException.php | 6 +++--- src/ServiceClient.php | 2 +- vendor-bin/php-cs-fixer/composer.json | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 800bad1..48dee73 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -5,6 +5,7 @@ ->setRules([ '@PHP71Migration:risky' => true, '@PHPUnit75Migration:risky' => true, + '@PSR12:risky' => true, '@Symfony' => true, 'declare_strict_types' => false, 'global_namespace_import' => false, diff --git a/src/Command.php b/src/Command.php index ded93b5..8157285 100644 --- a/src/Command.php +++ b/src/Command.php @@ -25,7 +25,7 @@ class Command implements CommandInterface public function __construct( $name, array $args = [], - HandlerStack $handlerStack = null + ?HandlerStack $handlerStack = null ) { $this->name = $name; $this->data = $args; diff --git a/src/Exception/CommandException.php b/src/Exception/CommandException.php index 89631f1..4a6d0a2 100644 --- a/src/Exception/CommandException.php +++ b/src/Exception/CommandException.php @@ -63,9 +63,9 @@ public static function fromPrevious(CommandInterface $command, \Exception $prev) public function __construct( $message, CommandInterface $command, - \Exception $previous = null, - RequestInterface $request = null, - ResponseInterface $response = null + ?\Exception $previous = null, + ?RequestInterface $request = null, + ?ResponseInterface $response = null ) { $this->command = $command; $this->request = $request; diff --git a/src/ServiceClient.php b/src/ServiceClient.php index 0bfb957..dfae721 100644 --- a/src/ServiceClient.php +++ b/src/ServiceClient.php @@ -49,7 +49,7 @@ public function __construct( HttpClient $httpClient, callable $commandToRequestTransformer, callable $responseToResultTransformer, - HandlerStack $commandHandlerStack = null + ?HandlerStack $commandHandlerStack = null ) { $this->httpClient = $httpClient; $this->commandToRequestTransformer = $commandToRequestTransformer; diff --git a/vendor-bin/php-cs-fixer/composer.json b/vendor-bin/php-cs-fixer/composer.json index 3e8c9df..049eacf 100644 --- a/vendor-bin/php-cs-fixer/composer.json +++ b/vendor-bin/php-cs-fixer/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^7.4 || ^8.0", - "friendsofphp/php-cs-fixer": "3.40.2" + "friendsofphp/php-cs-fixer": "3.52.1" }, "config": { "preferred-install": "dist"