Skip to content

Commit 0cdf47f

Browse files
committed
Fix return types for PHP 8.1
1 parent 9fcb3ac commit 0cdf47f

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

PropertyPath.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ public function getParent()
154154
*
155155
* @return PropertyPathIteratorInterface
156156
*/
157+
#[\ReturnTypeWillChange]
157158
public function getIterator()
158159
{
159160
return new PropertyPathIterator($this);

Tests/Fixtures/NonTraversableArrayObject.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ public function offsetExists($offset): bool
2929
return \array_key_exists($offset, $this->array);
3030
}
3131

32+
/**
33+
* @param mixed $offset
34+
* @return mixed
35+
*/
36+
#[\ReturnTypeWillChange]
3237
public function offsetGet($offset)
3338
{
3439
return $this->array[$offset];
3540
}
3641

37-
public function offsetSet($offset, $value)
42+
public function offsetSet($offset, $value): void
3843
{
3944
if (null === $offset) {
4045
$this->array[] = $value;
@@ -43,7 +48,7 @@ public function offsetSet($offset, $value)
4348
}
4449
}
4550

46-
public function offsetUnset($offset)
51+
public function offsetUnset($offset): void
4752
{
4853
unset($this->array[$offset]);
4954
}
@@ -68,7 +73,7 @@ public function __unserialize(array $data): void
6873
$this->array = $data;
6974
}
7075

71-
public function unserialize($serialized)
76+
public function unserialize($serialized): void
7277
{
7378
$this->__unserialize((array) unserialize((string) $serialized));
7479
}

Tests/Fixtures/TraversableArrayObject.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ public function offsetExists($offset): bool
2929
return \array_key_exists($offset, $this->array);
3030
}
3131

32+
/**
33+
* @param mixed $offset
34+
* @return mixed
35+
*/
36+
#[\ReturnTypeWillChange]
3237
public function offsetGet($offset)
3338
{
3439
return $this->array[$offset];
3540
}
3641

37-
public function offsetSet($offset, $value)
42+
public function offsetSet($offset, $value): void
3843
{
3944
if (null === $offset) {
4045
$this->array[] = $value;
@@ -43,7 +48,7 @@ public function offsetSet($offset, $value)
4348
}
4449
}
4550

46-
public function offsetUnset($offset)
51+
public function offsetUnset($offset): void
4752
{
4853
unset($this->array[$offset]);
4954
}

0 commit comments

Comments
 (0)