Nip_Form_Element_Hidden   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 17
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDataFromRequest() 0 7 2
A init() 0 4 1
1
<?php
2
3
class Nip_Form_Element_Hidden extends Nip_Form_Element_Input_Abstract
4
{
5
    protected $_type = 'hidden';
6
7
    public function init()
8
    {
9
        parent::init();
10
        $this->setAttrib('type', 'hidden');
11
    }
12
13
    public function getDataFromRequest($request)
14
    {
15
        if ($this->getOption('readRequest') === true) {
0 ignored issues
show
introduced by
The condition $this->getOption('readRequest') === true is always false.
Loading history...
Bug introduced by
Are you sure the usage of $this->getOption('readRequest') targeting Nip\Form\Elements\AbstractElement::getOption() 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...
16
            return parent::getDataFromRequest($request);
17
        }
18
19
        return $this;
20
    }
21
}
22