@@ -22,6 +22,9 @@ class Reader
22
22
{
23
23
/**
24
24
* Populate OpenAPI spec object from JSON data.
25
+ * @phpstan-template T of SpecObjectInterface
26
+ * @phpstan-param class-string<T> $baseType
27
+ * @phpstan-return T
25
28
* @param string $json the JSON string to decode.
26
29
* @param string $baseType the base Type to instantiate. This must be an instance of [[SpecObjectInterface]].
27
30
* The default is [[OpenApi]] which is the base type of a OpenAPI specification file.
@@ -37,6 +40,9 @@ public static function readFromJson(string $json, string $baseType = OpenApi::cl
37
40
38
41
/**
39
42
* Populate OpenAPI spec object from YAML data.
43
+ * @phpstan-template T of SpecObjectInterface
44
+ * @phpstan-param class-string<T> $baseType
45
+ * @phpstan-return T
40
46
* @param string $yaml the YAML string to decode.
41
47
* @param string $baseType the base Type to instantiate. This must be an instance of [[SpecObjectInterface]].
42
48
* The default is [[OpenApi]] which is the base type of a OpenAPI specification file.
@@ -52,6 +58,9 @@ public static function readFromYaml(string $yaml, string $baseType = OpenApi::cl
52
58
53
59
/**
54
60
* Populate OpenAPI spec object from a JSON file.
61
+ * @phpstan-template T of SpecObjectInterface
62
+ * @phpstan-param class-string<T> $baseType
63
+ * @phpstan-return T
55
64
* @param string $fileName the file name of the file to be read.
56
65
* If `$resolveReferences` is true (the default), this should be an absolute URL, a `file://` URI or
57
66
* an absolute path to allow resolving relative path references.
@@ -95,6 +104,9 @@ public static function readFromJsonFile(string $fileName, string $baseType = Ope
95
104
96
105
/**
97
106
* Populate OpenAPI spec object from YAML file.
107
+ * @phpstan-template T of SpecObjectInterface
108
+ * @phpstan-param class-string<T> $baseType
109
+ * @phpstan-return T
98
110
* @param string $fileName the file name of the file to be read.
99
111
* If `$resolveReferences` is true (the default), this should be an absolute URL, a `file://` URI or
100
112
* an absolute path to allow resolving relative path references.
0 commit comments