| @@ 30-43 (lines=14) @@ | ||
| 27 | } |
|
| 28 | } |
|
| 29 | ||
| 30 | public function __clone() |
|
| 31 | { |
|
| 32 | $items = []; |
|
| 33 | ||
| 34 | foreach ($this->items as $key => $item) { |
|
| 35 | if (is_object($item)) { |
|
| 36 | $items[$key] = clone $item; |
|
| 37 | } else { |
|
| 38 | $items[$key] = $item; |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| 42 | $this->items = $items; |
|
| 43 | } |
|
| 44 | ||
| 45 | public function get(string $key) |
|
| 46 | { |
|
| @@ 27-40 (lines=14) @@ | ||
| 24 | } |
|
| 25 | } |
|
| 26 | ||
| 27 | public function __clone() |
|
| 28 | { |
|
| 29 | $items = []; |
|
| 30 | ||
| 31 | foreach ($this->items as $item) { |
|
| 32 | if (is_object($item)) { |
|
| 33 | $items[] = clone $item; |
|
| 34 | } else { |
|
| 35 | $items[] = $item; |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| 39 | $this->items = $items; |
|
| 40 | } |
|
| 41 | ||
| 42 | public function get(int $index) |
|
| 43 | { |
|