Skip to content

Commit 5c70a14

Browse files
committed
Fix parsing of callback of custom scalar type
1 parent b531be4 commit 5c70a14

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Generator/ConfigBuilder/CustomScalarTypeFieldsBuilder.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ protected function buildScalarCallback($callback, string $fieldName, TypeConfig
5555

5656
$closure = new ArrowFunction();
5757

58-
if (!is_string($callback)) {
58+
if (\is_array($callback)) {
5959
[$class, $method] = $callback;
60-
} else {
60+
} elseif(\is_string($callback)) {
6161
[$class, $method] = explode('::', $callback);
62+
} else {
63+
throw new GeneratorException(sprintf('Invalid type of "%s" value passed.', $fieldName));
6264
}
6365

6466
$className = Utils::resolveQualifier($class);

0 commit comments

Comments
 (0)