From 3659e652ce0518fa6446c7f72fdcc5f81b8930d3 Mon Sep 17 00:00:00 2001 From: Hung Neo Date: Thu, 20 Sep 2018 11:01:54 +0300 Subject: [PATCH] Move the if-block to on top of the function --- src/Execution/Executor.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Execution/Executor.php b/src/Execution/Executor.php index e7f71063..efa07806 100644 --- a/src/Execution/Executor.php +++ b/src/Execution/Executor.php @@ -665,14 +665,14 @@ protected function defaultTypeResolver( ResolveInfo $info, AbstractTypeInterface $abstractType ) { - /** @var ObjectType[] $possibleTypes */ - $possibleTypes = $info->getSchema()->getPossibleTypes($abstractType); - $promisedIsTypeOfResults = []; - if (\is_array($value) && isset($value['__typename'])) { return $value['__typename']; } + /** @var ObjectType[] $possibleTypes */ + $possibleTypes = $info->getSchema()->getPossibleTypes($abstractType); + $promisedIsTypeOfResults = []; + foreach ($possibleTypes as $index => $type) { $isTypeOfResult = $type->isTypeOf($value, $context, $info);