We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3536280 commit 25e341eCopy full SHA for 25e341e
src/Type/Definition/IDType.php
@@ -43,7 +43,7 @@ public function serialize($value)
43
if ($value === null) {
44
return 'null';
45
}
46
- if (!is_scalar($value)) {
+ if (!is_scalar($value) && (!is_object($value) || !method_exists($value, '__toString'))) {
47
throw new InvariantViolation("ID type cannot represent non scalar value: " . Utils::printSafe($value));
48
49
return (string) $value;
0 commit comments