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 |
||
37 | 1 | public function removeByName($name): bool |
|
38 | { |
||
39 | 1 | $this->rewind(); |
|
40 | |||
41 | 1 | while ($this->valid()) { |
|
42 | 1 | $field = $this->current(); |
|
43 | |||
44 | 1 | if ($field->getName() == $name) { |
|
45 | 1 | $key = $this->key(); |
|
46 | 1 | $this->offsetUnset($key); |
|
|
|||
47 | 1 | $this->rewind(); |
|
48 | |||
49 | 1 | return true; |
|
50 | } |
||
51 | 1 | $this->next(); |
|
52 | } |
||
53 | |||
54 | 1 | $this->rewind(); |
|
55 | |||
56 | 1 | return false; |
|
57 | } |
||
66 | } |