Total Complexity | 5 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
27 | class IdentifierCollection implements IdentifierCollectionInterface |
||
28 | { |
||
29 | /** |
||
30 | * Identifier list |
||
31 | * |
||
32 | * @var array<\Phauthentic\Authentication\Identifier\IdentifierInterface> |
||
33 | */ |
||
34 | protected array $identifiers; |
||
35 | |||
36 | /** |
||
37 | * Constructor |
||
38 | * |
||
39 | 16 | * @param iterable<\Phauthentic\Authentication\Identifier\IdentifierInterface> $identifiers Identifier objects. |
|
40 | */ |
||
41 | 16 | public function __construct(iterable $identifiers = []) |
|
45 | } |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * Adds an identifier to the collection |
||
50 | * |
||
51 | * @param IdentifierInterface $identifier Identifier |
||
52 | 16 | * @return void |
|
53 | */ |
||
54 | 16 | public function add(IdentifierInterface $identifier): void |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * Returns true if a collection is empty. |
||
61 | * |
||
62 | 8 | * @return bool |
|
63 | */ |
||
64 | 8 | public function isEmpty(): bool |
|
65 | { |
||
66 | return empty($this->identifiers); |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * Returns iterator. |
||
71 | * |
||
72 | 8 | * @return \ArrayIterator |
|
73 | */ |
||
74 | 8 | public function getIterator(): Traversable |
|
77 | } |
||
78 | } |
||
79 |