for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Yoanm\JsonRpcServerDoc\Model\Type;
/**
* Class NumberDoc
*/
class NumberDoc extends ScalarDoc
{
/*** Validation ***/
/** @var null|int|float */
private $min = null;
private $max = null;
/** @var bool */
private $inclusiveMin = true;
private $inclusiveMax = true;
* @param int|float $min
*
* @return NumberDoc
public function setMin($min) : NumberDoc
if (null === $min || (!is_float($min) && !is_int($min))) {
is_int($min)
true
throw new \InvalidArgumentException('min must be either a float or an integer.');
}
$this->min = $min;
return $this;
* @param int|float $max
public function setMax($max) : NumberDoc
if (null === $max || (!is_float($max) && !is_int($max))) {
is_int($max)
throw new \InvalidArgumentException('max must be either a float or an integer.');
$this->max = $max;
* @param boolean $inclusiveMax
public function setInclusiveMax($inclusiveMax)
$this->inclusiveMax = $inclusiveMax;
* @param boolean $inclusiveMin
public function setInclusiveMin($inclusiveMin)
$this->inclusiveMin = $inclusiveMin;
* @return null|int|float
public function getMin()
return $this->min;
public function getMax()
return $this->max;
* @return boolean
public function isInclusiveMin()
return $this->inclusiveMin;
public function isInclusiveMax()
return $this->inclusiveMax;