Completed
Pull Request — master (#1)
by Derek Stephen
02:21
created

RadioRender::renderFieldBlock()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 9
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 2.0185

Importance

Changes 0
Metric Value
dl 9
loc 9
ccs 5
cts 6
cp 0.8333
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 5
crap 2.0185
1
<?php
2
/**
3
 * User: delboy1978uk
4
 * Date: 04/12/2016
5
 * Time: 22:33
6
 */
7
8
namespace Del\Form\Renderer\Field;
9
10
use Del\Form\Field\FieldInterface;
11
use DOMElement;
12
13 View Code Duplication
class RadioRender extends AbstractFieldRender implements FieldRendererInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
{
15
    /**
16
     * @param FieldInterface $field
17
     * @param DOMElement $fieldBlock
18
     * @param DOMElement $labelBlock
19
     * @param DOMElement $element
20
     * @param DOMElement|null $errorBlock
21
     * @return DOMElement
22
     */
23 1
    public function renderFieldBlock(FieldInterface $field, DOMElement $fieldBlock, DOMElement $labelBlock, DOMElement $element, DOMElement $errorBlock = null)
24
    {
25 1
        $labelBlock->appendChild($element);
26 1
        $fieldBlock->appendChild($labelBlock);
27 1
        if ($errorBlock) {
28
            $fieldBlock->appendChild($errorBlock);
29
        }
30 1
        return $fieldBlock;
31
    }
32
33
}