Skip to content

Commit 26ace80

Browse files
authored
Merge pull request #103 from myworkout/main
Improve PHP 8.1.0 support
2 parents bf015b2 + ee5bf2c commit 26ace80

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/IterableImplementation.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ trait IterableImplementation
66
{
77
protected $position = 0;
88

9-
public function offsetGet($offset)
9+
public function offsetGet(mixed $offset): mixed
1010
{
1111
return $this->periods[$offset] ?? null;
1212
}
1313

14-
public function offsetSet($offset, $value)
14+
public function offsetSet(mixed $offset, mixed $value): void
1515
{
1616
if (is_null($offset)) {
1717
$this->periods[] = $value;
@@ -22,32 +22,32 @@ public function offsetSet($offset, $value)
2222
$this->periods[$offset] = $value;
2323
}
2424

25-
public function offsetExists($offset)
25+
public function offsetExists(mixed $offset): bool
2626
{
2727
return array_key_exists($offset, $this->periods);
2828
}
2929

30-
public function offsetUnset($offset)
30+
public function offsetUnset(mixed $offset): void
3131
{
3232
unset($this->periods[$offset]);
3333
}
3434

35-
public function next()
35+
public function next(): void
3636
{
3737
$this->position++;
3838
}
3939

40-
public function key()
40+
public function key(): mixed
4141
{
4242
return $this->position;
4343
}
4444

45-
public function valid()
45+
public function valid(): bool
4646
{
4747
return array_key_exists($this->position, $this->periods);
4848
}
4949

50-
public function rewind()
50+
public function rewind(): void
5151
{
5252
$this->position = 0;
5353
}

0 commit comments

Comments
 (0)