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

TextArea::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
ccs 3
cts 3
cp 1
rs 10
nc 1
cc 1
eloc 2
nop 1
crap 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
  }