bytic /
Collections
| 1 | <?php |
||
| 2 | |||
| 3 | /** |
||
| 4 | * @inspiration https://github.com/ramsey/collection/blob/main/src/ArrayInterface.php |
||
| 5 | */ |
||
| 6 | |||
| 7 | declare(strict_types=1); |
||
| 8 | |||
| 9 | namespace Nip\Collections; |
||
| 10 | |||
| 11 | use ArrayAccess; |
||
| 12 | use Countable; |
||
| 13 | use IteratorAggregate; |
||
| 14 | use Serializable; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * `ArrayInterface` provides traversable array functionality to data types. |
||
| 18 | * |
||
| 19 | * @template T |
||
| 20 | */ |
||
| 21 | interface ArrayInterface extends |
||
| 22 | ArrayAccess, |
||
| 23 | Countable, |
||
| 24 | IteratorAggregate, |
||
| 25 | Serializable |
||
| 26 | { |
||
| 27 | /** |
||
| 28 | * Removes all items from this array. |
||
| 29 | */ |
||
| 30 | public function clear(): void; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Returns a native PHP array representation of this array object. |
||
| 34 | * |
||
| 35 | * @return array<array-key, T> |
||
|
0 ignored issues
–
show
Documentation
Bug
introduced
by
Loading history...
|
|||
| 36 | */ |
||
| 37 | public function toArray(): array; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Returns `true` if this array is empty. |
||
| 41 | */ |
||
| 42 | public function isEmpty(): bool; |
||
| 43 | } |
||
| 44 |