for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class Nip_Form_Element_Money extends Nip_Form_Element_Input
{
protected $_type = 'money';
public function init()
parent::init();
$this->setAttrib('type', 'number');
$this->setOption('currency', '');
}
/**
* @inheritDoc
*/
public function setValue($value)
if (is_object($value)) {
/** @var \ByTIC\Money\Money $value */
$this->setOption('currency', $value->getCurrency());
$value = $value->formatByDecimal();
return parent::setValue($value);
public function getValue($requester = 'abstract')
return parent::getValue($requester);
parent::getValue($requester)
Nip\Form\Utility\HasAttributesTrait::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 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.