From 61245213c49ba49f4502d12019dbdc440f5a9e20 Mon Sep 17 00:00:00 2001 From: vladar Date: Wed, 2 Nov 2016 00:41:44 +0700 Subject: [PATCH] Minor instanceof tweak --- src/Executor/Values.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Executor/Values.php b/src/Executor/Values.php index e6b2986..0efe9b2 100644 --- a/src/Executor/Values.php +++ b/src/Executor/Values.php @@ -135,7 +135,7 @@ class Values * runtime values of query variables. * * @param $value - * @param Type $type + * @param InputType $type * @return array */ private static function isValidPHPValue($value, InputType $type) @@ -258,7 +258,11 @@ class Values return $obj; } - Utils::invariant($type instanceof ScalarType || $type instanceof EnumType, 'Must be input type'); - return $type->parseValue($value); + + if ($type instanceof LeafType) { + return $type->parseValue($value); + } + + throw new InvariantViolation('Must be input type'); } }