Skip to content

[DependencyInjection] Sort services in service locator according to priority #42532

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 1 commit into from
Closed

[DependencyInjection] Sort services in service locator according to priority #42532

wants to merge 1 commit into from

Conversation

BoShurik
Copy link
Contributor

@BoShurik BoShurik commented Aug 13, 2021

Q A
Branch? 5.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #42506
License MIT
Doc PR -

@@ -102,7 +102,6 @@ public static function register(ContainerBuilder $container, array $refMap, stri
}
$refMap[$id] = new ServiceClosureArgument($ref);
}
ksort($refMap);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I understand sort here is for easy testing

@carsonbot
Copy link

Hey!

I think @fancyweb has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@nicolas-grekas nicolas-grekas added this to the 5.4 milestone Aug 18, 2021
@carsonbot carsonbot changed the title Sort services in service locator according to priority [DependencyInjection] Sort services in service locator according to priority Aug 18, 2021
@nicolas-grekas
Copy link
Member

Can you please add a test case that covers the new behavior?

@nicolas-grekas
Copy link
Member

Oh, and please have a look at failing test cases.

@nicolas-grekas
Copy link
Member

Friendly ping @BoShurik

@BoShurik
Copy link
Contributor Author

BoShurik commented Sep 8, 2021

@nicolas-grekas yes, it's in my todo-list for this week

@BoShurik
Copy link
Contributor Author

BoShurik commented Sep 9, 2021

@nicolas-grekas I am not sure how to fix 7.4, high-deps tests.
As I understand in this case my changes in DependencyInjection used as a dependency for HttpKernel tests and those tests falls
So we need to exclude symfony/dependency-injection: 5.4 for symfony/http-kernel: 4.4. Is it possible?

@nicolas-grekas
Copy link
Member

So we need to exclude symfony/dependency-injection: 5.4 for symfony/http-kernel: 4.4. Is it possible?

no need to exclude: we should patch 4.4 instead to relax the test case, which is too strict apparently

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

(but please send a PR for 4.4 to relax the tests)

@fabpot fabpot closed this in 4f1e0dd Sep 10, 2021
@fabpot
Copy link
Member

fabpot commented Sep 10, 2021

Thank you @BoShurik.

fabpot added a commit that referenced this pull request Sep 10, 2021
… according to priority (BoShurik)

This PR was merged into the 5.4 branch.

Discussion
----------

[DependencyInjection] Sort services in service locator according to priority

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #42506
| License       | MIT
| Doc PR        | -

Commits
-------

c67c2df Sort services in service locator according to priority
This was referenced Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DependencyInjection] Priority ignored for tagged locator
4 participants