Skip to content

Commit fcaab6e

Browse files
committed
Type References array
1 parent 317fea1 commit fcaab6e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/References.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,21 @@
1313
* Class to manage the references of a translation.
1414
*
1515
* @phpstan-consistent-constructor
16+
*
17+
* @phpstan-type ReferencesType array<string, list<int>>
18+
*
19+
* @implements IteratorAggregate<string, list<int>>
1620
*/
1721
class References implements JsonSerializable, Countable, IteratorAggregate
1822
{
23+
/**
24+
* @var ReferencesType
25+
*/
1926
protected $references = [];
2027

28+
/**
29+
* @param array{references: ReferencesType} $state
30+
*/
2131
public static function __set_state(array $state): References
2232
{
2333
$references = new static();
@@ -67,6 +77,9 @@ public function count(): int
6777
}, 0);
6878
}
6979

80+
/**
81+
* @return ReferencesType
82+
*/
7083
public function toArray(): array
7184
{
7285
return $this->references;

0 commit comments

Comments
 (0)