for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Zee\DateRange\States;
use DateTimeInterface;
use Zee\DateRange\DateRangeException;
/**
* Class UndefinedRange.
*/
class UndefinedRange implements RangeState
{
* {@inheritdoc}
public function __toString(): string
return '-/-';
}
public function jsonSerialize(): array
return ['startTime' => null, 'endTime' => null];
public function hasStartTime(): bool
return false;
public function hasEndTime(): bool
public function getStartTime(): DateTimeInterface
throw new DateRangeException('Range start is undefined');
public function getEndTime(): DateTimeInterface
throw new DateRangeException('Range end is undefined');
public function setStartTime(DateTimeInterface $time): RangeState
return new InfiniteEndRange($time);
public function setEndTime(DateTimeInterface $time): RangeState
return new InfiniteStartRange($time);
public function compareStartTime(DateTimeInterface $time): int
public function compareEndTime(DateTimeInterface $time): int