Update Composer packages

This commit is contained in:
Paul Nicoué 2023-04-14 16:34:06 +02:00
parent 67c3d8b307
commit 83cb211fe6
219 changed files with 6487 additions and 4444 deletions

View file

@ -16,23 +16,20 @@ use IteratorAggregate;
* @copyright Bastian Allgeier
* @license https://opensource.org/licenses/MIT
*
* @psalm-suppress MissingTemplateParam Implementing template params in this class would
* require implementing them throughout the code base
* https://github.com/getkirby/kirby/pull/4886#pullrequestreview-1203577545
* @psalm-suppress MissingTemplateParam Implementing template params
* in this class would require
* implementing them throughout
* the code base: https://github.com/getkirby/kirby/pull/4886#pullrequestreview-1203577545
*/
class Iterator implements IteratorAggregate
{
/**
* The data array
*
* @var array
*/
public $data = [];
public array $data = [];
/**
* Constructor
*
* @param array $data
*/
public function __construct(array $data = [])
{
@ -41,8 +38,6 @@ class Iterator implements IteratorAggregate
/**
* Get an iterator for the items.
*
* @return \ArrayIterator
*/
public function getIterator(): ArrayIterator
{
@ -51,18 +46,14 @@ class Iterator implements IteratorAggregate
/**
* Returns the current key
*
* @return string
*/
public function key()
public function key(): int|string|null
{
return key($this->data);
}
/**
* Returns an array of all keys
*
* @return array
*/
public function keys(): array
{
@ -71,8 +62,6 @@ class Iterator implements IteratorAggregate
/**
* Returns the current element
*
* @return mixed
*/
public function current()
{
@ -82,8 +71,6 @@ class Iterator implements IteratorAggregate
/**
* Moves the cursor to the previous element
* and returns it
*
* @return mixed
*/
public function prev()
{
@ -93,8 +80,6 @@ class Iterator implements IteratorAggregate
/**
* Moves the cursor to the next element
* and returns it
*
* @return mixed
*/
public function next()
{
@ -104,15 +89,13 @@ class Iterator implements IteratorAggregate
/**
* Moves the cursor to the first element
*/
public function rewind()
public function rewind(): void
{
reset($this->data);
}
/**
* Checks if the current element is valid
*
* @return bool
*/
public function valid(): bool
{
@ -121,8 +104,6 @@ class Iterator implements IteratorAggregate
/**
* Counts all elements
*
* @return int
*/
public function count(): int
{
@ -135,7 +116,7 @@ class Iterator implements IteratorAggregate
* @param mixed $needle the element to search for
* @return int|false the index (int) of the element or false
*/
public function indexOf($needle)
public function indexOf($needle): int|false
{
return array_search($needle, array_values($this->data));
}
@ -144,9 +125,9 @@ class Iterator implements IteratorAggregate
* Tries to find the key for the given element
*
* @param mixed $needle the element to search for
* @return string|false the name of the key or false
* @return int|string|false the name of the key or false
*/
public function keyOf($needle)
public function keyOf($needle): int|string|false
{
return array_search($needle, $this->data);
}
@ -155,18 +136,16 @@ class Iterator implements IteratorAggregate
* Checks by key if an element is included
*
* @param mixed $key
* @return bool
*/
public function has($key): bool
{
return isset($this->data[$key]);
return isset($this->data[$key]) === true;
}
/**
* Checks if the current key is set
*
* @param mixed $key the key to check
* @return bool
*/
public function __isset($key): bool
{
@ -175,8 +154,6 @@ class Iterator implements IteratorAggregate
/**
* Simplified var_dump output
*
* @return array
*/
public function __debugInfo(): array
{