Laravel 5.6 updates
Travis config update Removed HHVM script as Laravel no longer support HHVM after releasing 5.3
This commit is contained in:
17
vendor/symfony/var-dumper/Caster/DateCaster.php
vendored
17
vendor/symfony/var-dumper/Caster/DateCaster.php
vendored
@@ -20,6 +20,8 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
*/
|
||||
class DateCaster
|
||||
{
|
||||
private const PERIOD_LIMIT = 3;
|
||||
|
||||
public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, $isNested, $filter)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
@@ -61,12 +63,7 @@ class DateCaster
|
||||
$format .= ($i->y ? '%yy ' : '').($i->m ? '%mm ' : '').($i->d ? '%dd ' : '');
|
||||
}
|
||||
|
||||
if (\PHP_VERSION_ID >= 70100 && isset($i->f)) {
|
||||
$format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : '';
|
||||
} else {
|
||||
$format .= $i->h || $i->i || $i->s ? '%H:%I:%S' : '';
|
||||
}
|
||||
|
||||
$format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : '';
|
||||
$format = '%R ' === $format ? '0s' : $format;
|
||||
|
||||
return $i->format(rtrim($format));
|
||||
@@ -76,7 +73,7 @@ class DateCaster
|
||||
{
|
||||
$location = $timeZone->getLocation();
|
||||
$formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P');
|
||||
$title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code'], \Locale::getDefault()) : '';
|
||||
$title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code']) : '';
|
||||
|
||||
$z = array(Caster::PREFIX_VIRTUAL.'timezone' => new ConstStub($formatted, $title));
|
||||
|
||||
@@ -85,14 +82,10 @@ class DateCaster
|
||||
|
||||
public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, $isNested, $filter)
|
||||
{
|
||||
if (\defined('HHVM_VERSION_ID') || \PHP_VERSION_ID < 50620 || (\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70005)) { // see https://bugs.php.net/bug.php?id=71635
|
||||
return $a;
|
||||
}
|
||||
|
||||
$dates = array();
|
||||
if (\PHP_VERSION_ID >= 70107) { // see https://bugs.php.net/bug.php?id=74639
|
||||
foreach (clone $p as $i => $d) {
|
||||
if (3 === $i) {
|
||||
if (self::PERIOD_LIMIT === $i) {
|
||||
$now = new \DateTimeImmutable();
|
||||
$dates[] = sprintf('%s more', ($end = $p->getEndDate())
|
||||
? ceil(($end->format('U.u') - $d->format('U.u')) / ($now->add($p->getDateInterval())->format('U.u') - $now->format('U.u')))
|
||||
|
Reference in New Issue
Block a user