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

generateElement()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 10
ccs 0
cts 7
cp 0
rs 10
cc 2
nc 2
nop 0
crap 6
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