Skip to content

Commit 900f714

Browse files
committed
UniqueObjectCollection: make ::contains(object $item) public
1 parent fa86e8b commit 900f714

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/Collection/UniqueObjectCollection.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ abstract protected function getIdentifier(object $item);
2929

3030
/**
3131
* Skips items with duplicate key
32+
* @param array<mixed> $data
3233
*/
3334
public function __construct(array $data)
3435
{
@@ -214,23 +215,23 @@ public function isEmpty(): bool
214215
}
215216

216217

217-
protected function getItems(): array
218-
{
219-
return $this->data;
220-
}
221-
222-
223218
/**
224219
* @param IdentifiableObject $item
225220
*/
226-
protected function contains(object $item): bool
221+
public function contains(object $item): bool
227222
{
228223
return $this->exists(
229224
$this->getIdentifier($item)
230225
);
231226
}
232227

233228

229+
protected function getItems(): array
230+
{
231+
return $this->data;
232+
}
233+
234+
234235
/**
235236
* @param IdentifiableObject $item
236237
*/

0 commit comments

Comments
 (0)