for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class Nip_Form_Renderer_Elements_Dateinput extends Nip_Form_Renderer_Elements_Input
{
public function generateElement()
if (!$this->getElement()->getAttrib('id')) {
$this->getElement()->getAttrib('id')
Nip\Form\Elements\AbstractElement::getAttrib()
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.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
$this->getElement()->setAttrib('id', $this->getElement()->getJSID());
}
$return = parent::generateElement();
return $return;
/**
* @return array
*/
public function getElementAttribs(): array
$attribs = parent::getElementAttribs();
$attribs[] = 'min';
$attribs[] = 'max';
return $attribs;
This check looks for function or method calls that always return null and whose return value is used.
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.