[4.x] Improve container extensibility#61
Closed
voronkovich wants to merge 3 commits intojoomla-framework:4.x-devfrom
Closed
[4.x] Improve container extensibility#61voronkovich wants to merge 3 commits intojoomla-framework:4.x-devfrom
voronkovich wants to merge 3 commits intojoomla-framework:4.x-devfrom
Conversation
faca5ca to
a350581
Compare
Contributor
|
I'm not really happy with the direction, you can't really test this in you own component if you have a typo or not (at least it's harder) also static code analyzers need much more support for this. It's also a hard b/c break, I'm pretty sure that this will not happen in this way. |
Contributor
Author
|
@HLeithner, thanks for your review! I've added checking for allowed options. Now, if an unknown option is provided, an exception is thrown. Also, I've implemented a simple BC layer to avoid breaking existing code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current design of the
Containerclass lacks extensibility. For example, it's not possible to add a new type of service (e.g. lazy services) without dirty hacks or BC breaks.Summary of Changes
This PR replaces the use of
$mode,$sharedand$protectedparameters with a single plain$optionsarray.It allows us to easily add new types of services and options in the future:
Testing Instructions
Launch
phpunitand ensure that the tests are passed.Documentation Changes Required
Yes