Files
kupshop/class/class.Range.php
2025-08-02 16:30:27 +02:00

42 lines
674 B
PHP

<?php
class Range implements \JsonSerializable
{
private $min;
private $max;
public function __construct($min = null, $max = null)
{
$this->min = $min;
$this->max = $max;
}
public function min()
{
return $this->min;
}
public function max()
{
return $this->max;
}
public function isNull()
{
return $this->min === null && $this->max === null;
}
public function isNotNull()
{
return !$this->isNull();
}
public function jsonSerialize(): mixed
{
return [
'min' => $this->min,
'max' => $this->max,
];
}
}