Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
25.00% |
2 / 8 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| IdentifierList | |
25.00% |
2 / 8 |
|
0.00% |
0 / 3 |
15.55 | |
0.00% |
0 / 1 |
| offsetSet | |
66.67% |
2 / 3 |
|
0.00% |
0 / 1 |
2.15 | |||
| offsetGet | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| toStringArray | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | namespace Apie\Core\Lists; |
| 3 | |
| 4 | use Apie\Core\Identifiers\Identifier; |
| 5 | |
| 6 | final class IdentifierList extends ItemList |
| 7 | { |
| 8 | protected bool $mutable = false; |
| 9 | |
| 10 | public function offsetSet(mixed $offset, mixed $value): void |
| 11 | { |
| 12 | if (!($value instanceof Identifier)) { |
| 13 | $value = Identifier::fromNative($value); |
| 14 | } |
| 15 | parent::offsetSet($offset, $value); |
| 16 | } |
| 17 | |
| 18 | public function offsetGet(mixed $offset): Identifier |
| 19 | { |
| 20 | return parent::offsetGet($offset); |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * @return string[] |
| 25 | */ |
| 26 | public function toStringArray(): array |
| 27 | { |
| 28 | $result = []; |
| 29 | foreach ($this as $item) { |
| 30 | $result[] = $item->toNative(); |
| 31 | } |
| 32 | return $result; |
| 33 | } |
| 34 | } |