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

TextRender::renderFieldBlock()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 9
Ratio 100 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 9
loc 9
ccs 6
cts 6
cp 1
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 5
crap 2
1
<?php
2
/**
3
 * User: delboy1978uk
4
 * Date: 04/12/2016
5
 * Time: 21:08
6
 */
7
8
namespace Del\Form\Renderer\Field;
9
10
use Del\Form\Field\FieldInterface;
11
use DOMDocument;
12
use DOMElement;
13
14 View Code Duplication
class TextRender 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...
15
{
16
    /**
17
     * @param FieldInterface $field
18
     * @param DOMElement $fieldBlock
19
     * @param DOMElement $labelBlock
20
     * @param DOMElement $element
21
     * @param DOMElement|null $errorBlock
22
     * @return DOMElement
23
     */
24 4
    public function renderFieldBlock(FieldInterface $field, DOMElement $fieldBlock, DOMElement $labelBlock, DOMElement $element, DOMElement $errorBlock = null)
25
    {
26 4
        $fieldBlock->appendChild($labelBlock);
27 4
        $fieldBlock->appendChild($element);
28 4
        if ($errorBlock) {
29 2
            $fieldBlock->appendChild($errorBlock);
30
        }
31 4
        return $fieldBlock;
32
    }
33
34
}