-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImmutableCollectionInterface.php
50 lines (40 loc) 路 1.1 KB
/
ImmutableCollectionInterface.php
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
<?php
declare(strict_types=1);
namespace MyOnlineStore\Common\Domain\Collection;
interface ImmutableCollectionInterface extends \Countable, \IteratorAggregate, \ArrayAccess
{
/**
* @param mixed $element
*/
public function contains($element): bool;
public function each(callable $callback): void;
/**
* Returns if given collection is of the same type and has the same elements
*/
public function equals(ImmutableCollectionInterface $otherCollection): bool;
/**
* @return mixed
*/
public function first();
/**
* @param mixed $element
*
* @return mixed Index van het gegeven element, of false wanneer deze niet voorkomt in de collectie
*/
public function indexOf($element);
public function isEmpty(): bool;
/**
* Sets the internal iterator to the last element in the collection and returns this element.
*
* @return mixed
*/
public function last();
/**
* @return static
*/
public function reindex();
/**
* @return mixed[]
*/
public function toArray(): array;
}