Skip to content

Commit 6393f2b

Browse files
committed
Add generic types to traversable implementations
1 parent bd3efa2 commit 6393f2b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

PropertyPath.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* Default implementation of {@link PropertyPathInterface}.
2020
*
2121
* @author Bernhard Schussek <[email protected]>
22+
*
23+
* @implements \IteratorAggregate<int, string>
2224
*/
2325
class PropertyPath implements \IteratorAggregate, PropertyPathInterface
2426
{
@@ -30,7 +32,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
3032
/**
3133
* The elements of the property path.
3234
*
33-
* @var array
35+
* @var string[]
3436
*/
3537
private $elements = [];
3638

PropertyPathInterface.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* A sequence of property names or array indices.
1616
*
1717
* @author Bernhard Schussek <[email protected]>
18+
*
19+
* @extends \Traversable<int, string>
1820
*/
1921
interface PropertyPathInterface extends \Traversable
2022
{
@@ -47,7 +49,7 @@ public function getParent();
4749
/**
4850
* Returns the elements of the property path as array.
4951
*
50-
* @return array
52+
* @return string[]
5153
*/
5254
public function getElements();
5355

PropertyPathIteratorInterface.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313

1414
/**
1515
* @author Bernhard Schussek <[email protected]>
16+
*
17+
* @extends \SeekableIterator<int, string>
1618
*/
17-
interface PropertyPathIteratorInterface extends \Iterator, \SeekableIterator
19+
interface PropertyPathIteratorInterface extends \SeekableIterator
1820
{
1921
/**
2022
* Returns whether the current element in the property path is an array

0 commit comments

Comments
 (0)