Scalr\Tests\Functional\Api\V2\SpecSchema\SpecManager::getPath PHP Method

getPath() protected method

Return Api definitions from segment
protected getPath ( variadic $segments ) : array
$segments variadic patch segments
return array
    protected function getPath(...$segments)
    {
        $result = $this->specification;
        foreach ($segments as $segment) {
            if (!isset($result[$segment])) {
                throw new InvalidArgumentException(sprintf('Missing segment %s in %s spec file %s', $segment, implode('/', $segments), $this->specFile));
            }
            $result = $result[$segment];
        }
        return $result;
    }