Skip to content

Commit

Permalink
fix some deprecations in ItemList
Browse files Browse the repository at this point in the history
  • Loading branch information
jspaetzel committed Jul 9, 2022
1 parent 246d133 commit 26366f0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Micrometa/Ports/Item/ItemList.php
Expand Up @@ -91,7 +91,7 @@ public function current()
* @return void
* @api
*/
public function next()
public function next(): void
{
++$this->pointer;
}
Expand All @@ -102,7 +102,7 @@ public function next()
* @return int Position of the current element
* @api
*/
public function key()
public function key(): int
{
return $this->pointer;
}
Expand All @@ -113,7 +113,7 @@ public function key()
* @return boolean The current position is valid
* @api
*/
public function valid()
public function valid(): bool
{
return isset($this->items[$this->pointer]);
}
Expand All @@ -124,7 +124,7 @@ public function valid()
* @return void
* @api
*/
public function rewind()
public function rewind(): void
{
$this->pointer = 0;
}
Expand All @@ -137,7 +137,7 @@ public function rewind()
* @return boolean Offset exists
* @api
*/
public function offsetExists($offset)
public function offsetExists($offset): bool
{
return isset($this->items[$offset]);
}
Expand All @@ -164,7 +164,7 @@ public function offsetGet($offset)
*
* @api
*/
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
throw new RuntimeException(RuntimeException::IMMUTABLE_ITEM_LIST_STR, RuntimeException::IMMUTABLE_ITEM_LIST);
}
Expand All @@ -175,7 +175,7 @@ public function offsetSet($offset, $value)
* @param int $offset Offset
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
throw new RuntimeException(RuntimeException::IMMUTABLE_ITEM_LIST_STR, RuntimeException::IMMUTABLE_ITEM_LIST);
}
Expand Down Expand Up @@ -250,7 +250,7 @@ function (ItemInterface $item) use ($types) {
* @return int Number of items
* @api
*/
public function count()
public function count(): int
{
return count($this->items);
}
Expand Down

0 comments on commit 26366f0

Please sign in to comment.