for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ValueObjects\DateTime;
use ValueObjects\Exception\InvalidNativeArgumentException;
use ValueObjects\Number\Natural;
class Minute extends Natural
{
const MIN_MINUTE = 0;
const MAX_MINUTE = 59;
/**
* Returns a new Minute 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 Minute
*/
public static function fromNative()
$value = func_get_arg(0);
return new static($value);
}
* Returns a new Minute object
public function __construct($value)
$options = array(
'options' => array('min_range' => self::MIN_MINUTE, 'max_range' => self::MAX_MINUTE)
);
$filteredValue = filter_var($value, FILTER_VALIDATE_INT, $options);
if (false === $filteredValue) {
throw new InvalidNativeArgumentException($value, array('int (>=0, <=59)'));
parent::__construct($filteredValue);
* Returns the current minute.
public static function now()
$now = new \DateTime('now');
$minute = \intval($now->format('i'));
return new static($minute);
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.