1 | <?php namespace GenericCollections; |
||
15 | class Collection extends AbstractCollection |
||
16 | { |
||
17 | /** |
||
18 | * @var TypeProperty |
||
19 | */ |
||
20 | private $elementType; |
||
21 | |||
22 | /** |
||
23 | * Comparison types |
||
24 | * @var bool |
||
25 | */ |
||
26 | private $comparisonIdentical; |
||
27 | |||
28 | /** |
||
29 | * Generic collection |
||
30 | * |
||
31 | * example: `new Collection(Foo::class, [new Foo(), new Foo()]` |
||
32 | * |
||
33 | * @param string $elementType |
||
34 | * @param array $elements |
||
35 | * @param bool $comparisonIdentical |
||
36 | */ |
||
37 | public function __construct($elementType, array $elements = [], $comparisonIdentical = true) |
||
43 | |||
44 | // implements CollectionInterface::getElementType : string |
||
45 | public function getElementType() |
||
49 | |||
50 | // implements CollectionInterface::getElementType : bool |
||
51 | public function comparisonMethodIsIdentical() |
||
55 | } |
||
56 |