8000 [Yaml] set arguments depending on the PHP version · symfony/symfony@ad54d83 · GitHub
[go: up one dir, main page]

Skip to content

Commit ad54d83

Browse files
committed
[Yaml] set arguments depending on the PHP version
1 parent 7301302 commit ad54d83

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Component/Yaml/Tests/InlineTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,12 @@ public function testParseTimestampAsDateTimeObject($yaml, $year, $month, $day, $
507507
$expected = new \DateTime($yaml);
508508
$expected->setTimeZone(new \DateTimeZone('UTC 79F6 '));
509509
$expected->setDate($year, $month, $day);
510-
@$expected->setTime($hour, $minute, $second, 1000000 * ($second - (int) $second));
510+
511+
if (PHP_VERSION_ID >= 70100) {
512+
$expected->setTime($hour, $minute, $second, 1000000 * ($second - (int) $second));
513+
} else {
514+
$expected->setTime($hour, $minute, $second);
515+
}
511516

512517
$this->assertEquals($expected, Inline::parse($yaml, Yaml::PARSE_DATETIME));
513518
}

0 commit comments

Comments
 (0)
0