| Total Complexity | 9 |
| Total Lines | 90 |
| Duplicated Lines | 0 % |
| Coverage | 34.78% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class Nip_Form_DisplayGroup extends Collection |
||
| 11 | { |
||
| 12 | use \Nip\Form\Utility\HasAttributesTrait; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var Nip_Form |
||
| 16 | */ |
||
| 17 | protected $_form; |
||
| 18 | |||
| 19 | protected $renderer; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @return Nip_Form|null |
||
| 23 | */ |
||
| 24 | public function getForm() |
||
| 25 | { |
||
| 26 | return $this->_form; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param AbstractForm $form |
||
| 31 | * @return Nip_Form_DisplayGroup |
||
| 32 | */ |
||
| 33 | 1 | public function setForm(AbstractForm $form) |
|
| 34 | { |
||
| 35 | 1 | $this->_form = $form; |
|
|
|
|||
| 36 | |||
| 37 | 1 | return $this; |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param AbstractElement $element |
||
| 42 | * @return $this |
||
| 43 | */ |
||
| 44 | 1 | public function addElement(AbstractElement $element) |
|
| 45 | { |
||
| 46 | 1 | $this[$element->getUniqueId()] = $element; |
|
| 47 | |||
| 48 | 1 | return $this; |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @param string $legend |
||
| 53 | * @return Nip_Form_DisplayGroup |
||
| 54 | */ |
||
| 55 | 1 | public function setLegend($legend) |
|
| 56 | { |
||
| 57 | 1 | return $this->setAttrib('legend', (string)$legend); |
|
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return mixed|null |
||
| 62 | */ |
||
| 63 | public function getLegend() |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @return mixed |
||
| 70 | */ |
||
| 71 | public function render() |
||
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @return Nip_Form_Renderer_DisplayGroup |
||
| 78 | */ |
||
| 79 | public function getRenderer() |
||
| 86 | } |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @param string $type |
||
| 90 | * @return Nip_Form_Renderer_DisplayGroup |
||
| 91 | */ |
||
| 92 | public function getNewRenderer($type = 'basic') |
||
| 102 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.