1 | <?php |
||
8 | class HashSet implements SetInterface |
||
9 | { |
||
10 | /** @var array */ |
||
11 | protected $scalars = []; |
||
12 | |||
13 | /** @var array */ |
||
14 | protected $objects = []; |
||
15 | |||
16 | /** |
||
17 | * @param array $items |
||
18 | */ |
||
19 | 5 | public function __construct(array $items) |
|
25 | |||
26 | /** |
||
27 | * {@inheritdoc} |
||
28 | */ |
||
29 | 1 | public function count() |
|
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | 2 | public function equal(SetInterface $other) |
|
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function intersection(SetInterface $other) |
||
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | public function union(SetInterface $other) |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function difference(SetInterface $other) |
||
100 | |||
101 | /** |
||
102 | * {@inheritdoc} |
||
103 | */ |
||
104 | 1 | public function has($item) |
|
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | 4 | public function add($item) |
|
130 | |||
131 | /** |
||
132 | * {@inheritdoc} |
||
133 | */ |
||
134 | 1 | public function remove($item) |
|
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | 1 | public function getIterator() |
|
154 | } |
||
155 |