Skip to content

Commit 9ac7f2f

Browse files
committed
Add generic types to traversable implementations
1 parent 3293c70 commit 9ac7f2f

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

ConstraintViolationList.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Default implementation of {@ConstraintViolationListInterface}.
1616
*
1717
* @author Bernhard Schussek <[email protected]>
18+
*
19+
* @implements \IteratorAggregate<int, ConstraintViolationInterface>
1820
*/
1921
class ConstraintViolationList implements \IteratorAggregate, ConstraintViolationListInterface
2022
{
@@ -116,7 +118,7 @@ public function remove(int $offset)
116118
/**
117119
* {@inheritdoc}
118120
*
119-
* @return \ArrayIterator|ConstraintViolationInterface[]
121+
* @return \ArrayIterator<int, ConstraintViolationInterface>
120122
*/
121123
#[\ReturnTypeWillChange]
122124
public function getIterator()
@@ -145,7 +147,7 @@ public function offsetExists($offset)
145147
/**
146148
* {@inheritdoc}
147149
*
148-
* @return mixed
150+
* @return ConstraintViolationInterface
149151
*/
150152
#[\ReturnTypeWillChange]
151153
public function offsetGet($offset)

ConstraintViolationListInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
* A list of constraint violations.
1616
*
1717
* @author Bernhard Schussek <[email protected]>
18+
*
19+
* @extends \ArrayAccess<int, ConstraintViolationInterface>
20+
* @extends \Traversable<int, ConstraintViolationInterface>
1821
*/
1922
interface ConstraintViolationListInterface extends \Traversable, \Countable, \ArrayAccess
2023
{

Constraints/GroupSequence.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class GroupSequence
5757
/**
5858
* The groups in the sequence.
5959
*
60-
* @var array<string|string[]|GroupSequence>
60+
* @var array<int, string|string[]|GroupSequence>
6161
*/
6262
public $groups;
6363

Context/ExecutionContext.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ class ExecutionContext implements ExecutionContextInterface
128128
* @var bool[]
129129
*/
130130
private $initializedObjects;
131+
132+
/**
133+
* @var \SplObjectStorage<object, string>
134+
*/
131135
private $cachedObjectsRefs;
132136

133137
/**

0 commit comments

Comments
 (0)