Skip to content
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

Allow classes to be passed into Injector::inst()->load() #10539

Closed
wants to merge 5 commits into from

Conversation

n8-dev
Copy link

@n8-dev n8-dev commented Oct 10, 2022

Issue:

Progress on #10533

Summary:

It appears there was a breaking change in #10265 that prevents anonymous classes (to override specific functions in tests) being passed into Injector::inst()->load().

Thus this is a breaking change from 4.10 to 4.11

Objective

This PR's purpose is to bring back this functionality, whilst keeping any speed gains from #10265

Spurred off @kinglozzer comments there, and conversation with @GuySartorelli in SS Users slack.

I have tested this locally with business logic, and this resolves the original issue.

Comments

As this adds another path through InjectionCreator it needs some unit tests.
I am not sure where is would be best to add this, doesn't appear to be a dedicated TestInjectionCreator file or anything.

Happy for someone else to write the tests or point me in the right direction.

Parent issue

@emteknetnz
Copy link
Member

@n8-dev thanks for your contribution - there's some changes I wanted to make on this. To better fit with our internal workflow I've opened a new pull-request that builds of this one here - I've put you down as a co-author in the single git commit in that pull-request

Thanks again

@emteknetnz emteknetnz closed this Oct 19, 2022
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.

3 participants