Completed
Push — master ( 8431a9...0bccd4 )
by Gabriel
04:28
created

Nip_Form_Renderer_Elements_MultiElement   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 12
ccs 0
cts 7
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A generateElement() 0 10 2
1
<?php
2
class Nip_Form_Renderer_Elements_MultiElement extends Nip_Form_Renderer_Elements_Input_Abstract
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
3
{
4
    public function generateElement()
5
    {
6
        $elements = $this->getElement()->getElements();
0 ignored issues
show
Bug introduced by
The method getElements() does not exist on Nip_Form_Element_Abstract. It seems like you code against a sub-type of Nip_Form_Element_Abstract such as Nip_Form_Element_MultiElement or Nip_Form_Element_Input_Group. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

6
        $elements = $this->getElement()->/** @scrutinizer ignore-call */ getElements();
Loading history...
7
        $return = '';
8
        foreach ($elements as $element) {
9
            $returnElements[] = $element->render();
10
        }
11
        
12
        $return .= implode(' ', $returnElements);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $returnElements seems to be defined by a foreach iteration on line 8. Are you sure the iterator is never empty, otherwise this variable is not defined?
Loading history...
13
        return $return;
14
    }
15
}
16