fixes
This commit is contained in:
@@ -28,8 +28,7 @@ class CachingIterator extends \CachingIterator implements \Countable
|
||||
{
|
||||
use Nette\SmartObject;
|
||||
|
||||
/** @var int */
|
||||
private $counter = 0;
|
||||
private int $counter = 0;
|
||||
|
||||
|
||||
public function __construct($iterator)
|
||||
@@ -48,7 +47,7 @@ class CachingIterator extends \CachingIterator implements \Countable
|
||||
} elseif ($iterator instanceof \Traversable) {
|
||||
$iterator = new \IteratorIterator($iterator);
|
||||
} else {
|
||||
throw new Nette\InvalidArgumentException(sprintf('Invalid argument passed to %s; array or Traversable expected, %s given.', self::class, is_object($iterator) ? get_class($iterator) : gettype($iterator)));
|
||||
throw new Nette\InvalidArgumentException(sprintf('Invalid argument passed to %s; array or Traversable expected, %s given.', self::class, is_object($iterator) ? $iterator::class : gettype($iterator)));
|
||||
}
|
||||
|
||||
parent::__construct($iterator, 0);
|
||||
@@ -148,9 +147,8 @@ class CachingIterator extends \CachingIterator implements \Countable
|
||||
|
||||
/**
|
||||
* Returns the next key.
|
||||
* @return mixed
|
||||
*/
|
||||
public function getNextKey()
|
||||
public function getNextKey(): mixed
|
||||
{
|
||||
return $this->getInnerIterator()->key();
|
||||
}
|
||||
@@ -158,9 +156,8 @@ class CachingIterator extends \CachingIterator implements \Countable
|
||||
|
||||
/**
|
||||
* Returns the next element.
|
||||
* @return mixed
|
||||
*/
|
||||
public function getNextValue()
|
||||
public function getNextValue(): mixed
|
||||
{
|
||||
return $this->getInnerIterator()->current();
|
||||
}
|
||||
|
||||
3
vendor/nette/utils/src/Iterators/Mapper.php
vendored
3
vendor/nette/utils/src/Iterators/Mapper.php
vendored
@@ -27,8 +27,7 @@ class Mapper extends \IteratorIterator
|
||||
}
|
||||
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
public function current(): mixed
|
||||
{
|
||||
return ($this->callback)(parent::current(), parent::key());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user