inspirum /
arrayable-php
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace Inspirum\Arrayable; |
||
| 6 | |||
| 7 | use Inspirum\Arrayable\Arrayable as TValue; |
||
| 8 | use function array_values; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @template TItemKey of array-key |
||
| 12 | * @template TItemValue |
||
| 13 | * @template TValue of \Inspirum\Arrayable\Arrayable<TItemKey,TItemValue> |
||
| 14 | * @extends \Inspirum\Arrayable\BaseCollection<TItemKey,TItemValue,int,TValue> |
||
| 15 | */ |
||
| 16 | abstract class BaseListCollection extends BaseCollection |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @param list<TValue> $items |
||
| 20 | */ |
||
| 21 | public function __construct(array $items = []) |
||
| 22 | { |
||
| 23 | parent::__construct($items); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @return list<TValue> |
||
| 28 | */ |
||
| 29 | public function getItems(): array |
||
| 30 | { |
||
| 31 | return array_values(parent::getItems()); |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return list<array<TItemKey,TItemValue>> |
||
| 36 | */ |
||
| 37 | public function __toArray(): array |
||
| 38 | { |
||
| 39 | return array_values(parent::__toArray()); |
||
|
0 ignored issues
–
show
|
|||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return list<array<TItemKey,TItemValue>> |
||
| 44 | */ |
||
| 45 | public function toArray(): array |
||
| 46 | { |
||
| 47 | return array_values(parent::toArray()); |
||
|
0 ignored issues
–
show
|
|||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return list<array<TItemKey,TItemValue>> |
||
| 52 | */ |
||
| 53 | public function jsonSerialize(): array |
||
| 54 | { |
||
| 55 | return array_values(parent::jsonSerialize()); |
||
|
0 ignored issues
–
show
|
|||
| 56 | } |
||
| 57 | } |
||
| 58 |