Skip to content

Commit

Permalink
bug #30992 [TwigBridge][DependencyInjection] ignore null arguments (x…
Browse files Browse the repository at this point in the history
…abbuh)

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
-------

44eb7a0 fix backwards compatibility breaks
  • Loading branch information
fabpot committed Apr 8, 2019
2 parents 408e4aa + 44eb7a0 commit 02e865b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -47,7 +47,7 @@ public function __construct($urlHelper)
$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));
}
}
Expand Down
Expand Up @@ -53,6 +53,10 @@ public function getValues()
*/
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;
}
}
}

0 comments on commit 02e865b

Please sign in to comment.