diff --git a/src/Util/Xml/SchemaDetector.php b/src/Util/Xml/SchemaDetector.php index 2975789ba18..1877a9a1f92 100644 --- a/src/Util/Xml/SchemaDetector.php +++ b/src/Util/Xml/SchemaDetector.php @@ -28,16 +28,12 @@ public function detect(string $filename): SchemaDetectionResult $schemaFinder = new SchemaFinder; - $tried = []; - foreach ($schemaFinder->available() as $candidate) { $schema = (new SchemaFinder)->find($candidate); if (!(new Validator)->validate($document, $schema)->hasValidationErrors()) { - return new SuccessfulSchemaDetectionResult($candidate, $tried); + return new SuccessfulSchemaDetectionResult($candidate); } - - $tried[] = $candidate; } return new FailedSchemaDetectionResult; diff --git a/src/Util/Xml/SuccessfulSchemaDetectionResult.php b/src/Util/Xml/SuccessfulSchemaDetectionResult.php index b8bd1af72b8..77202c352be 100644 --- a/src/Util/Xml/SuccessfulSchemaDetectionResult.php +++ b/src/Util/Xml/SuccessfulSchemaDetectionResult.php @@ -21,19 +21,12 @@ final class SuccessfulSchemaDetectionResult extends SchemaDetectionResult */ private $version; - /** - * @psalm-var list - */ - private $tried; - /** * @psalm-param non-empty-string $version - * @psalm-param list $tried */ - public function __construct(string $version, array $tried) + public function __construct(string $version) { $this->version = $version; - $this->tried = $tried; } /** @@ -51,12 +44,4 @@ public function version(): string { return $this->version; } - - /** - * @psalm-return list - */ - public function tried(): array - { - return $this->tried; - } }