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('Date range is undefined');
public function getEndTime(): DateTimeInterface
public function setStartTime(DateTimeInterface $time): RangeState
return new InfiniteEndRange($time);
public function setEndTime(DateTimeInterface $time): RangeState
return new InfiniteStartRange($time);
public function isStartAt(DateTimeInterface $time): bool
public function isEndAt(DateTimeInterface $time): bool
public function isStarted(): bool
public function isEnded(): bool