Platformsh\Cli\Command\Project\ProjectCreateCommand::getEstimate PHP Метод

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

Get a cost estimate for the new project.
protected getEstimate ( string $plan, integer $storage, integer $environments ) : array | false
$plan string
$storage integer
$environments integer
Результат array | false
    protected function getEstimate($plan, $storage, $environments)
    {
        $apiUrl = self::$config->get('api.accounts_api_url');
        if (!($parts = parse_url($apiUrl))) {
            throw new \RuntimeException('Failed to parse URL: ' . $apiUrl);
        }
        $baseUrl = $parts['scheme'] . '://' . $parts['host'];
        $estimateUrl = $baseUrl . '/platform/estimate';
        $client = new Client();
        $response = $client->get($estimateUrl, ['query' => ['plan' => strtoupper('PLATFORM-ENVIRONMENT-' . $plan), 'storage' => $storage, 'environments' => $environments, 'user_licenses' => 1], 'exceptions' => false]);
        if ($response->getStatusCode() != 200) {
            return false;
        }
        return $response->json();
    }