bug #30992 [TwigBridge][DependencyInjection] ignore null arguments (xabbuh)
This PR was merged into the 4.3-dev branch.
Discussion
----------
[TwigBridge][DependencyInjection] ignore null arguments
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
44eb7a0485
fix backwards compatibility breaks
This commit is contained in:
commit
02e865b298
@ -47,7 +47,7 @@ class HttpFoundationExtension extends AbstractExtension
|
||||
$requestContext = null;
|
||||
if (2 === \func_num_args()) {
|
||||
$requestContext = \func_get_arg(1);
|
||||
if (!$requestContext instanceof RequestContext) {
|
||||
if (null !== $requestContext && !$requestContext instanceof RequestContext) {
|
||||
throw new \TypeError(sprintf('The second argument must be an instance of "%s".', RequestContext::class));
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,10 @@ final class BoundArgument implements ArgumentInterface
|
||||
*/
|
||||
public function setValues(array $values)
|
||||
{
|
||||
list($this->value, $this->identifier, $this->used, $this->type, $this->file) = $values;
|
||||
if (5 === count($values)) {
|
||||
list($this->value, $this->identifier, $this->used, $this->type, $this->file) = $values;
|
||||
} else {
|
||||
list($this->value, $this->identifier, $this->used) = $values;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user