8000 bug #30992 [TwigBridge][DependencyInjection] ignore null arguments (x… · symfony/symfony@02e865b · GitHub
[go: up one dir, main page]

Skip to content

Commit 02e865b

Browse files
committed
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 ------- 44eb7a0 fix backwards compatibility breaks
2 parents 408e4aa + 44eb7a0 commit 02e865b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct($urlHelper)
4747
$requestContext = null;
4848
if (2 === \func_num_args()) {
4949
$requestContext = \func_get_arg(1);
50-
if (!$requestContext instanceof RequestContext) {
50+
if (null !== $requestContext && !$requestContext instanceof RequestContext) {
5151
throw new \TypeError(sprintf('The second argument must be an instance of "%s".', RequestContext::class));
5252
}
5353
}

src/Symfony/Component/DependencyInjection/Argument/BoundArgument.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ public function getValues()
5353
*/
5454
public function setValues(array $values)
5555
{
56-
list($this->value, $this->identifier, $this->used, $this->type, $this->file) = $values;
56+
if (5 === count($values)) {
57+
list($this->value, $this->identifier, $this->used, $this->type, $this->file) = $values;
58+
} else {
59+
list($this->value, $this->identifier, $this->used) = $values;
60+
}
5761
}
5862
}

0 commit comments

Comments
 (0)
0