src/Reader.php
public static function readFromYamlFile(string $fileName, string $baseType = OpenApi::class, $resolveReferences = true): SpecObjectInterface
    {
        $spec = static::readFromYaml(file_get_contents($fileName), $baseType);
        $spec->setReferenceContext(new ReferenceContext($spec, $fileName));
        if ($resolveReferences) {
            $spec->resolveReferences();
        }
        return $spec;
    }
public static function readFromYamlFile(string $fileName, string $baseType = OpenApi::class, $resolveReferences = true): SpecObjectInterface
    {
        $spec = static::readFromYaml(file_get_contents($fileName), $baseType);
        $spec->setReferenceContext(new ReferenceContext($spec, $fileName));
        if ($resolveReferences) {
            $spec->resolveReferences();
        }
        return $spec;
    }
public static function readFromYamlFile ( string $ fileName , string $ baseType = OpenApi :: class , $ resolveReferences = true ) : SpecObjectInterface { $ spec = static :: readFromYaml ( file_get_contents ( $ fileName ) , $ baseType ) ; $ spec -> setReferenceContext ( new ReferenceContext ( $ spec , $ fileName ) ) ; if ( $ resolveReferences ) { $ spec -> resolveReferences ( ) ; } return $ spec ; }
Populate OpenAPI spec object from YAML file.
@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.
@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.
You may choose a different type if you instantiate objects from sub sections of a specification.
@param bool $resolveReferences whether to automatically resolve references in the specification.
If `true`, all [[Reference]] objects will be replaced with their referenced spec objects by calling
[[SpecObjectInterface::resolveReferences()]].
@return SpecObjectInterface|OpenApi the OpenApi object instance.
@throws TypeErrorException in case invalid spec data is supplied.
@throws UnresolvableReferenceException in case references could not be resolved.
Populate OpenAPI spec object from YAML file .