Completed
Push — master ( e69aaa...f09f8b )
by Fran
02:48
created

Field   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

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 = 'phone';
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
19
        /**
20
         * @var string label
21
         */
22
        public $label;
23
        /**
24
         * @var string name
25
         */
26
        public $name;
27
        /**
28
         * @var string type
29
         */
30
        public $type = Field::TEXT_TYPE;
31
        /**
32
         * @var array data
33
         */
34
        public $data = array();
35
        /**
36
         * @var string url
37
         */
38
        public $url;
39
        /**
40
         * @var Object value
41
         */
42
        public $value;
43
        /**
44
         * @var bool required
45
         */
46
        public $required = true;
47
48
        public function __construct($name, $label, $type = Field::TEXT_TYPE, $value = null, $data = array(), $url = null, $required = true)
49
        {
50
            $this->name = $name;
51
            $this->label = $label;
52
            $this->type = $type;
53
            $this->value = $value;
54
            $this->data = $data;
55
            $this->url = $url;
56
            $this->required = $required;
57
        }
58
    }