Skip to content

Commit 89412a6

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: skip intl dependent tests if the extension is missing make DateCaster tests timezone-agnostic error if the input string couldn't be parsed as a date IntegerType: Always use en for IntegerToLocalizedStringTransformer Fixes #40456 Uses the correct assignment action for console options depending if they are short or long [HttpKernel] ConfigDataCollector to return known data without the need of a Kernel [HttpClient] fix using stream_copy_to_stream() with responses cast to php streams FIx Trying to clone an uncloneable object of class
2 parents 25b0e8e + 0da0e17 commit 89412a6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Caster/DateCaster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, bool $is
9191
$dates = [];
9292
foreach (clone $p as $i => $d) {
9393
if (self::PERIOD_LIMIT === $i) {
94-
$now = new \DateTimeImmutable();
94+
$now = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
9595
$dates[] = sprintf('%s more', ($end = $p->getEndDate())
9696
? ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u')))
9797
: $p->recurrences - $i

Tests/Caster/DateCasterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public function testDumpPeriod($start, $interval, $end, $options, $expected)
341341
*/
342342
public function testCastPeriod($start, $interval, $end, $options, $xPeriod, $xDates)
343343
{
344-
$p = new \DatePeriod(new \DateTime($start), new \DateInterval($interval), \is_int($end) ? $end : new \DateTime($end), $options);
344+
$p = new \DatePeriod(new \DateTime($start, new \DateTimeZone('UTC')), new \DateInterval($interval), \is_int($end) ? $end : new \DateTime($end, new \DateTimeZone('UTC')), $options);
345345
$stub = new Stub();
346346

347347
$cast = DateCaster::castPeriod($p, [], $stub, false, 0);

0 commit comments

Comments
 (0)