Skip to content

Commit

Permalink
Add missing iterator return type-hint (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Petar Obradović authored Nov 17, 2021
1 parent 258157a commit 977a2f3
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions Mapping/MappingCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace SofaScore\Purgatory\Mapping;

use Traversable;

class MappingCollection implements \IteratorAggregate, \Countable
{
/**
Expand All @@ -12,29 +10,15 @@ class MappingCollection implements \IteratorAggregate, \Countable
protected array $mappings = [];

/**
* (PHP 5 &gt;= 5.0.0)<br/>
* Retrieve an external iterator.
*
* @see http://php.net/manual/en/iteratoraggregate.getiterator.php
*
* @return Traversable An instance of an object implementing <b>Iterator</b> or
* <b>Traversable</b>
* {@inheritdoc}
*/
public function getIterator()
public function getIterator(): \Traversable
{
return new \ArrayIterator($this->mappings);
}

/**
* (PHP 5 &gt;= 5.1.0)<br/>
* Count elements of an object.
*
* @see http://php.net/manual/en/countable.count.php
*
* @return int The custom count as an integer.
* </p>
* <p>
* The return value is cast to an integer.
* {@inheritdoc}
*/
public function count(): int
{
Expand Down

0 comments on commit 977a2f3

Please sign in to comment.