Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7cd5106

Browse filesBrowse files
committed
fix more numeric cases changing in PHP 8
1 parent 4b3d5b6 commit 7cd5106
Copy full SHA for 7cd5106

File tree

2 files changed

+9
-1
lines changed
Filter options

2 files changed

+9
-1
lines changed

‎src/Symfony/Component/Yaml/Inline.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Inline.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public static function dump($value, $flags = 0)
210210
return 'false';
211211
case ctype_digit($value):
212212
return \is_string($value) ? "'$value'" : (int) $value;
213-
case is_numeric($value) && false === strpos($value, "\n"):
213+
case is_numeric($value) && false === strpos($value, "\f") && false === strpos($value, "\n") && false === strpos($value, "\r") && false === strpos($value, "\t") && false === strpos($value, "\v"):
214214
$locale = setlocale(LC_NUMERIC, 0);
215215
if (false !== $locale) {
216216
setlocale(LC_NUMERIC, 'C');

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Tests/InlineTest.php
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,14 @@ public function getTestsForDump()
570570
['[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', ['foo', '@foo.baz', ['%foo%' => 'foo is %foo%', 'bar' => '%foo%'], true, '@service_container']],
571571

572572
['{ foo: { bar: { 1: 2, baz: 3 } } }', ['foo' => ['bar' => [1 => 2, 'baz' => 3]]]],
573+
574+
// numeric strings with trailing whitespaces
575+
["'0123 '", '0123 '],
576+
['"0123\f"', "0123\f"],
577+
['"0123\n"', "0123\n"],
578+
['"0123\r"', "0123\r"],
579+
['"0123\t"', "0123\t"],
580+
['"0123\v"', "0123\v"],
573581
];
574582
}
575583

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.