Skip to content

[DependencyInjection] Define default priority inside service class #31943

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

Closed
wants to merge 13 commits into from
Closed
Prev Previous commit
Next Next commit
Merge branch '4.4' into patch-1
  • Loading branch information
pcabreus authored Jun 10, 2019
commit 4fed2a31a0a3664cf3e1c9688f217e3f2bf9747f
1 change: 1 addition & 0 deletions src/Symfony/Component/DependencyInjection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHANGELOG
-----

* deprecated support for short factories and short configurators in Yaml
* deprecated `tagged` in favor of `tagged_iterator`
* added ability to define an priority method for a tagged collection

4.3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,16 @@ private function dumpValue($value)
$content['default_index_method'] = $tag->getDefaultIndexMethod();
}
}

if (null !== $tag->getDefaultPriorityMethod()) {
$content['default_priority_method'] = $tag->getDefaultPriorityMethod();
}

if (count($content) === 1) {
$content = $tag->getTag();
}

return new TaggedValue($value instanceof TaggedIteratorArgument ? 'tagged' : 'tagged_locator', $content);
return new TaggedValue($value instanceof TaggedIteratorArgument ? 'tagged_iterator' : 'tagged_locator', $content);
}

if ($value instanceof IteratorArgument) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ 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, bool $needsIndexes = false, string $defaultPriorityMethod = null): TaggedIteratorArgument
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be reverted, this function is deprecated, no need to alter it

{
@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, $needsIndexes, $defaultPriorityMethod);
}

/**
* Creates a lazy iterator by tag name.
*
Expand All @@ -123,9 +135,9 @@ function iterator(array $values): IteratorArgument
* @param string|null $defaultPriorityMethod
* @return TaggedIteratorArgument
*/
function tagged(string $tag, string $indexAttribute = null, string $defaultIndexMethod = null, bool $needsIndexes = false, string $defaultPriorityMethod = null): TaggedIteratorArgument
function tagged_iterator(string $tag, string $indexAttribute = null, string $defaultIndexMethod = null, bool $needsIndexes = false, string $defaultPriorityMethod = null): TaggedIteratorArgument
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$needsIndexes should be removed, it's always false for iterators

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

/**
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy