diff --git a/src/Reader.php b/src/Reader.php index d073fa01..e4b52b85 100644 --- a/src/Reader.php +++ b/src/Reader.php @@ -22,6 +22,9 @@ class Reader { /** * Populate OpenAPI spec object from JSON data. + * @phpstan-template T of SpecObjectInterface + * @phpstan-param class-string $baseType + * @phpstan-return T * @param string $json the JSON string to decode. * @param string $baseType the base Type to instantiate. This must be an instance of [[SpecObjectInterface]]. * 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 /** * Populate OpenAPI spec object from YAML data. + * @phpstan-template T of SpecObjectInterface + * @phpstan-param class-string $baseType + * @phpstan-return T * @param string $yaml the YAML string to decode. * @param string $baseType the base Type to instantiate. This must be an instance of [[SpecObjectInterface]]. * 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 /** * Populate OpenAPI spec object from a JSON file. + * @phpstan-template T of SpecObjectInterface + * @phpstan-param class-string $baseType + * @phpstan-return T * @param string $fileName the file name of the file to be read. * If `$resolveReferences` is true (the default), this should be an absolute URL, a `file://` URI or * an absolute path to allow resolving relative path references. @@ -95,6 +104,9 @@ public static function readFromJsonFile(string $fileName, string $baseType = Ope /** * Populate OpenAPI spec object from YAML file. + * @phpstan-template T of SpecObjectInterface + * @phpstan-param class-string $baseType + * @phpstan-return T * @param string $fileName the file name of the file to be read. * If `$resolveReferences` is true (the default), this should be an absolute URL, a `file://` URI or * an absolute path to allow resolving relative path references.