8000 [DI] remove deprecated tag !tagged in favor of !tagged_iterator by jschaedl · Pull Request #31967 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI] remove deprecated tag !tagged in favor of !tagged_iterator #31967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[DI] removed tagged
  • Loading branch information
jschaedl committed Jun 9, 2019
commit 997818406a6580dd1cda995e80dfbc000a166b75
1 change: 1 addition & 0 deletions src/Symfony/Component/DependencyInjection/CHANGELOG.md
8000
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CHANGELOG
* removed support for short factory/configurator syntax from `YamlFileLoader`
* removed `ResettableContainerInterface`, use `ResetInterface` instead
* added argument `$returnsClone` to `Definition::addMethodCall()`
* removed `tagged`, use `tagged_iterator` instead

4.4.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,6 @@ function iterator(array $values): IteratorArgument
return new IteratorArgument(AbstractConfigurator::processValue($values, true));
}

/**
* Creates a lazy iterator by tag name.
*
* @deprecated since Symfony 4.4, to be removed in 5.0, use "tagged_iterator" instead.
*/
function tagged(string $tag, string $indexAttribute = null, string $defaultIndexMethod = null): TaggedIteratorArgument
{
@trigger_error(__NAMESPACE__.'\tagged() is deprecated since Symfony 4.4 and will be removed in 5.0, use '.__NAMESPACE__.'\tagged_iterator() instead.', E_USER_DEPRECATED);

return new TaggedIteratorArgument($tag, $indexAttribute, $defaultIndexMethod);
}

/**
* Creates a lazy iterator by tag name.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,6 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =
throw new InvalidArgumentException(sprintf('Tag "<%s>" with type="service_locator" only accepts maps of type="service" references in "%s".', $name, $file));
}
break;
case 'tagged':
@trigger_error(sprintf('Type "%s" of tag <%s> in "%s" is deprecated since Symfony 4.4 and will be removed in 5.0, use "tagged_iterator" instead.', $arg->getAttribute('type'), $name, $file), E_USER_DEPRECATED);
// no break
case 'tagged_iterator':
case 'tagged_locator':
$type = $arg->getAttribute('type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,7 @@ private function resolveServices($value, $file, $isParameter = false)
throw new InvalidArgumentException(sprintf('"!service_locator" tag only accepts maps of "@service" references in "%s".', $file));
}
}
if (\in_array($value->getTag(), ['tagged', 'tagged_iterator', 'tagged_locator'], true)) {
if ('tagged' === $value->getTag()) {
@trigger_error('"!tagged" is deprecated since Symfony 4.4 and will be removed in 5.0, use "!tagged_iterator" instead.', E_USER_DEPRECATED);
}

if (\in_array($value->getTag(), ['tagged_iterator', 'tagged_locator'], true)) {
$forLocator = 'tagged_locator' === $value->getTag();

if (\is_string($argument) && $argument) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@
<xsd:enumeration value="constant" />
<xsd:enumeration value="iterator" />
<xsd:enumeration value="service_locator" />
<!-- "tagged" is deprecated since Symfony 4.4 and will be removed in 5.0, use "tagged_iterator" instead. -->
<xsd:enumeration value="tagged" />
<xsd:enumeration value="tagged_iterator" />
<xsd:enumeration value="tagged_locator" />
</xsd:restriction>
Expand Down
0