Completed
Push — master ( 32eb69...17baec )
by Shcherbak
05:37 queued 10s
created

Input::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
ccs 3
cts 3
cp 1
cc 1
eloc 3
nc 1
nop 0
crap 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
    public function getType() {
27
      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 4
    public function setType($type) {
38 4
      $this->setAttribute('type', $type);
39 4
      return $this;
40
    }
41
42
43
    /**
44
     * @param $value
45
     * @return $this
46
     */
47 13
    public function setValue($value) {
48 13
      $this->setAttribute('value', $value);
49 13
      return $this;
50
    }
51
52
53
  }