@@ 120-128 (lines=9) @@ | ||
117 | return new self($items); |
|
118 | } |
|
119 | ||
120 | public function replace($searchValue, $replacementValue): self |
|
121 | { |
|
122 | $items = $this->items; |
|
123 | $key = $this->search($searchValue); |
|
124 | ||
125 | $items[$key] = $replacementValue; |
|
126 | ||
127 | return new self($items); |
|
128 | } |
|
129 | ||
130 | public function replaceAll($searchValue, $replacementValue): self |
|
131 | { |
@@ 90-98 (lines=9) @@ | ||
87 | return new self($items); |
|
88 | } |
|
89 | ||
90 | public function replace($searchValue, $replacementValue): self |
|
91 | { |
|
92 | $items = $this->items; |
|
93 | $index = $this->search($searchValue); |
|
94 | ||
95 | $items[$index] = $replacementValue; |
|
96 | ||
97 | return new self($items); |
|
98 | } |
|
99 | ||
100 | public function replaceAll($searchValue, $replacementValue): self |
|
101 | { |