This repository has been archived by the owner on Feb 6, 2020. It is now read-only.
Ensure a null
value is passed to setCreationOptions
instead of empty array
#210
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.
Per #159 (comment), the updates in #205 broke a previously fixed edge case whereby
AbstractPluginManager::createServiceViaCallback()
would inject anull
value to a factory'ssetCreationOptions()
method if no instance options were provided; it instead passed an empty array, which broke a number of plugins that relied on a null value being present.This patch does the following:
AbstractPluginManager::createServiceViaCallback()
to have three distinct behaviors surrounding creation options, in the following order:InvokableFactory
, it tests if the creation options are an array or non-empty; if not, it passes anull
value tosetCreationOptions()
.MutableCreationOptionsInterface
, it tests if the creation options are an array or non-empty; if not, it passes an empty array tosetCreationOptions()
.setCreationOptions()
and the creation options are a non-array or non-empty, it reflects the method to determine if the options argument has a default value, using that if present, or an empty array if not.