for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class Nip_Form_Renderer_Elements_Checkbox extends Nip_Form_Renderer_Elements_Input_Abstract
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.
{
public function generateElement()
if (!$this->getElement()->getValue()) {
$this->getElement()->getValue()
Nip\Form\Elements\AbstractElement::getValue()
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()->setValue('on');
}
$this->getElement()->removeClass('form-control');
$this->getElement()->addClass('form-check-input');
$class = get_class($this->getRenderer()) == Nip_Form_Renderer_Bootstrap::class ? 'checkbox' : 'form-check';
$return = '<div class="'.$class.'">';
$return .= '<label class="form-check-label">';
$return .= parent::generateElement();
$return .= ' '.$this->getElement()->getLabel();
$return .= '</label>';
$return .= '</div>';
return $return;
public function getelementattribs()
$attribs = parent::getelementattribs();
$attribs[] = 'checked';
return $attribs;
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.