From 7c4062ebd48b26d94e119906ba3b1741b399cb55 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 26 Jun 2023 14:37:08 +0545 Subject: [PATCH] Apply cs-fixer and phpstan changes to make CI pass --- lib/Client.php | 6 ++---- lib/Message.php | 2 +- lib/Response.php | 2 +- lib/functions.php | 6 +++--- phpstan.neon | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/Client.php b/lib/Client.php index ef11d9e..f323237 100644 --- a/lib/Client.php +++ b/lib/Client.php @@ -301,8 +301,6 @@ public function setThrowExceptions(bool $throwExceptions): void * Adds a CURL setting. * * These settings will be included in every HTTP request. - * - * @param mixed $value */ public function addCurlSetting(int $name, $value): void { @@ -340,7 +338,7 @@ protected function doRequest(RequestInterface $request): ResponseInterface * * @var resource|null */ - private $curlHandle = null; + private $curlHandle; /** * Handler for curl_multi requests. @@ -349,7 +347,7 @@ protected function doRequest(RequestInterface $request): ResponseInterface * * @var resource|null */ - private $curlMultiHandle = null; + private $curlMultiHandle; /** * Has a list of curl handles, as well as their associated success and diff --git a/lib/Message.php b/lib/Message.php index 769e122..ff8139f 100644 --- a/lib/Message.php +++ b/lib/Message.php @@ -22,7 +22,7 @@ abstract class Message implements MessageInterface * * @var resource|string|callable|null */ - protected $body = null; + protected $body; /** * Contains the list of HTTP headers. diff --git a/lib/Response.php b/lib/Response.php index 934d724..19ac87b 100644 --- a/lib/Response.php +++ b/lib/Response.php @@ -101,7 +101,7 @@ class Response extends Message implements ResponseInterface * @param array|null $headers * @param resource|string|callable|null $body */ - public function __construct($status = 500, ?array $headers = null, $body = null) + public function __construct($status = 500, array $headers = null, $body = null) { if (null !== $status) { $this->setStatus($status); diff --git a/lib/functions.php b/lib/functions.php index c532dee..7ecb7ad 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -168,9 +168,9 @@ function negotiateContentType(?string $acceptHeaderValue, array $availableOption // Does this entry win? if ( - ($proposal['quality'] > $lastQuality) || - ($proposal['quality'] === $lastQuality && $specificity > $lastSpecificity) || - ($proposal['quality'] === $lastQuality && $specificity === $lastSpecificity && $optionIndex < $lastOptionIndex) + ($proposal['quality'] > $lastQuality) + || ($proposal['quality'] === $lastQuality && $specificity > $lastSpecificity) + || ($proposal['quality'] === $lastQuality && $specificity === $lastSpecificity && $optionIndex < $lastOptionIndex) ) { $lastQuality = $proposal['quality']; $lastSpecificity = $specificity; diff --git a/phpstan.neon b/phpstan.neon index d3b8e15..5802f6f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -12,7 +12,7 @@ parameters: path: lib/Client.php - message: "#^Left side of || is always false.$#" - count: 1 + count: 2 path: lib/Client.php - message: "#^Strict comparison using === between null and array will always evaluate to false.$#"