mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-25 22:36:02 +03:00
FIX Ensure that __toString return value is always casted as a string
`json_encode` can return false on failure, which causes PHP errors since `__toString` must return a string.
This commit is contained in:
parent
2f2b54a3d6
commit
c962afc566
@ -84,7 +84,7 @@ abstract class Node
|
||||
public function __toString()
|
||||
{
|
||||
$tmp = $this->toArray(true);
|
||||
return json_encode($tmp);
|
||||
return (string) json_encode($tmp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user