Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence deprecation warning about missing return type #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Exception/MultipleExceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function setExceptions($exceptions)
* @return Traversable An instance of an object implementing <b>Iterator</b> or
* <b>Traversable</b>
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return new \ArrayIterator($this->exceptions);
Expand Down
4 changes: 2 additions & 2 deletions src/Implementation/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ class Record implements RecordInterface
/**
* @param Header $header
* @param \DOMDocument $metadata
* @param \DOMDocument $about
* @param \DOMDocument|null $about
*/
public function __construct(Header $header, \DOMDocument $metadata, \DOMDocument $about = null)
public function __construct(Header $header, \DOMDocument $metadata, ?\DOMDocument $about = null)
{
$this->about = $about;
$this->header = $header;
Expand Down
10 changes: 5 additions & 5 deletions src/Interfaces/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Repository
* @return string the base URL of the repository
*/
public function getBaseUrl();

/**
* @return string
* the finest harvesting granularity supported by the repository. The legitimate values are
Expand Down Expand Up @@ -62,12 +62,12 @@ public function getRecord($metadataFormat, $identifier);
/**
* @param string $metadataFormat metadata format of the records to be fetch or null if only headers are fetched
* (listIdentifiers)
* @param \DateTime $from
* @param \DateTime $until
* @param \DateTime|null $from
* @param \DateTime|null $until
* @param string $set name of the set containing this record
* @return RecordList
*/
public function listRecords($metadataFormat = null, \DateTime $from = null, \DateTime $until = null, $set = null);
public function listRecords($metadataFormat = null, ?\DateTime $from = null, ?\DateTime $until = null, $set = null);

/**
* @param string $token
Expand All @@ -76,7 +76,7 @@ public function listRecords($metadataFormat = null, \DateTime $from = null, \Dat
public function listRecordsByToken($token);

/**
* @param string $identifier
* @param string|null $identifier
* @return MetadataFormatType[]
*/
public function listMetadataFormats($identifier = null);
Expand Down
6 changes: 3 additions & 3 deletions src/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Provider
private $params = [];

/**
* @var ServerRequestInterface
* @var ServerRequestInterface|null
*/
private $request;

Expand All @@ -103,9 +103,9 @@ class Provider

/**
* @param Repository $repository
* @param ServerRequestInterface $request
* @param ServerRequestInterface $request|null
*/
public function __construct(Repository $repository, ServerRequestInterface $request = null)
public function __construct(Repository $repository, ?ServerRequestInterface $request = null)
{
$this->repository = $repository;

Expand Down