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

FIX Allow passing objects to InjectionCreator::create() #10555

Merged

Conversation

emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Oct 19, 2022

Issue #10533

Replacement for #10539

Main difference is the use of get_class($class) instead of return $class to ensure that a new instance is always created. I've also changed the unit testing.

I've also tidied up some of the previous ?? '' added as part of the php 8.1 code-writing

This is technically a bugfix since it restores previous behavior of allow anonymous classes, which will unintentional, seems like it has a valid use case in unit testing. Anonymous classes can be cleaner to use then the at times cumbersome combination of TestOnly classes with private static $extra_dataobjects

I've put n8-dev down as a co-author

Co-authored-by: Nate Devereux <nate@daveclark.co.nz>
@michalkleiner
Copy link
Contributor

Looks good to me!

@michalkleiner michalkleiner merged commit 0c207c3 into silverstripe:4.11 Oct 19, 2022
@GuySartorelli GuySartorelli deleted the pulls/4.11/inject-objects branch October 19, 2022 08:12
@emteknetnz
Copy link
Member Author

@n8-dev I've tagged 4.11.11 for you https://github.com/silverstripe/silverstripe-framework/releases/tag/4.11.11

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.

None yet

2 participants