Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SchemaDetector.php

class SchemaDetector

@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

@internal This class is not covered by the backward compatibility promise for PHPUnit

Hierarchy

  • class \PHPUnit\TextUI\XmlConfiguration\SchemaDetector

Expanded class hierarchy of SchemaDetector

1 file declares its use of SchemaDetector
Merger.php in vendor/phpunit/phpunit/src/TextUI/Configuration/Merger.php

File

vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/SchemaDetector/SchemaDetector.php, line 20

Namespace

PHPUnit\TextUI\XmlConfiguration
View source
final class SchemaDetector {
    
    /**
     * @throws XmlException
     */
    public function detect(string $filename) : SchemaDetectionResult {
        $document = (new Loader())->loadFile($filename);
        $schemaFinder = new SchemaFinder();
        foreach ($schemaFinder->available() as $candidate) {
            $schema = (new SchemaFinder())->find($candidate);
            if (!(new Validator())->validate($document, $schema)
                ->hasValidationErrors()) {
                return new SuccessfulSchemaDetectionResult($candidate);
            }
        }
        return new FailedSchemaDetectionResult();
    }

}

Members

Title Sort descending Modifiers Object type Summary
SchemaDetector::detect public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal