Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | 1 | public function removeByName($name): bool |
|
35 | { |
||
36 | 1 | $this->rewind(); |
|
37 | |||
38 | 1 | while ($this->valid()) { |
|
39 | 1 | $field = $this->current(); |
|
40 | |||
41 | 1 | if ($field->getName() == $name) { |
|
42 | 1 | $key = $this->key(); |
|
43 | 1 | $this->offsetUnset($key); |
|
|
|||
44 | 1 | $this->rewind(); |
|
45 | |||
46 | 1 | return true; |
|
47 | } |
||
48 | 1 | $this->next(); |
|
49 | } |
||
50 | |||
51 | 1 | $this->rewind(); |
|
52 | |||
53 | 1 | return false; |
|
54 | } |
||
64 |