Minor instanceof tweak

This commit is contained in:
vladar 2016-11-02 00:41:44 +07:00
parent 22e41a3729
commit 61245213c4

View File

@ -135,7 +135,7 @@ class Values
* runtime values of query variables. * runtime values of query variables.
* *
* @param $value * @param $value
* @param Type $type * @param InputType $type
* @return array * @return array
*/ */
private static function isValidPHPValue($value, InputType $type) private static function isValidPHPValue($value, InputType $type)
@ -258,7 +258,11 @@ class Values
return $obj; return $obj;
} }
Utils::invariant($type instanceof ScalarType || $type instanceof EnumType, 'Must be input type');
if ($type instanceof LeafType) {
return $type->parseValue($value); return $type->parseValue($value);
} }
throw new InvariantViolation('Must be input type');
}
} }