Skip to content

Commit 7e3984b

Browse files
committed
Type Comments array
1 parent 56a99f5 commit 7e3984b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Comments.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@
1313
* Class to manage the comments of a translation.
1414
*
1515
* @phpstan-consistent-constructor
16+
*
17+
* @implements IteratorAggregate<string, string>
1618
*/
1719
class Comments implements JsonSerializable, Countable, IteratorAggregate
1820
{
21+
/**
22+
* @var array<string, string>
23+
*/
1924
protected $comments = [];
2025

26+
/**
27+
* @param array<string, string> $state
28+
*/
2129
public static function __set_state(array $state): Comments
2230
{
2331
return new static(...$state['comments']);
@@ -76,6 +84,9 @@ public function count(): int
7684
return count($this->comments);
7785
}
7886

87+
/**
88+
* @return array<string, string>
89+
*/
7990
public function toArray(): array
8091
{
8192
return $this->comments;

0 commit comments

Comments
 (0)