Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Jan 9, 2024
1 parent cca4cc5 commit 868ac50
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 105 deletions.
22 changes: 11 additions & 11 deletions src/CacheInstanceClasses.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ class CacheInstanceClasses
public static function general()
{
return [
'cache.t3.micro' => 'cache.t3.micro - (2 VCPU, 0.5Gib RAM) - Free Tier Eligible ~$13 / month',
'cache.t3.small' => 'cache.t3.small - (2 VCPU, 1.37Gib RAM) - ~$25 / month',
'cache.t3.medium' => 'cache.t3.medium - (2 VCPU, 3.09Gib RAM) - ~$50 / month',
'cache.m5.large' => 'cache.m5.large - (2 VCPU, 6.38Gib RAM) - ~$112 / month',
'cache.m5.xlarge' => 'cache.m5.xlarge - (4 VCPU, 12.93Gib RAM) - ~$224 / month',
'cache.m5.2xlarge' => 'cache.m5.2xlarge - (8 VCPU, 26.04Gib RAM) - ~$449 / month',
'cache.m5.4xlarge' => 'cache.m5.4xlarge - (16 VCPU, 52.26Gib RAM) - ~$897 / month',
'cache.t3.micro' => 'cache.t3.micro - (2 VCPU, 0.5Gib RAM) - Free Tier Eligible ~$13 / month',
'cache.t3.small' => 'cache.t3.small - (2 VCPU, 1.37Gib RAM) - ~$25 / month',
'cache.t3.medium' => 'cache.t3.medium - (2 VCPU, 3.09Gib RAM) - ~$50 / month',
'cache.m5.large' => 'cache.m5.large - (2 VCPU, 6.38Gib RAM) - ~$112 / month',
'cache.m5.xlarge' => 'cache.m5.xlarge - (4 VCPU, 12.93Gib RAM) - ~$224 / month',
'cache.m5.2xlarge' => 'cache.m5.2xlarge - (8 VCPU, 26.04Gib RAM) - ~$449 / month',
'cache.m5.4xlarge' => 'cache.m5.4xlarge - (16 VCPU, 52.26Gib RAM) - ~$897 / month',
'cache.m5.12xlarge' => 'cache.m5.12xlarge - (48 VCPU, 157.12Gib RAM) - ~$2696 / month',
'cache.m5.24xlarge' => 'cache.m5.24xlarge - (96 VCPU, 314.32Gib RAM) - ~$5392 / month',
];
Expand All @@ -32,10 +32,10 @@ public static function general()
public static function memory()
{
return [
'cache.r5.large' => 'cache.r5.large - (2 VCPU, 13.07Gib RAM) - ~$156 / month',
'cache.r5.xlarge' => 'cache.r5.xlarge - (4 VCPU, 26.32GiB RAM) - ~$310 / month',
'cache.r5.2xlarge' => 'cache.r5.2xlarge - (8 VCPU, 52.82GiB RAM) - ~$621 / month',
'cache.r5.4xlarge' => 'cache.r5.4xlarge - (16 VCPU, 105.81GiB RAM) - ~$1241 / month',
'cache.r5.large' => 'cache.r5.large - (2 VCPU, 13.07Gib RAM) - ~$156 / month',
'cache.r5.xlarge' => 'cache.r5.xlarge - (4 VCPU, 26.32GiB RAM) - ~$310 / month',
'cache.r5.2xlarge' => 'cache.r5.2xlarge - (8 VCPU, 52.82GiB RAM) - ~$621 / month',
'cache.r5.4xlarge' => 'cache.r5.4xlarge - (16 VCPU, 105.81GiB RAM) - ~$1241 / month',
'cache.r5.12xlarge' => 'cache.r5.12xlarge - (48 VCPU, 317.77GiB RAM) - ~$3732 / month',
'cache.r5.24xlarge' => 'cache.r5.24xlarge - (96 VCPU, 635.61GiB RAM) - ~$7465 / month',
];
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/DatabaseScaleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function determineRdsInstanceClass()
{
$type = $this->menu('Which type of database instance would you like to scale to?', [
'general' => 'General Purpose',
'memory' => 'Memory Optimized',
'memory' => 'Memory Optimized',
]);

if ($type == 'general') {
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/EnvCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public function handle()
);

Manifest::addEnvironment($environment, [
'memory' => 1024,
'memory' => 1024,
'cli-memory' => 512,
'runtime' => $this->option('docker') ? 'docker' : 'php-8.2:al2',
'build' => [
'runtime' => $this->option('docker') ? 'docker' : 'php-8.2:al2',
'build' => [
'COMPOSER_MIRROR_PATH_REPOS=1 composer install --no-dev',
'php artisan event:cache',
file_exists(Path::current().'/webpack.mix.js')
Expand Down
26 changes: 13 additions & 13 deletions src/Commands/EnvDescribeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ public function handle()
$domain = count($domains) ? $domains[0] : null;

$description = [
'project_id' => $environment['project_id'],
'uuid' => $environment['uuid'],
'id' => $environment['id'],
'name' => $environment['name'],
'vanity_domain' => $environment['vanity_domain'],
'latest_deployment_id' => $environment['latest_deployment_id'],
'project_id' => $environment['project_id'],
'uuid' => $environment['uuid'],
'id' => $environment['id'],
'name' => $environment['name'],
'vanity_domain' => $environment['vanity_domain'],
'latest_deployment_id' => $environment['latest_deployment_id'],
'latest_deployment_status' => $environment['latest_deployment'] ? $environment['latest_deployment']['status'] : null,
'latest_deployment_url' => 'https://vapor.laravel.com/app/projects/'.$environment['project_id'].'/environments/'.$environment['name'].'/deployments/'.$environment['latest_deployment_id'],
'deployment_status' => $environment['deployment_status'],
'domains' => $domains,
'domain' => $domain,
'management_url' => 'https://vapor.laravel.com/app/projects/'.$environment['project_id'].'/environments/'.$environment['name'],
'vanity_url' => 'https://'.$environment['vanity_domain'],
'custom_url' => $domain ? 'https://'.$domain : null,
'latest_deployment_url' => 'https://vapor.laravel.com/app/projects/'.$environment['project_id'].'/environments/'.$environment['name'].'/deployments/'.$environment['latest_deployment_id'],
'deployment_status' => $environment['deployment_status'],
'domains' => $domains,
'domain' => $domain,
'management_url' => 'https://vapor.laravel.com/app/projects/'.$environment['project_id'].'/environments/'.$environment['name'],
'vanity_url' => 'https://'.$environment['vanity_domain'],
'custom_url' => $domain ? 'https://'.$domain : null,
];

if ($this->option('list')) {
Expand Down
18 changes: 9 additions & 9 deletions src/Commands/LocalCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,36 +106,36 @@ protected function dockerConfiguration()
}

return [
'version' => '3.7',
'version' => '3.7',
'services' => [
'redis' => [
'image' => 'redis:alpine',
'image' => 'redis:alpine',
'volumes' => [
'vapor_redis:/data',
],
'restart' => 'always',
],
'mysql' => [
'image' => 'mysql:8.0',
'image' => 'mysql:8.0',
'volumes' => [
0 => 'vapor_mysql:/var/lib/mysql',
],
'restart' => 'always',
'restart' => 'always',
'environment' => [
'MYSQL_ROOT_PASSWORD' => 'secret',
'MYSQL_DATABASE' => 'vapor',
'MYSQL_USER' => 'vapor',
'MYSQL_PASSWORD' => 'secret',
'MYSQL_DATABASE' => 'vapor',
'MYSQL_USER' => 'vapor',
'MYSQL_PASSWORD' => 'secret',
],
],
'app' => [
'image' => static::$images[$this->option('php') ? $this->option('php') : '8.2'],
'image' => static::$images[$this->option('php') ? $this->option('php') : '8.2'],
'depends_on' => [
0 => 'mysql',
1 => 'redis',
],
'restart' => 'always',
'init' => true,
'init' => true,
],
],
'volumes' => [
Expand Down
12 changes: 6 additions & 6 deletions src/Commands/ProjectDescribeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public function handle()
$project = $this->vapor->project(Manifest::id());

$description = [
'id' => $project['id'],
'name' => $project['name'],
'team_id' => $project['team_id'],
'team_name' => $project['team']['name'],
'region' => $project['region'],
'id' => $project['id'],
'name' => $project['name'],
'team_id' => $project['team_id'],
'team_name' => $project['team']['name'],
'region' => $project['region'],
'github_repository' => $project['github_repository'],
'management_url' => 'https://vapor.laravel.com/app/projects/'.$project['id'],
'management_url' => 'https://vapor.laravel.com/app/projects/'.$project['id'],
];

if ($this->option('list')) {
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/RetrievesProviderCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected function getAWSCredentials()
}

return [
'key' => Helpers::ask('What is your AWS user key'),
'key' => Helpers::ask('What is your AWS user key'),
'secret' => Helpers::secret('What is your AWS user secret'),
];
}
Expand All @@ -36,7 +36,7 @@ protected function getCredentialsFromFile()
);

return [
'key' => $credentials[$credential]['aws_access_key_id'],
'key' => $credentials[$credential]['aws_access_key_id'],
'secret' => $credentials[$credential]['aws_secret_access_key'],
];
}
Expand Down
62 changes: 31 additions & 31 deletions src/ConsoleVaporClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public function login($email, $password, $twoFactorAuthenticationToken = null)
{
try {
return $this->request('post', '/api/login', [
'host' => gethostname(),
'email' => $email,
'password' => $password,
'host' => gethostname(),
'email' => $email,
'password' => $password,
'two_factor_token' => $twoFactorAuthenticationToken,
])['access_token'];
} catch (ClientException $e) {
Expand Down Expand Up @@ -102,7 +102,7 @@ public function teamMembers()
public function addTeamMember($email, array $permissions)
{
$this->requestWithErrorHandling('post', '/api/teams/'.Helpers::config('team').'/members', [
'email' => $email,
'email' => $email,
'permissions' => $permissions,
]);
}
Expand Down Expand Up @@ -232,7 +232,7 @@ public function createZone($providerId, $zone)
{
return $this->requestWithErrorHandling('post', '/api/teams/'.Helpers::config('team').'/zones', [
'cloud_provider_id' => $providerId,
'zone' => $zone,
'zone' => $zone,
]);
}

Expand Down Expand Up @@ -270,8 +270,8 @@ public function records($zoneId)
public function createRecord($zoneId, $type, $name, $value)
{
return $this->requestWithErrorHandling('put', '/api/zones/'.$zoneId.'/records', [
'type' => $type,
'name' => $name,
'type' => $type,
'name' => $name,
'value' => $value,
]);
}
Expand Down Expand Up @@ -323,9 +323,9 @@ public function network($networkId)
public function createNetwork($providerId, $name, $region, $withInternetAccess)
{
$this->requestWithErrorHandling('post', '/api/teams/'.Helpers::config('team').'/networks', [
'cloud_provider_id' => $providerId,
'name' => $name,
'region' => $region,
'cloud_provider_id' => $providerId,
'name' => $name,
'region' => $region,
'with_internet_access' => $withInternetAccess,
]);
}
Expand Down Expand Up @@ -399,12 +399,12 @@ public function database($databaseId)
public function createDatabase($networkId, $name, $type, $instanceClass, $storage, $public, $pause = false)
{
return $this->requestWithErrorHandling('post', '/api/networks/'.$networkId.'/databases', [
'name' => $name,
'type' => $type,
'name' => $name,
'type' => $type,
'instance_class' => $instanceClass,
'storage' => $storage,
'public' => $public,
'pause' => $pause,
'storage' => $storage,
'public' => $public,
'pause' => $pause,
]);
}

Expand All @@ -420,7 +420,7 @@ public function scaleDatabase($databaseId, $instanceClass, $storage)
{
$this->requestWithErrorHandling('put', '/api/databases/'.$databaseId.'/size', [
'instance_class' => $instanceClass,
'storage' => $storage,
'storage' => $storage,
]);
}

Expand Down Expand Up @@ -507,7 +507,7 @@ public function rotateDatabasePassword($databaseId)
public function restoreDatabase($databaseId, $name, $restoreTo)
{
return $this->requestWithErrorHandling('post', '/api/restored-databases?database_id='.$databaseId, [
'name' => $name,
'name' => $name,
'restore_to' => $restoreTo,
]);
}
Expand Down Expand Up @@ -585,8 +585,8 @@ public function cache($cacheId)
public function createCache($networkId, $name, $type, $instanceClass)
{
return $this->requestWithErrorHandling('post', '/api/networks/'.$networkId.'/caches', [
'name' => $name,
'type' => $type,
'name' => $name,
'type' => $type,
'instance_class' => $instanceClass,
]);
}
Expand Down Expand Up @@ -734,9 +734,9 @@ public function requestCertificate($providerId, $domain, array $alternativeNames
{
$this->requestWithErrorHandling('post', '/api/teams/'.Helpers::config('team').'/certificates', [
'cloud_provider_id' => $providerId,
'domain' => $domain,
'domain' => $domain,
'alternative_names' => $alternativeNames,
'region' => $region,
'region' => $region,
'validation_method' => $validationMethod,
]);
}
Expand Down Expand Up @@ -1024,12 +1024,12 @@ public function createArtifact(
$coreVersion = null
) {
$artifact = $this->requestWithErrorHandling('post', '/api/projects/'.$projectId.'/artifacts/'.$environment, [
'uuid' => $uuid,
'commit' => $commit,
'uuid' => $uuid,
'commit' => $commit,
'commit_message' => $commitMessage,
'vendor_hash' => $vendorHash,
'cli_version' => $cliVersion,
'core_version' => $coreVersion,
'vendor_hash' => $vendorHash,
'cli_version' => $cliVersion,
'core_version' => $coreVersion,
'uses_container_image' => is_null($file),
]);

Expand Down Expand Up @@ -1123,8 +1123,8 @@ public function deployment($deploymentId)
public function validateManifest($projectId, $environment, array $manifest, $cliVersion = null, $coreVersion = null)
{
$this->requestWithErrorHandling('post', '/api/projects/'.$projectId.'/environments/'.$environment.'/linted-manifest', [
'manifest' => $manifest,
'cli_version' => $cliVersion,
'manifest' => $manifest,
'cli_version' => $cliVersion,
'core_version' => $coreVersion,
]);
}
Expand Down Expand Up @@ -1450,10 +1450,10 @@ protected function request($method, $uri, array $json = [], $tries = 0)
protected function requestWithoutErrorHandling($method, $uri, array $json = [])
{
return json_decode((string) $this->client()->request($method, ltrim($uri, '/'), [
'json' => $json,
'json' => $json,
'headers' => [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Authorization' => 'Bearer '.Helpers::config('token', $_ENV['VAPOR_API_TOKEN'] ?? getenv('VAPOR_API_TOKEN') ?? null),
],
])->getBody(), true);
Expand Down
26 changes: 13 additions & 13 deletions src/DatabaseInstanceClasses.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public static function general()
'db.t2.xlarge' => 'db.t2.xlarge - (4 VCPU, 16Gib RAM) - ~$200 / month',
'db.t2.2xlarge' => 'db.t2.2xlarge - (8 VCPU, 32Gib RAM) - ~$400 / month',

'db.t3.micro' => 'db.t3.micro - (2 VCPU, 1Gib RAM) - ~$15 / month',
'db.t3.small' => 'db.t3.small - (2 VCPU, 2Gib RAM) - ~$25 / month',
'db.t3.micro' => 'db.t3.micro - (2 VCPU, 1Gib RAM) - ~$15 / month',
'db.t3.small' => 'db.t3.small - (2 VCPU, 2Gib RAM) - ~$25 / month',
'db.t3.medium' => 'db.t3.medium - (2 VCPU, 4Gib RAM) - ~$50 / month',
'db.t3.large' => 'db.t3.large - (2 VCPU, 8Gib RAM) - ~$100 / month',
'db.t3.large' => 'db.t3.large - (2 VCPU, 8Gib RAM) - ~$100 / month',
'db.t3.xlarge' => 'db.t3.xlarge - (4 VCPU, 16Gib RAM) - ~$200 / month',
'db.t3.2xlarge' => 'db.t3.2xlarge - (8 VCPU, 32Gib RAM) - ~$400 / month',

Expand All @@ -33,11 +33,11 @@ public static function general()
'db.t4g.xlarge' => 'db.t4g.xlarge - (4 VCPU, 16Gib RAM) - ~$320 / month',
'db.t4g.2xlarge' => 'db.t4g.2xlarge - (8 VCPU, 32Gib RAM) - ~$640 / month',

'db.m5.large' => 'db.m5.large - (2 VCPU, 8GB RAM) - ~$125 / month',
'db.m5.xlarge' => 'db.m5.xlarge - (4 VCPU, 16Gib RAM) - ~$250 / month',
'db.m5.2xlarge' => 'db.m5.2xlarge - (8 VCPU, 32Gib RAM) - ~$500 / month',
'db.m5.4xlarge' => 'db.m5.4xlarge - (16 VCPU, 64Gib RAM) - ~$1000 / month',
'db.m5.8xlarge' => 'db.m5.8xlarge - (32 VCPU, 128Gib RAM) - ~$2000 / month',
'db.m5.large' => 'db.m5.large - (2 VCPU, 8GB RAM) - ~$125 / month',
'db.m5.xlarge' => 'db.m5.xlarge - (4 VCPU, 16Gib RAM) - ~$250 / month',
'db.m5.2xlarge' => 'db.m5.2xlarge - (8 VCPU, 32Gib RAM) - ~$500 / month',
'db.m5.4xlarge' => 'db.m5.4xlarge - (16 VCPU, 64Gib RAM) - ~$1000 / month',
'db.m5.8xlarge' => 'db.m5.8xlarge - (32 VCPU, 128Gib RAM) - ~$2000 / month',
'db.m5.12xlarge' => 'db.m5.12xlarge - (48 VCPU, 192GiB RAM) - ~$3000 / month',
'db.m5.16xlarge' => 'db.m5.16xlarge - (64 VCPU, 256Gib RAM) - ~$4000 / month',
'db.m5.24xlarge' => 'db.m5.24xlarge - (96 VCPU, 384GiB RAM) - ~$6000 / month',
Expand All @@ -52,11 +52,11 @@ public static function general()
public static function memory()
{
return [
'db.r5.large' => 'db.r5.large - (2 VCPU, 16Gib RAM) - ~$173 / month',
'db.r5.xlarge' => 'db.r5.xlarge - (4 VCPU, 32Gib RAM) - ~$346 / month',
'db.r5.2xlarge' => 'db.r5.2xlarge - (8 VCPU, 64Gib RAM) - ~$691 / month',
'db.r5.4xlarge' => 'db.r5.4xlarge - (16 VCPU, 128Gib RAM) - ~$1382 / month',
'db.r5.8xlarge' => 'db.r5.8xlarge - (32 VCPU, 256Gib RAM) - ~$2765 / month',
'db.r5.large' => 'db.r5.large - (2 VCPU, 16Gib RAM) - ~$173 / month',
'db.r5.xlarge' => 'db.r5.xlarge - (4 VCPU, 32Gib RAM) - ~$346 / month',
'db.r5.2xlarge' => 'db.r5.2xlarge - (8 VCPU, 64Gib RAM) - ~$691 / month',
'db.r5.4xlarge' => 'db.r5.4xlarge - (16 VCPU, 128Gib RAM) - ~$1382 / month',
'db.r5.8xlarge' => 'db.r5.8xlarge - (32 VCPU, 256Gib RAM) - ~$2765 / month',
'db.r5.12xlarge' => 'db.r5.12xlarge - (48 VCPU, 384Gib RAM) - ~$4147 / month',
'db.r5.16xlarge' => 'db.r5.16xlarge - (64 VCPU, 512Gib RAM) - ~$5530 / month',
'db.r5.24xlarge' => 'db.r5.24xlarge - (96 VCPU, 768Gib RAM) - ~$8294 / month',
Expand Down
Loading

0 comments on commit 868ac50

Please sign in to comment.