| Conditions | 4 |
| Paths | 3 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 5 | protected function checkDefaultValue() |
|
| 21 | { |
||
| 22 | 5 | if (!$this->getElement()->hasValue() && $this->getElement()->isAutoSelectFirst()) { |
|
| 23 | 4 | $elements = $this->getElement()->getElements(); |
|
| 24 | 4 | if ($elements) { |
|
| 25 | 2 | $element = reset($elements); |
|
| 26 | 2 | $element->setChecked(true); |
|
| 27 | } |
||
| 28 | } |
||
| 29 | 5 | } |
|
| 30 | } |
||
| 31 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.