protected function parse($data = null, $filename = null)
    {
        if ($data === false) {
            $errors      = libxml_get_errors();
            $latestError = array_pop($errors);
            $error       = [
                'message' => $latestError->message,
                'type'    => $latestError->level,
                'code'    => $latestError->code,
                'file'    => $filename,
                'line'    => $latestError->line,
            ];
            throw new ParseException($error);
        }

        $data = json_decode(json_encode($data), true);

        return $data;
    }
protected function parse($data = null, $filename = null)
    {
        if ($data === false) {
            $errors      = libxml_get_errors();
            $latestError = array_pop($errors);
            $error       = [
                'message' => $latestError->message,
                'type'    => $latestError->level,
                'code'    => $latestError->code,
                'file'    => $filename,
                'line'    => $latestError->line,
            ];
            throw new ParseException($error);
        }

        $data = json_decode(json_encode($data), true);

        return $data;
    }
protected function parse ( $ data = null , $ filename = null ) { if ( $ data === false ) { $ errors = libxml_get_errors ( ) ; $ latestError = array_pop ( $ errors ) ; $ error = [ 'message' => $ latestError -> message , 'type' => $ latestError -> level , 'code' => $ latestError -> code , 'file' => $ filename , 'line' => $ latestError -> line , ] ; throw new ParseException ( $ error ) ; } $ data = json_decode ( json_encode ( $ data ) , true ) ; return $ data ; }
Completes parsing of XML data

@param  array $data
@param  string $filename

@return array|null

@throws ParseException If there is an error parsing the XML data
Completes parsing of XML data