protected function streamToDocument(StreamInterface $stream): AbstractDocument
    {
        $content = $stream->getContents();
        $decoded = json_decode($content);

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new \RuntimeException('Decoding error: "' . json_last_error_msg() . '""');
        }

        return $this->hydrator->hydrate($decoded);
    }
protected function streamToDocument(StreamInterface $stream): AbstractDocument
    {
        $content = $stream->getContents();
        $decoded = json_decode($content);

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new \RuntimeException('Decoding error: "' . json_last_error_msg() . '""');
        }

        return $this->hydrator->hydrate($decoded);
    }
protected function streamToDocument ( StreamInterface $ stream ) : AbstractDocument { $ content = $ stream -> getContents ( ) ; $ decoded = json_decode ( $ content ) ; if ( json_last_error ( ) !== JSON_ERROR_NONE ) { throw new \ RuntimeException ( 'Decoding error: "' . json_last_error_msg ( ) . '""' ) ; } return $ this -> hydrator -> hydrate ( $ decoded ) ; }
Create a JsonApi document by serialized data from stream

@param  StreamInterface $stream
@return AbstractDocument
Create a JsonApi document by serialized data from stream