$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
18
$start = new Chronos(/** @scrutinizer ignore-type */ $start);
Loading history...
19
$end = new Chronos($end);
20
21
if ($start->isFuture()) {
22
throw new DateException("Start date \"{$start}\" must be in the past");
23
}
24
25
if ($end->isFuture()) {
26
throw new DateException("End date \"{$end}\" must be in the past");
27
}
28
29
if ($start > $end) {
30
throw new DateException("Start date \"{$start}\" must be smaller than end date \"{$end}\"");