Completed
Push — master ( 8431a9...0bccd4 )
by Gabriel
04:28
created

Nip_Form_Renderer_Elements_Textarea   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 9
c 1
b 0
f 0
dl 0
loc 16
ccs 0
cts 10
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A generateElement() 0 6 1
A getElementAttribs() 0 6 1
1
<?php
2
class Nip_Form_Renderer_Elements_Textarea extends Nip_Form_Renderer_Elements_Abstract
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
3
{
4
    public function generateElement()
5
    {
6
        $return = '<textarea ';
7
        $return .= $this->renderAttributes();
8
        $return .= ' >' . $this->getElement()->getValue() . '</textarea>';
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->getElement()->getValue() targeting Nip\Form\Elements\AbstractElement::getValue() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
9
        return $return;
10
    }
11
12
    public function getElementAttribs()
13
    {
14
        $attribs = parent::getElementAttribs();
15
        $attribs[] = 'rows';
16
        $attribs[] = 'cols';
17
        return $attribs;
18
    }
19
}
20