File tree Expand file tree Collapse file tree 2 files changed +2
-21
lines changed
Expand file tree Collapse file tree 2 files changed +2
-21
lines changed Original file line number Diff line number Diff line change @@ -28,16 +28,12 @@ public function detect(string $filename): SchemaDetectionResult
2828
2929 $ schemaFinder = new SchemaFinder ;
3030
31- $ tried = [];
32-
3331 foreach ($ schemaFinder ->available () as $ candidate ) {
3432 $ schema = (new SchemaFinder )->find ($ candidate );
3533
3634 if (!(new Validator )->validate ($ document , $ schema )->hasValidationErrors ()) {
37- return new SuccessfulSchemaDetectionResult ($ candidate, $ tried );
35+ return new SuccessfulSchemaDetectionResult ($ candidate );
3836 }
39-
40- $ tried [] = $ candidate ;
4137 }
4238
4339 return new FailedSchemaDetectionResult ;
Original file line number Diff line number Diff line change @@ -21,19 +21,12 @@ final class SuccessfulSchemaDetectionResult extends SchemaDetectionResult
2121 */
2222 private $ version ;
2323
24- /**
25- * @psalm-var list<non-empty-string>
26- */
27- private $ tried ;
28-
2924 /**
3025 * @psalm-param non-empty-string $version
31- * @psalm-param list<non-empty-string> $tried
3226 */
33- public function __construct (string $ version, array $ tried )
27+ public function __construct (string $ version )
3428 {
3529 $ this ->version = $ version ;
36- $ this ->tried = $ tried ;
3730 }
3831
3932 /**
@@ -51,12 +44,4 @@ public function version(): string
5144 {
5245 return $ this ->version ;
5346 }
54-
55- /**
56- * @psalm-return list<non-empty-string>
57- */
58- public function tried (): array
59- {
60- return $ this ->tried ;
61- }
6247}
You can’t perform that action at this time.
0 commit comments