Skip to content

Commit cb9ecee

Browse files
committed
Merge branch '5.3' into 5.4
* 5.3: Fix return types for PHP 8.1
2 parents 517dc6e + 19fe2b3 commit cb9ecee

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

ConstraintViolationList.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public function remove(int $offset)
118118
*
119119
* @return \ArrayIterator|ConstraintViolationInterface[]
120120
*/
121+
#[\ReturnTypeWillChange]
121122
public function getIterator()
122123
{
123124
return new \ArrayIterator($this->violations);
@@ -126,6 +127,7 @@ public function getIterator()
126127
/**
127128
* @return int
128129
*/
130+
#[\ReturnTypeWillChange]
129131
public function count()
130132
{
131133
return \count($this->violations);
@@ -134,6 +136,7 @@ public function count()
134136
/**
135137
* @return bool
136138
*/
139+
#[\ReturnTypeWillChange]
137140
public function offsetExists($offset)
138141
{
139142
return $this->has($offset);
@@ -144,6 +147,7 @@ public function offsetExists($offset)
144147
*
145148
* @return mixed
146149
*/
150+
#[\ReturnTypeWillChange]
147151
public function offsetGet($offset)
148152
{
149153
return $this->get($offset);
@@ -154,6 +158,7 @@ public function offsetGet($offset)
154158
*
155159
* @return void
156160
*/
161+
#[\ReturnTypeWillChange]
157162
public function offsetSet($offset, $violation)
158163
{
159164
if (null === $offset) {
@@ -168,6 +173,7 @@ public function offsetSet($offset, $violation)
168173
*
169174
* @return void
170175
*/
176+
#[\ReturnTypeWillChange]
171177
public function offsetUnset($offset)
172178
{
173179
$this->remove($offset);

Tests/Fixtures/CustomArrayObject.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)