Completed
Push — master ( 9c1626...6bcea8 )
by Shcherbak
22:09 queued 19:43
created

Input   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 7
Bugs 1 Features 2
Metric Value
wmc 3
c 7
b 1
f 2
lcom 0
cbo 1
dl 0
loc 46
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setType() 0 4 1
A setValue() 0 4 1
A getType() 0 3 1
1
<?php
2
3
  namespace Fiv\Form\Element;
4
5
  /**
6
   * @author Ivan Shcherbak <[email protected]> 7/11/14
7
   */
8
  class Input extends BaseElement {
9
10
    /**
11
     * @var string
12
     */
13
    protected $tag = 'input';
14
15
    /**
16
     * @var array
17
     */
18
    protected $attributes = [
19
      'type' => 'text',
20
    ];
21
22
23
    /**
24
     * @return null|string
25
     */
26 1
    public function getType() {
27 1
      return $this->getAttribute('type');
28
    }
29
30
31
    /**
32
     * Alias of $this->setAttribute('type' 'text');
33
     *
34
     * @param string $type
35
     * @return $this
36
     */
37 6
    public function setType($type) {
38 6
      $this->setAttribute('type', strtolower($type));
39 6
      return $this;
40
    }
41
42
43
    /**
44
     * @param $value
45
     * @return $this
46
     */
47 16
    public function setValue($value) {
48 16
      $this->setAttribute('value', $value);
49 16
      return $this;
50
    }
51
52
53
  }