TextArea::handle()   A
last analyzed

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 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
  namespace Fiv\Form\Element;
4
5
  use Fiv\Form\FormData;
6
7
  /**
8
   * Generate <textarea></textarea> html tag
9
   *
10
   * @author Ivan Shcherbak <[email protected]>
11
   */
12
  class TextArea extends BaseElement {
13
14
    /**
15
     * @return string
16
     */
17 2
    public function render() {
18 2
      return '<textarea ' . Html::renderAttributes($this->getAttributes()) . '>' . $this->getValue() . '</textarea>';
19
    }
20
21
22
    /**
23
     * @inheritdoc
24
     */
25 2
    public function handle(FormData $data) {
26 2
      $this->setValue($data->get($this->getName()));
27 2
      return $this;
28
    }
29
  }