Skip to content

Show circular list of depedencies on circular dependancy error message #886

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
Jul 21, 2024

Conversation

bdsl
Copy link
Contributor

@bdsl bdsl commented Jun 25, 2024

Sometimes it can take a while to trace through the dependencies to find a circle. But the container knows the dependencies its trying to resolve when it throws this error, so outputting that in the exception message should help.

May need a bit more work to only show the circle instead of the full list of dependencies being resolved.

@mnapoli
Copy link
Member

mnapoli commented Jun 25, 2024

Sounds great, can you add a new test to cover this?

@bdsl
Copy link
Contributor Author

bdsl commented Jul 19, 2024

Hi @mnapoli! I'm sorry I only just saw your message today. I've edited the existing test assertions to assert on the full new error message. Apologies for the delay. Doing that also lead me to copy the same functionality into the compiled container.

I've rebased onto origin/aster.

@mnapoli
Copy link
Member

mnapoli commented Jul 21, 2024

Thank you!

@mnapoli mnapoli merged commit e87435e into PHP-DI:master Jul 21, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants