Scalr\Tests\Functional\Api\V2\TestData\ApiFixture::preparePathInfo PHP Метод

preparePathInfo() защищенный Метод

Prepare options for each patch options
protected preparePathInfo ( ) : array
Результат array
    protected function preparePathInfo()
    {
        if (array_key_exists(static::PATHS_DATA, $this->sets)) {
            $paramData = [];
            foreach ($this->sets[static::PATHS_DATA] as $pathInfo) {
                isset($pathInfo['acl']) && in_array($pathInfo['acl'], static::$aclTypes) ?: ($pathInfo['acl'] = static::ACL_FULL_ACCESS);
                isset($pathInfo['userType']) && in_array($pathInfo['userType'], static::$userTypes) ?: ($pathInfo['userType'] = User::TYPE_TEAM_USER);
                $adapter = isset($pathInfo['adapter']) ? $pathInfo['adapter'] : $this->adapterName;
                $pathInfo['adapter'] = static::API_NAMESPACE . '\\' . ucfirst(static::$apiVersion) . '\\Adapter\\' . ucfirst($adapter) . 'Adapter';
                foreach ($pathInfo['operations'] as $index => $operation) {
                    $operation = array_merge(static::$defaultOperation, $operation);
                    try {
                        $paramData[] = [$pathInfo['uri'], $this->type, $pathInfo['adapter'], $pathInfo['acl'], $pathInfo['userType'], $operation['method'], $operation['response'], (array) $this->resolveProperty($operation['params'], $index), (array) $this->resolveProperty($operation['filterable'], $index), (array) $this->resolveProperty($operation['body'], $index)];
                    } catch (InvalidArgumentException $e) {
                        $paramData[] = array_merge([get_class($this), $e, $pathInfo['adapter'], $pathInfo['acl'], $pathInfo['userType']], static::$defaultOperation);
                    }
                }
            }
            return $paramData;
        }
        throw new InvalidArgumentException(sprintf('Element %s should exist in fixtures', static::PATHS_DATA));
    }