| Total Complexity | 5 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Coverage | 23.08% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 3 | class Nip_Form_Element_MultiElement extends Nip_Form_Element_Abstract |
||
| 4 | { |
||
| 5 | protected $_type = 'multiElement'; |
||
| 6 | |||
| 7 | /** |
||
| 8 | * @var Nip_Form_Element_Abstract[] |
||
| 9 | */ |
||
| 10 | protected $elements = []; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @param Nip_Form_Element_Abstract $element |
||
| 14 | * @return $this |
||
| 15 | */ |
||
| 16 | public function addElement(Nip_Form_Element_Abstract $element) |
||
| 17 | { |
||
| 18 | $key = $element->getName(); |
||
| 19 | $this->elements[$key] = $element; |
||
| 20 | return $this; |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @return Nip_Form_Element_Abstract[] |
||
| 25 | */ |
||
| 26 | 1 | public function getElements() |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param $name |
||
| 34 | * @return Nip_Form_Element_Abstract |
||
| 35 | * @throws \Nip\Logger\Exception |
||
| 36 | */ |
||
| 37 | public function getElement($name) |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param $name |
||
| 47 | * @return bool |
||
| 48 | */ |
||
| 49 | public function hasElement($name) |
||
| 54 |
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.