Calling EnvelopeApi\getDocument in the DocuSign eSign PHP client (docusign/esign-client) crashed with this fatal error. In ObjectSerializer.php line 285 the code called $data->read(200) on the response, but getDocument returns the file contents as a plain string, not a stream object. This hit any code path that downloads envelope documents via the SDK on versions before 5.3.0. Reporter confirmed the failure and provided the workaround of guarding with is_string().