TextArea   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 3 1
A handle() 0 4 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
  }