$start of type DateTimeInterface is incompatible with the type null|string expected by parameter $time of Cake\Chronos\Chronos::__construct().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
57
$start = new Chronos(/** @scrutinizer ignore-type */ $start);
Loading history...
58
$end = new Chronos($end);
59
60
if ($start->isFuture()) {
61
throw new DateException("Start date \"{$start}\" must be in the past");
62
}
63
64
if ($end->isFuture()) {
65
throw new DateException("End date \"{$end}\" must be in the past");
66
}
67
68
if ($start > $end) {
69
throw new DateException("Start date \"{$start}\" must be smaller than end date \"{$end}\"");