Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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