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:
Robbie Averill 2018-07-30 16:36:09 +12:00 committed by GitHub
parent 2f2b54a3d6
commit c962afc566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,7 @@ abstract class Node
public function __toString()
{
$tmp = $this->toArray(true);
return json_encode($tmp);
return (string) json_encode($tmp);
}
/**