Skip to content

Commit

Permalink
Fix array indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Jul 11, 2024
1 parent ceddc2f commit 4bfe4f4
Show file tree
Hide file tree
Showing 135 changed files with 2,807 additions and 2,807 deletions.
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[composer.{json,lock}]
indent_size = 4
5 changes: 4 additions & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
<exclude name="Generic.Files.LineLength"/>
</rule>

<rule ref="Generic.PHP.ForbiddenFunctions">
<rule ref="Generic.Arrays.ArrayIndent"/>


<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="echo" value="$output->writeln"/>
Expand Down
10 changes: 5 additions & 5 deletions src/AcsfApi/AcsfConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ public function __construct(array $config, string $baseUri = null, string $urlAc
parent::__construct($config, $baseUri, $urlAccessToken);

$this->client = new GuzzleClient([

Check warning on line 22 in src/AcsfApi/AcsfConnector.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ public function __construct(array $config, string $baseUri = null, string $urlAccessToken = null) { parent::__construct($config, $baseUri, $urlAccessToken); - $this->client = new GuzzleClient(['auth' => [$config['key'], $config['secret']], 'base_uri' => $this->getBaseUri()]); + $this->client = new GuzzleClient(['base_uri' => $this->getBaseUri()]); } /** * @param array<string> $options
'auth' => [
$config['key'],
$config['secret'],
],
'base_uri' => $this->getBaseUri(),
'auth' => [

Check warning on line 23 in src/AcsfApi/AcsfConnector.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ public function __construct(array $config, string $baseUri = null, string $urlAccessToken = null) { parent::__construct($config, $baseUri, $urlAccessToken); - $this->client = new GuzzleClient(['auth' => [$config['key'], $config['secret']], 'base_uri' => $this->getBaseUri()]); + $this->client = new GuzzleClient(['auth' => [$config['secret']], 'base_uri' => $this->getBaseUri()]); } /** * @param array<string> $options
$config['key'],
$config['secret'],
],
'base_uri' => $this->getBaseUri(),

Check warning on line 27 in src/AcsfApi/AcsfConnector.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ public function __construct(array $config, string $baseUri = null, string $urlAccessToken = null) { parent::__construct($config, $baseUri, $urlAccessToken); - $this->client = new GuzzleClient(['auth' => [$config['key'], $config['secret']], 'base_uri' => $this->getBaseUri()]); + $this->client = new GuzzleClient(['auth' => [$config['key'], $config['secret']], 'base_uri' > $this->getBaseUri()]); } /** * @param array<string> $options
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/CloudApi/ClientService.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function configureClient(Client $client): void
{
$userAgent = sprintf("acli/%s", $this->application->getVersion());
$customHeaders = [
'User-Agent' => [$userAgent],
'User-Agent' => [$userAgent],
];
if ($uuid = getenv("REMOTEIDE_UUID")) {
$customHeaders['X-Cloud-IDE-UUID'] = $uuid;
Expand Down
10 changes: 5 additions & 5 deletions src/CloudApi/ConnectorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public function createConnector(): Connector|AccessTokenConnector
if (!$accessToken->hasExpired()) {
// @todo Add debug log entry indicating that access token is being used.
return new AccessTokenConnector([
'access_token' => $accessToken,
'key' => null,
'secret' => null,
'access_token' => $accessToken,
'key' => null,
'secret' => null,
], $this->baseUri, $this->accountsUri);
}
}
Expand All @@ -47,8 +47,8 @@ public function createConnector(): Connector|AccessTokenConnector
private function createAccessToken(): AccessToken
{
return new AccessToken([
'access_token' => $this->config['accessToken'],
'expires' => $this->config['accessTokenExpiry'],
'access_token' => $this->config['accessToken'],
'expires' => $this->config['accessTokenExpiry'],
]);
}
}
4 changes: 2 additions & 2 deletions src/Command/Acsf/AcsfListCommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$command = $this->getApplication()->find('list');
$arguments = [
'command' => 'list',
'namespace' => 'acsf',
'command' => 'list',
'namespace' => 'acsf',
];
$listInput = new ArrayInput($arguments);

Expand Down
20 changes: 10 additions & 10 deletions src/Command/Api/ApiBaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
foreach ($this->getDefinition()->getArguments() as $argument) {
if ($argument->isRequired() && !$input->getArgument($argument->getName())) {
$this->io->note([
"{$argument->getName()} is a required argument.",
$argument->getDescription(),
"{$argument->getName()} is a required argument.",
$argument->getDescription(),
]);
// Choice question.
if (
Expand Down Expand Up @@ -103,7 +103,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
// API calls returning octet streams (e.g., db backups). It's safe to use
// here because the API command should always return JSON.
$acquiaCloudClient->addOption('headers', [
'Accept' => 'application/hal+json, version=2',
'Accept' => 'application/hal+json, version=2',
]);

try {
Expand Down Expand Up @@ -265,7 +265,7 @@ private function createCallableValidator(InputArgument $argument, array $params)
if (array_key_exists($argument->getName(), $params)) {
$paramSpec = $params[$argument->getName()];
$constraints = [
new NotBlank(),
new NotBlank(),
];
if ($type = $this->getParamType($paramSpec)) {
if (in_array($type, ['int', 'integer'])) {
Expand Down Expand Up @@ -316,8 +316,8 @@ protected function createRegexConstraint(array $schema, array $constraints): arr
}
} elseif (array_key_exists('pattern', $schema)) {
$constraints[] = new Regex([
'message' => 'It must match the pattern ' . $schema['pattern'],
'pattern' => '/' . $schema['pattern'] . '/',
'message' => 'It must match the pattern ' . $schema['pattern'],
'pattern' => '/' . $schema['pattern'] . '/',
]);
}
return $constraints;
Expand Down Expand Up @@ -372,10 +372,10 @@ private function addPostParamToClient(string $paramName, ?array $paramSpec, mixe
}
if ($paramSpec && array_key_exists('format', $paramSpec) && $paramSpec["format"] === 'binary') {
$acquiaCloudClient->addOption('multipart', [
[
'contents' => Utils::tryFopen($paramValue, 'r'),
'name' => $paramName,
],
[
'contents' => Utils::tryFopen($paramValue, 'r'),
'name' => $paramName,
],
]);
} else {
$acquiaCloudClient->addOption('json', [$paramName => $paramValue]);
Expand Down
38 changes: 19 additions & 19 deletions src/Command/Api/ApiCommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ private function addApiCommandParameters(array $schema, array $acquiaCloudSpec,
// Parameters to be used in the request body.
if (array_key_exists('requestBody', $schema)) {
[
$bodyInputDefinition,
$requestBodyParamUsageSuffix,
$bodyInputDefinition,
$requestBodyParamUsageSuffix,
] = $this->addApiCommandParametersForRequestBody($schema, $acquiaCloudSpec);
$requestBodySchema = $this->getRequestBodyFromParameterSchema($schema, $acquiaCloudSpec);
/** @var \Symfony\Component\Console\Input\InputOption|InputArgument $parameterDefinition */
Expand Down Expand Up @@ -310,8 +310,8 @@ private function getCloudApiSpec(string $specFilePath): array
$spec = json_decode(file_get_contents($specFilePath), true);

$cache->warmUp([
$cacheKey => $spec,
$cacheKey . '.checksum' => $checksum,
$cacheKey => $spec,
$cacheKey . '.checksum' => $checksum,
]);

return $spec;
Expand Down Expand Up @@ -367,17 +367,17 @@ protected function getSkippedApiCommands(): array
return [
// Skip accounts:drush-aliases since we have remote:aliases:download instead and it actually returns
// application/gzip content.
'accounts:drush-aliases',
'accounts:drush-aliases',
// Skip any command that has a duplicative corresponding ACLI command.
'ide:create',
'log:tail',
'ssh-key:create',
'ssh-key:create-upload',
'ssh-key:delete',
'ssh-key:list',
'ssh-key:upload',
'ide:create',
'log:tail',
'ssh-key:create',
'ssh-key:create-upload',
'ssh-key:delete',
'ssh-key:list',
'ssh-key:upload',
// Skip buggy or unsupported endpoints.
'environments:stack-metrics-data-metric',
'environments:stack-metrics-data-metric',
];
}

Expand Down Expand Up @@ -440,9 +440,9 @@ protected static function getParameterRenameMap(): array
// Format should be ['original => new'].
return [
// @see api:environments:cron-create
'command' => 'cron_command',
'command' => 'cron_command',
// @see api:environments:update.
'version' => 'lang_version',
'version' => 'lang_version',
];
}

Expand Down Expand Up @@ -498,10 +498,10 @@ private function getRequestBodyContent(array $requestBody): array
{
$content = $requestBody['content'];
$knownContentTypes = [
'application/hal+json',
'application/json',
'application/x-www-form-urlencoded',
'multipart/form-data',
'application/hal+json',
'application/json',
'application/x-www-form-urlencoded',
'multipart/form-data',
];
foreach ($knownContentTypes as $contentType) {
if (array_key_exists($contentType, $content)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Command/Api/ApiListCommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$command = $this->getApplication()->find('list');
$arguments = [
'command' => 'list',
'namespace' => 'api',
'command' => 'list',
'namespace' => 'api',
];
$listInput = new ArrayInput($arguments);

Expand Down
6 changes: 3 additions & 3 deletions src/Command/App/AppVcsInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$table->setHeaderTitle('Status of Branches and Tags of the Application');
foreach ($allVcs as $vscPath => $env) {
$table->addRow([
$vscPath,
$vscPath,
// If VCS and env name is not same, it means it is deployed.
$vscPath !== $env ? 'Yes' : 'No',
$vscPath !== $env ? 'Yes' : 'No',
// If VCS and env name is same, it means it is deployed.
$vscPath !== $env ? $env : 'None',
$vscPath !== $env ? $env : 'None',
]);
}

Expand Down
22 changes: 11 additions & 11 deletions src/Command/App/From/Composer/ProjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ public function buildProject(): array
$source_modules = array_values(array_map(function (ExtensionInterface $module) {
// phpcs:disable SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys
return [
'name' => $module->getName(),
'humanName' => $module->getHumanName(),
'version' => $module->getVersion(),
'name' => $module->getName(),
'humanName' => $module->getHumanName(),
'version' => $module->getVersion(),
];
// phpcs:enable
}, $this->siteInspector->getExtensions(SiteInspectorInterface::FLAG_EXTENSION_MODULE | SiteInspectorInterface::FLAG_EXTENSION_ENABLED)));
Expand All @@ -141,14 +141,14 @@ public function buildProject(): array

// phpcs:disable SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys
return [
'installModules' => $modules_to_install,
'filePaths' => [
'public' => $this->siteInspector->getPublicFilePath(),
'private' => $this->siteInspector->getPrivateFilePath(),
],
'sourceModules' => $source_modules,
'recommendations' => $recommendations,
'rootPackageDefinition' => $composer_json,
'installModules' => $modules_to_install,
'filePaths' => [
'public' => $this->siteInspector->getPublicFilePath(),
'private' => $this->siteInspector->getPrivateFilePath(),
],
'sourceModules' => $source_modules,
'recommendations' => $recommendations,
'rootPackageDefinition' => $composer_json,
];
// phpcs:enable
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/App/From/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class Configuration
protected function __construct(array $config)
{
$this->array = static::schema([
'rootPackageDefinition' => 'is_array',
'rootPackageDefinition' => 'is_array',
])($config);
}

Expand Down
34 changes: 17 additions & 17 deletions src/Command/App/From/Recommendation/AbandonmentRecommendation.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ public static function createFromDefinition(mixed $definition): RecommendationIn
{
// phpcs:disable SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys
$validator = static::schema([
'package' => 'is_null',
'note' => 'is_string',
'replaces' => static::schema([
'name' => 'is_string',
]),
'vetted' => 'is_bool',
'package' => 'is_null',
'note' => 'is_string',
'replaces' => static::schema([
'name' => 'is_string',
]),
'vetted' => 'is_bool',
]);
// phpcs:enable
try {
Expand Down Expand Up @@ -145,20 +145,20 @@ public function normalize(): array
{
// phpcs:disable SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys
$normalized = [
'type' => 'abandonmentRecommendation',
'id' => "abandon:{$this->definition['replaces']['name']}",
'attributes' => [
'note' => $this->definition['note'],
],
'type' => 'abandonmentRecommendation',
'id' => "abandon:{$this->definition['replaces']['name']}",
'attributes' => [
'note' => $this->definition['note'],
],
];

$recommended_for = [
'data' => array_map(function (ExtensionInterface $extension) {
return [
'type' => $extension->isModule() ? 'module' : 'theme',
'id' => $extension->getName(),
];
}, $this->appliedTo),
'data' => array_map(function (ExtensionInterface $extension) {
return [
'type' => $extension->isModule() ? 'module' : 'theme',
'id' => $extension->getName(),
];
}, $this->appliedTo),
];
// phpcs:enable
if (!empty($recommended_for['data'])) {
Expand Down
Loading

0 comments on commit 4bfe4f4

Please sign in to comment.