Skip to content

Commit 5f5c811

Browse files
committed
Fixed parseValue of StringType and IDType: (it should return null on invalid value, not throw)
1 parent 2023b42 commit 5f5c811

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

src/Type/Definition/IDType.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ public function serialize($value)
5555
*/
5656
public function parseValue($value)
5757
{
58-
if (!is_scalar($value)) {
59-
throw new Error("ID type cannot represent non scalar value: " . Utils::printSafeJson($value));
60-
}
6158
return (is_string($value) || is_int($value)) ? (string) $value : null;
6259
}
6360

src/Type/Definition/StringType.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public function serialize($value)
5252
*/
5353
public function parseValue($value)
5454
{
55-
if (!is_scalar($value)) {
56-
throw new Error("String cannot represent non scalar value: " . Utils::printSafe($value));
57-
}
5855
return is_string($value) ? $value : null;
5956
}
6057

0 commit comments

Comments
 (0)