1 | <?php |
||
20 | class AbstractCollection implements ArrayAccess, Countable, IteratorAggregate, JsonSerializable |
||
21 | { |
||
22 | use ArrayAccessTrait; |
||
23 | use AccessMethodsTrait; |
||
24 | use OperationsTrait; |
||
25 | use SortingTrait; |
||
26 | use TransformMethodsTrait; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $items = []; |
||
32 | |||
33 | protected $index = 0; |
||
34 | |||
35 | /** |
||
36 | * Collection constructor. |
||
37 | * @param array $items |
||
38 | */ |
||
39 | public function __construct($items = []) |
||
47 | |||
48 | /** |
||
49 | * @param $needle |
||
50 | * @return bool |
||
51 | */ |
||
52 | function contains($needle) |
||
61 | |||
62 | /** |
||
63 | * @return ArrayIterator |
||
64 | */ |
||
65 | public function getIterator() |
||
69 | |||
70 | |||
71 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.