-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBaseListCollection.php
More file actions
57 lines (49 loc) · 1.19 KB
/
BaseListCollection.php
File metadata and controls
57 lines (49 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
declare(strict_types=1);
namespace Inspirum\Arrayable;
use Inspirum\Arrayable\Arrayable as TValue;
use function array_values;
/**
* @template TItemKey of array-key
* @template TItemValue
* @template TValue of \Inspirum\Arrayable\Arrayable<TItemKey,TItemValue>
* @extends \Inspirum\Arrayable\BaseCollection<TItemKey,TItemValue,int,TValue>
*/
abstract class BaseListCollection extends BaseCollection
{
/**
* @param list<TValue> $items
*/
public function __construct(array $items = [])
{
parent::__construct($items);
}
/**
* @return list<TValue>
*/
public function getItems(): array
{
return array_values(parent::getItems());
}
/**
* @return list<array<TItemKey,TItemValue>>
*/
public function __toArray(): array
{
return array_values(parent::__toArray());
}
/**
* @return list<array<TItemKey,TItemValue>>
*/
public function toArray(): array
{
return array_values(parent::toArray());
}
/**
* @return list<array<TItemKey,TItemValue>>
*/
public function jsonSerialize(): array
{
return array_values(parent::jsonSerialize());
}
}