Completed
Push — master ( 04bd65...4036d4 )
by Fran
09:06
created

Field   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
    namespace PSFS\base\dto;
3
4
    /**
5
     * Class Field
6
     * @package PSFS\base\dto
7
     */
8
    class Field extends Dto
9
    {
10
        const TEXT_TYPE = 'text';
11
        const PHONE_TYPE = 'tel';
12
        const URL_TYPE = 'url';
13
        const CHECK_TYPE = 'checkbox';
14
        const RADIO_TYPE = 'radio';
15
        const COMBO_TYPE = 'select';
16
        const TEXTAREA_TYPE = 'textarea';
17
        const SEARCH_TYPE = 'search';
18
        const HIDDEN_TYPE = 'hidden';
19
        const NUMBER_TYPE = 'number';
20
21
        /**
22
         * @var string label
23
         */
24
        public $label;
25
        /**
26
         * @var string name
27
         */
28
        public $name;
29
        /**
30
         * @var string type
31
         */
32
        public $type = Field::TEXT_TYPE;
33
        /**
34
         * @var array data
35
         */
36
        public $data = array();
37
        /**
38
         * @var string url
39
         */
40
        public $url;
41
        /**
42
         * @var Object value
43
         */
44
        public $value;
45
        /**
46
         * @var bool required
47
         */
48
        public $required = true;
49
        /**
50
         * @var string entity
51
         */
52
        public $entity;
53
54
        public function __construct($name, $label, $type = Field::TEXT_TYPE, $value = null, $data = array(), $url = null, $required = true)
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 139 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
55
        {
56
            $this->name = $name;
57
            $this->label = $label;
58
            $this->type = $type;
59
            $this->value = $value;
60
            $this->data = $data;
61
            $this->url = $url;
62
            $this->required = $required;
63
        }
64
    }