From 6039d7ea370f42fc071dd6636a743a79c7be04ff Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Thu, 7 Mar 2024 14:17:40 +0100 Subject: [PATCH] adjust to latest cs fixer rules --- spec/Encoding/MemoryStream.php | 2 +- src/Authentication/Matching.php | 2 +- src/Cookie.php | 6 +++--- src/Decorator/StreamDecorator.php | 5 +---- src/Stream/BufferedStream.php | 2 +- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/spec/Encoding/MemoryStream.php b/spec/Encoding/MemoryStream.php index a751b43..bd61cc3 100644 --- a/spec/Encoding/MemoryStream.php +++ b/spec/Encoding/MemoryStream.php @@ -103,7 +103,7 @@ public function getContents(): string return $this->read($this->size); } - public function getMetadata(string $key = null) + public function getMetadata(?string $key = null) { $metadata = stream_get_meta_data($this->resource); diff --git a/src/Authentication/Matching.php b/src/Authentication/Matching.php index 5c2f0f2..cbef52e 100644 --- a/src/Authentication/Matching.php +++ b/src/Authentication/Matching.php @@ -27,7 +27,7 @@ final class Matching implements Authentication */ private $matcher; - public function __construct(Authentication $authentication, callable $matcher = null) + public function __construct(Authentication $authentication, ?callable $matcher = null) { if (is_null($matcher)) { $matcher = function () { diff --git a/src/Cookie.php b/src/Cookie.php index c6eaf51..ecfbcda 100644 --- a/src/Cookie.php +++ b/src/Cookie.php @@ -73,7 +73,7 @@ public function __construct( $path = null, $secure = false, $httpOnly = false, - \DateTime $expires = null + ?\DateTime $expires = null ) { $this->validateName($name); $this->validateValue($value); @@ -109,7 +109,7 @@ public static function createWithoutValidation( $path = null, $secure = false, $httpOnly = false, - \DateTime $expires = null + ?\DateTime $expires = null ) { $cookie = new self('name', null, null, $domain, $path, $secure, $httpOnly, $expires); $cookie->name = $name; @@ -228,7 +228,7 @@ public function hasExpires() * * @return Cookie */ - public function withExpires(\DateTime $expires = null) + public function withExpires(?\DateTime $expires = null) { $new = clone $this; $new->expires = $expires; diff --git a/src/Decorator/StreamDecorator.php b/src/Decorator/StreamDecorator.php index 5a6bb2d..90d93b4 100644 --- a/src/Decorator/StreamDecorator.php +++ b/src/Decorator/StreamDecorator.php @@ -86,10 +86,7 @@ public function getContents(): string return $this->stream->getContents(); } - /** - * @return mixed - */ - public function getMetadata(string $key = null) + public function getMetadata(?string $key = null) { return $this->stream->getMetadata($key); } diff --git a/src/Stream/BufferedStream.php b/src/Stream/BufferedStream.php index 13fc06b..cf23fc7 100644 --- a/src/Stream/BufferedStream.php +++ b/src/Stream/BufferedStream.php @@ -209,7 +209,7 @@ public function getContents(): string return $read; } - public function getMetadata(string $key = null) + public function getMetadata(?string $key = null) { if (null === $this->resource) { if (null === $key) {