Scalr\Tests\Functional\Api\V2\SpecSchema\SpecManager::__construct PHP Метод

__construct() публичный Метод

SpecManager constructor.
public __construct ( string $version, string $service )
$version string Api version
$service string spec file service
    public function __construct($version, $service)
    {
        if (!(preg_match("/^" . Describer::VERSION_NAME_REGEXP . "\$/", $version) && preg_match("/^" . Describer::SERVICE_NAME_REGEXP . "\$/", $service))) {
            throw new FileNotFoundException("{$service}.{$version}");
        }
        $file = "{$version}/{$service}-autogenerated.yaml";
        $this->specFile = realpath(APPPATH . "/../api/{$file}");
        if (!$this->specFile) {
            throw new FileNotFoundException("{$service}.{$version}", "Api {$version} specification not found for service '{$service}'");
        }
        $this->specification = Yaml::load($this->specFile)->toArray();
    }