original_string: public static function validateSchema(\DOMDocument $dom): array
      {
          $xliffVersion = static::getVersionNumber($dom);
          $internalErrors = libxml_use_internal_errors(true);
          $disableEntities = libxml_disable_entity_loader(false);
  
          $isValid = @$dom->schemaValidateSource(self::getSchema($xliffVersion));
          if (!$isValid) {
              libxml_disable_entity_loader($disableEntities);
  
              return self::getXmlErrors($internalErrors);
          }
  
          libxml_disable_entity_loader($disableEntities);
  
          $dom->normalizeDocument();
  
          libxml_clear_errors();
          libxml_use_internal_errors($internalErrors);
  
          return [];
      }
code: public static function validateSchema(\DOMDocument $dom): array
      {
          $xliffVersion = static::getVersionNumber($dom);
          $internalErrors = libxml_use_internal_errors(true);
          $disableEntities = libxml_disable_entity_loader(false);
  
          $isValid = @$dom->schemaValidateSource(self::getSchema($xliffVersion));
          if (!$isValid) {
              libxml_disable_entity_loader($disableEntities);
  
              return self::getXmlErrors($internalErrors);
          }
  
          libxml_disable_entity_loader($disableEntities);
  
          $dom->normalizeDocument();
  
          libxml_clear_errors();
          libxml_use_internal_errors($internalErrors);
  
          return [];
      }
code_tokens: public static function validateSchema ( \ DOMDocument $ dom ) : array { $ xliffVersion = static :: getVersionNumber ( $ dom ) ; $ internalErrors = libxml_use_internal_errors ( true ) ; $ disableEntities = libxml_disable_entity_loader ( false ) ; $ isValid = @ $ dom -> schemaValidateSource ( self :: getSchema ( $ xliffVersion ) ) ; if ( ! $ isValid ) { libxml_disable_entity_loader ( $ disableEntities ) ; return self :: getXmlErrors ( $ internalErrors ) ; } libxml_disable_entity_loader ( $ disableEntities ) ; $ dom -> normalizeDocument ( ) ; libxml_clear_errors ( ) ; libxml_use_internal_errors ( $ internalErrors ) ; return [ ] ; }
docstring: Validates and parses the given file into a DOMDocument.
  
  @throws InvalidResourceException
docstring_tokens: Validates and parses the given file into a DOMDocument .