Completed
Pull Request — master (#28)
by Vitaliy
02:51
created

TextArea   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 3 1
A handle() 0 3 1
1
<?php
2
3
  namespace Fiv\Form\Element;
4
5
  use Fiv\Form\FormData;
6
7
  /**
8
   * Class TextArea
9
   * Generate <textarea></textarea> html tag
10
   *
11
   * @author  Ivan Shcherbak <[email protected]>
12
   * @package Fiv\Form
13
   */
14
  class TextArea extends BaseElement {
15
16
    /**
17
     * @return string
18
     */
19 2
    public function render() {
20 2
      return '<textarea ' . Html::renderAttributes($this->getAttributes()) . '>' . $this->getValue() . '</textarea>';
21
    }
22
23
24
    /**
25
     * @inheritdoc
26
     */
27 2
    public function handle(FormData $data) {
28 2
      $this->setValue($data->get($this->getName()));
29
    }
30
  }