Skip to content

Commit 45360b3

Browse files
committed
fix(Condition): fix an issue with array_pad/array_shift chain
1 parent 46d061e commit 45360b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/GraphQL/Resolver/Condition.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public function __construct(array $branches) {
3737
*/
3838
public function resolve($value, $args, ResolveContext $context, ResolveInfo $info, FieldContext $field) {
3939
$branches = $this->branches;
40-
while ([$condition, $resolver] = array_pad(array_shift($branches), 2, NULL)) {
40+
while ($branch = array_shift($branches)) {
41+
[$condition, $resolver] = array_pad($branch, 2, NULL);
4142
if ($condition instanceof ResolverInterface) {
4243
if (($condition = $condition->resolve($value, $args, $context, $info, $field)) === NULL) {
4344
// Bail out early if a resolver returns NULL.

0 commit comments

Comments
 (0)