Skip to content

Commit ad0ae0d

Browse files
committed
Type Flags array
1 parent ede8f6f commit ad0ae0d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Flags.php

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

28+
/**
29+
* @param array{flags: FlagsType} $state
30+
*/
2131
public static function __set_state(array $state): Flags
2232
{
2333
return new static(...$state['flags']);
@@ -83,6 +93,9 @@ public function count(): int
8393
return count($this->flags);
8494
}
8595

96+
/**
97+
* @return FlagsType
98+
*/
8699
public function toArray(): array
87100
{
88101
return $this->flags;

0 commit comments

Comments
 (0)