Fixed parseValue of StringType and IDType: (it should return null on invalid value, not throw)

This commit is contained in:
Vladimir Razuvaev 2017-09-20 16:38:02 +07:00
parent 2023b427ae
commit 5f5c8118c0
2 changed files with 0 additions and 6 deletions

View File

@ -55,9 +55,6 @@ When expected as an input type, any string (such as `"4"`) or integer
*/ */
public function parseValue($value) public function parseValue($value)
{ {
if (!is_scalar($value)) {
throw new Error("ID type cannot represent non scalar value: " . Utils::printSafeJson($value));
}
return (is_string($value) || is_int($value)) ? (string) $value : null; return (is_string($value) || is_int($value)) ? (string) $value : null;
} }

View File

@ -52,9 +52,6 @@ represent free-form human-readable text.';
*/ */
public function parseValue($value) public function parseValue($value)
{ {
if (!is_scalar($value)) {
throw new Error("String cannot represent non scalar value: " . Utils::printSafe($value));
}
return is_string($value) ? $value : null; return is_string($value) ? $value : null;
} }