Skip to content

Commit d172acd

Browse files
Merge branch '3.4' into 4.3
* 3.4: [Yaml] Implement multiline string as scalar block for tagged values [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given [FrameworkBundle] Use UserInterface to @return in getUser method [CI] Replace php7.4snapshot with php7.4 in Travis configuration [ExpressionLanguage][Node][BinaryNode] Process division by zero forward caught exception [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime add tags before processing them [MonologBridge] Fix debug processor datetime type
2 parents c6bcd90 + 78eec73 commit d172acd

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

ConstraintValidator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ protected function formatValue($value, $format = 0)
9393
// neither the native nor the stub IntlDateFormatter support
9494
// DateTimeImmutable as of yet
9595
if (!$value instanceof \DateTime) {
96-
$value = new \DateTime(
97-
$value->format('Y-m-d H:i:s.u e'),
98-
$value->getTimezone()
99-
);
96+
$value = new \DateTime($value->format('Y-m-d H:i:s.u e'));
10097
}
10198

10299
return $formatter->format($value);

Tests/Constraints/AbstractComparisonValidatorTestCase.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ protected static function addPhp5Dot5Comparisons(array $comparisons)
5353

5454
foreach ($comparison as $i => $value) {
5555
if ($value instanceof \DateTime) {
56-
$comparison[$i] = new \DateTimeImmutable(
57-
$value->format('Y-m-d H:i:s.u e'),
58-
$value->getTimezone()
59-
);
56+
$comparison[$i] = new \DateTimeImmutable($value->format('Y-m-d H:i:s.u e'));
6057
$add = true;
6158
} elseif ('DateTime' === $value) {
6259
$comparison[$i] = 'DateTimeImmutable';

0 commit comments

Comments
 (0)