for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ValueObjects\Climate;
use ValueObjects\Number\Natural;
use ValueObjects\Exception\InvalidNativeArgumentException;
class RelativeHumidity extends Natural
{
const MIN = 0;
const MAX = 100;
/**
* Returns a new RelativeHumidity from native int value
*
* @param int $value
$value
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @return RelativeHumidity
*/
public static function fromNative()
$value = func_get_arg(0);
return new static($value);
}
* Returns a new RelativeHumidity object
public function __construct($value)
$options = array(
'options' => array('min_range' => self::MIN, 'max_range' => self::MAX)
);
$filteredValue = filter_var($value, FILTER_VALIDATE_INT, $options);
if (false === $filteredValue) {
throw new InvalidNativeArgumentException($value, array('int (>=' . self::MIN . ', <=' . self::MAX . ')'));
parent::__construct($filteredValue);
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.