| @@ 28-37 (lines=10) @@ | ||
| 25 | /** |
|
| 26 | * @param Equatable[] $items |
|
| 27 | */ |
|
| 28 | public function __construct(array $items = []) |
|
| 29 | { |
|
| 30 | foreach ($items as $key => $value) { |
|
| 31 | if (!$value instanceof Equatable) { |
|
| 32 | throw InvalidArgumentException::invalidTypeInArray('items', Equatable::class, $value); |
|
| 33 | } |
|
| 34 | ||
| 35 | $this->items[$key] = $value; |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| 39 | public function __clone() |
|
| 40 | { |
|
| @@ 28-37 (lines=10) @@ | ||
| 25 | /** |
|
| 26 | * @param Equatable[] $items |
|
| 27 | */ |
|
| 28 | public function __construct(array $items = []) |
|
| 29 | { |
|
| 30 | foreach ($items as $item) { |
|
| 31 | if (!$item instanceof Equatable) { |
|
| 32 | throw InvalidArgumentException::invalidTypeInArray('items', Equatable::class, $item); |
|
| 33 | } |
|
| 34 | ||
| 35 | $this->items[] = $item; |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| 39 | public function __clone() |
|
| 40 | { |
|