public function readString(string $data)
    {
        $interceptor = new ErrorInterceptor(function ($data) {
            return yaml_parse($data);
        });

        $interceptor->registerError(E_WARNING, "yaml_parse");
        
        $result = $interceptor->execute($data);

        foreach ($interceptor->getInterceptedErrors() as $error)
            throw new IOException("Failed to read YAML data", $error->getCode(), $error);

        return $result;
    }