private function validate(SimpleXMLElement $phpDocumentor): void
    {
        libxml_clear_errors();
        $priorSetting = libxml_use_internal_errors(true);

        $dom = new \DOMDocument();
        $domElement = dom_import_simplexml($phpDocumentor);
        $domElement = $dom->importNode($domElement, true);
        $dom->appendChild($domElement);

        $dom->schemaValidate($this->schemaPath);

        $error = libxml_get_last_error();

        if ($error !== false) {
            throw new InvalidArgumentException(trim($error->message));
        }

        libxml_use_internal_errors($priorSetting);
    }
private function validate(SimpleXMLElement $phpDocumentor): void
    {
        libxml_clear_errors();
        $priorSetting = libxml_use_internal_errors(true);

        $dom = new \DOMDocument();
        $domElement = dom_import_simplexml($phpDocumentor);
        $domElement = $dom->importNode($domElement, true);
        $dom->appendChild($domElement);

        $dom->schemaValidate($this->schemaPath);

        $error = libxml_get_last_error();

        if ($error !== false) {
            throw new InvalidArgumentException(trim($error->message));
        }

        libxml_use_internal_errors($priorSetting);
    }
private function validate ( SimpleXMLElement $ phpDocumentor ) : void { libxml_clear_errors ( ) ; $ priorSetting = libxml_use_internal_errors ( true ) ; $ dom = new \ DOMDocument ( ) ; $ domElement = dom_import_simplexml ( $ phpDocumentor ) ; $ domElement = $ dom -> importNode ( $ domElement , true ) ; $ dom -> appendChild ( $ domElement ) ; $ dom -> schemaValidate ( $ this -> schemaPath ) ; $ error = libxml_get_last_error ( ) ; if ( $ error !== false ) { throw new InvalidArgumentException ( trim ( $ error -> message ) ) ; } libxml_use_internal_errors ( $ priorSetting ) ; }
Validates the configuration xml structure against the schema defined in the schemaPath.

@throws InvalidArgumentException if the xml structure is not valid.
Validates the configuration xml structure against the schema defined in the schemaPath .