| @@ 42-55 (lines=14) @@ | ||
| 39 | return $copy; |
|
| 40 | } |
|
| 41 | ||
| 42 | public function withoutValue($value) |
|
| 43 | { |
|
| 44 | $key = array_search($value, $this->values, true); |
|
| 45 | ||
| 46 | if ($key === false) { |
|
| 47 | return $this; |
|
| 48 | } |
|
| 49 | ||
| 50 | $copy = clone $this; |
|
| 51 | unset($copy->values[$key]); |
|
| 52 | $copy->sortValues(); |
|
| 53 | ||
| 54 | return $copy; |
|
| 55 | } |
|
| 56 | ||
| 57 | protected function sortValues() |
|
| 58 | { |
|
| @@ 40-52 (lines=13) @@ | ||
| 37 | return $copy; |
|
| 38 | } |
|
| 39 | ||
| 40 | public function withoutValue($value) |
|
| 41 | { |
|
| 42 | $key = array_search($value, $this->values, true); |
|
| 43 | ||
| 44 | if ($key === false) { |
|
| 45 | return $this; |
|
| 46 | } |
|
| 47 | ||
| 48 | $copy = clone $this; |
|
| 49 | unset($copy->values[$key]); |
|
| 50 | ||
| 51 | return $copy; |
|
| 52 | } |
|
| 53 | ||
| 54 | public function withValueAfter($value, $search) |
|
| 55 | { |
|
| @@ 40-52 (lines=13) @@ | ||
| 37 | return $copy; |
|
| 38 | } |
|
| 39 | ||
| 40 | public function withoutValue($value) |
|
| 41 | { |
|
| 42 | $key = array_search($value, $this->values, true); |
|
| 43 | ||
| 44 | if ($key === false) { |
|
| 45 | return $this; |
|
| 46 | } |
|
| 47 | ||
| 48 | $copy = clone $this; |
|
| 49 | unset($copy->values[$key]); |
|
| 50 | ||
| 51 | return $copy; |
|
| 52 | } |
|
| 53 | ||
| 54 | protected function assertValid(array $values) |
|
| 55 | { |
|