/**
* @return array
*/
public static function castPeriod(\DatePeriod
$p, array
$a, Stub
$stub, bool
$isNested, int
$filter) { $dates =
[];
foreach (clone $p as $i =>
$d) { if (self::PERIOD_LIMIT ===
$i) { $now =
new \
DateTimeImmutable('now',
new \
DateTimeZone('UTC'
));
$dates[] =
sprintf('%s more',
($end =
$p->
getEndDate()) ?
ceil(($end->
format('U.u'
) -
$d->
format('U.u'
)) /
((int) $now->
add($p->
getDateInterval())->
format('U.u'
) -
(int) $now->
format('U.u'
))) :
$p->recurrences -
$i );
break;
} $dates[] =
sprintf('%s) %s',
$i + 1, self::
formatDateTime($d));
} $period =
sprintf( 'every %s, from %s%s %s',
self::
formatInterval($p->
getDateInterval()),