Skip to content

Commit 83acd5a

Browse files
ro0NLnicolas-grekas
authored andcommitted
[DI] Reference tagged services in config
1 parent eaa08af commit 83acd5a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Inline.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,8 @@ private static function parseTag($value, &$i, $flags)
774774
$nextOffset += strspn($value, ' ', $nextOffset);
775775

776776
// Is followed by a scalar
777-
if (!isset($value[$nextOffset]) || !in_array($value[$nextOffset], array('[', '{'), true)) {
778-
// Manage scalars in {@link self::evaluateScalar()}
777+
if ((!isset($value[$nextOffset]) || !in_array($value[$nextOffset], array('[', '{'), true)) && 'tagged' !== $tag) {
778+
// Manage non-whitelisted scalars in {@link self::evaluateScalar()}
779779
return;
780780
}
781781

Parser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,8 @@ private function parseValue($value, $flags, $context)
698698
if ('' !== $matches['tag']) {
699699
if ('!!binary' === $matches['tag']) {
700700
return Inline::evaluateBinaryScalar($data);
701+
} elseif ('tagged' === $matches['tag']) {
702+
return new TaggedValue(substr($matches['tag'], 1), $data);
701703
} elseif ('!' !== $matches['tag']) {
702704
@trigger_error(sprintf('Using the custom tag "%s" for the value "%s" is deprecated since version 3.3. It will be replaced by an instance of %s in 4.0.', $matches['tag'], $data, TaggedValue::class), E_USER_DEPRECATED);
703705
}

0 commit comments

Comments
 (0)