Skip to content

Commit

Permalink
Merge pull request #162 from php-http/cs
Browse files Browse the repository at this point in the history
adjust to latest cs fixer rules
  • Loading branch information
dbu committed Mar 7, 2024
2 parents 1fb0e9b + 6039d7e commit 33555d9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion spec/Encoding/MemoryStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/Authentication/Matching.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
6 changes: 3 additions & 3 deletions src/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions src/Decorator/StreamDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Stream/BufferedStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 33555d9

Please sign in to comment.