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;
    }
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;
    }
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 ; }
Read YAML from a string

@param string $data The YAML data
@return array The parsed data
Read YAML from a string