Date   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 22 3
1
<?php
2
3
namespace Faulancer\Form\Type\Base;
4
5
use Faulancer\Form\Type\AbstractType;
6
7
/**
8
 * Class Date
9
 *
10
 * @package Faulancer\Form\Type\Base
11
 * @author Florian Knapp <[email protected]>
12
 */
13
class Date extends AbstractType
14
{
15
    /** @var string */
16
    protected $inputType = 'input';
17
18
    /** @var string */
19
    protected $element = '';
20
21
    /**
22
     * @return self
23
     */
24
    public function create()
25
    {
26
        parent::create();
27
28
        $this->setLabel($this->definition['label']);
29
30
        $output = '<' . $this->inputType;
31
32
        foreach ($this->definition['attributes'] as $attr => $value) {
33
            $output .= ' ' . $attr . '="' . $value . '" ';
34
        }
35
36
        if (!empty($this->getValue())) {
37
            $output .= ' value="' . $this->getValue() . '"';
38
        }
39
40
        $output .= '/>';
41
42
        $this->element = $output;
43
44
        return $this;
45
    }
46
}