Issues (138)

src/Elements/Hidden.php (2 issues)

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
The condition $this->getOption('readRequest') === true is always false.
Loading history...
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