Skip to content

Commit b09d67b

Browse files
committed
[Yaml] Fix scope resolution operator in flow mapping keys
1 parent 179b553 commit b09d67b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Symfony/Component/Yaml/Inline.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a
453453
}
454454

455455
if ('!php/const' === $key || '!php/enum' === $key) {
456-
$key .= ' '.self::parseScalar($mapping, $flags, [':'], $i, false);
456+
$key .= ' '.self::parseScalar($mapping, $flags, ['(?<!:):(?!:)'], $i, false);
457457
$key = self::evaluateScalar($key, $flags);
458458
}
459459

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public static function getTestsForParsePhpConstants()
6363
['{ foo: !php/const PHP_INT_MAX }', ['foo' => \PHP_INT_MAX]],
6464
['{ !php/const PHP_INT_MAX: foo }', [\PHP_INT_MAX => 'foo']],
6565
['!php/const NULL', null],
66+
['{ !php/const Symfony\Component\Yaml\Yaml::PARSE_CONSTANT: foo }', [Yaml::PARSE_CONSTANT => 'foo']],
6667
];
6768
}
6869

0 commit comments

Comments
 (0)