Added EncapsulatedOptions::merge() and accompanying test#5
Closed
Added EncapsulatedOptions::merge() and accompanying test#5
Conversation
Changed EncapsulatedOptions::set() to reject objects and resources.
58c5aa2 to
098de60
Compare
Bilge
commented
Oct 21, 2016
| */ | ||
| final protected function set($option, $value) | ||
| { | ||
| if (is_object($value) || is_resource($value)) { |
Member
Author
There was a problem hiding this comment.
TODO: This value type checking needs to be extended to recursively check array values and defaults.
01c8862 to
d8cd138
Compare
Member
Author
|
This is no longer needed since #48, which removes the need to pass options around, to have multiple option instances, and therefore the need to merge instances together. No longer do we have to make guesses about how different sets of options should be merged because we only ever deal with one set of options and specific option implementations can decide how their properties should be managed, which is an altogether more robust approach. |
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.
This PR implements option merging for
EncapsulatedOptionssuch that two compatible instances may be merged into each other. This is a common use case since a provider may supply options and a resource supplies its own superset of the same options class which need to be combined before they're forwarded to the connector.There are some interesting questions raised by this.
Currently this PR implements the following answers to these questions, subject to change.