8000 bug #18858 [Yaml] fix falsely triggered deprecation (xabbuh) · symfony/symfony@93139f6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 93139f6

Browse files
committed
bug #18858 [Yaml] fix falsely triggered deprecation (xabbuh)
This PR was merged into the 3.1-dev branch. Discussion ---------- [Yaml] fix falsely triggered deprecation | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | https://github.com/symfony/symfony/pull/18785/files#r64390640 | License | MIT | Doc PR | Commits ------- 89dd69a [Yaml] fix falsely triggered deprecation
2 parents c2f3b1e + 89dd69a commit 93139f6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Component/Yaml/Inline.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,11 @@ private static function evaluateScalar($scalar, $flags, $references = array())
591591
case 0 === strpos($scalar, '!!binary '):
592592
return self::evaluateBinaryScalar(substr($scalar, 9));
593593
case preg_match('/^(-|\+)?[0-9][0-9,]*(\.[0-9_]+)?$/', $scalar):
594-
@trigger_error('Using the comma as a group separator for floats is deprecated since version 3.2 and will be removed in 4.0.', E_USER_DEPRECATED);
595594
case preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar):
595+
if (false !== strpos($scalar, ',')) {
596+
@trigger_error('Using the comma as a group separator for floats is deprecated since version 3.2 and will be removed in 4.0.', E_USER_DEPRECATED);
597+
}
598+
596599
return (float) str_replace(array(',', '_'), '', $scalar);
597600
case preg_match(self::getTimestampRegex(), $scalar):
598601
if (Yaml::PARSE_DATETIME & $flags) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ public function getTestsForParse()
292292
array('"quoted string"', 'quoted string'),
293293
array("'quoted string'", 'quoted string'),
294294
array('12.30e+02', 12.30e+02),
295+
array('123.45_67', 123.4567),
295296
array('0x4D2', 0x4D2),
296297
array('0x_4_D_2_', 0x4D2),
297298
array('02333', 02333),

0 commit comments

Comments
 (0)
0