Changeset View
Changeset View
Standalone View
Standalone View
plugins/libcalendaring/lib/Horde_Date_Recurrence.php
Show First 20 Lines • Show All 1559 Lines • ▼ Show 20 Line(s) | |||||
if ($update_weekday) { | if ($update_weekday) { | ||||
$this->setNthWeekday($nth_weekday); | $this->setNthWeekday($nth_weekday); | ||||
} | } | ||||
} | } | ||||
// Exceptions. | // Exceptions. | ||||
if (isset($hash['exclusion'])) { | if (isset($hash['exclusion'])) { | ||||
foreach ($hash['exclusion'] as $exception) { | foreach ($hash['exclusion'] as $exception) { | ||||
if ($exception instanceof DateTime) { | if ($exception instanceof DateTime || $exception instanceof DateTimeImmutable) { | ||||
machniak: Checking just for `instanceof DateTimeInterface` would work too, and be shorter. No? | |||||
$this->exceptions[] = $exception->format('Ymd'); | $this->exceptions[] = $exception->format('Ymd'); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (isset($hash['complete'])) { | if (isset($hash['complete'])) { | ||||
foreach ($hash['complete'] as $completion) { | foreach ($hash['complete'] as $completion) { | ||||
if ($exception instanceof DateTime) { | if ($exception instanceof DateTime || $exception instanceof DateTimeImmutable) { | ||||
$this->completions[] = $completion->format('Ymd'); | $this->completions[] = $completion->format('Ymd'); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines |
Checking just for instanceof DateTimeInterface would work too, and be shorter. No?