From 1daaabe655c7e7364599e8045cbdbade1e0e45a8 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Mon, 11 Mar 2024 10:57:39 -0700 Subject: [PATCH] Update slevomat/coding-standard --- composer.lock | 22 +++++++++---------- src/Command/Api/ApiBaseCommand.php | 5 ----- src/Command/Api/ApiCommandHelper.php | 19 ---------------- .../CodeStudioPipelinesMigrateCommand.php | 7 ------ .../CodeStudio/CodeStudioWizardCommand.php | 2 -- .../Email/ConfigurePlatformEmailCommand.php | 2 -- .../Email/EmailInfoForSubscriptionCommand.php | 4 ---- src/DataStore/Datastore.php | 1 - src/DataStore/JsonDataStore.php | 3 --- src/Helpers/SshHelper.php | 5 ----- tests/phpunit/src/AcsfApi/AcsfServiceTest.php | 1 - .../src/CloudApi/AcsfClientServiceTest.php | 1 - .../src/CloudApi/ClientServiceTest.php | 1 - .../Acsf/AcsfAuthLogoutCommandTest.php | 2 -- .../src/Commands/App/NewCommandTest.php | 2 -- .../Remote/AliasesDownloadCommandTest.php | 2 -- .../src/Commands/Remote/DrushCommandTest.php | 1 - .../src/Commands/TelemetryCommandTest.php | 1 - 18 files changed, 11 insertions(+), 70 deletions(-) diff --git a/composer.lock b/composer.lock index 8ab7d3f1a..dc09e3ff1 100644 --- a/composer.lock +++ b/composer.lock @@ -12573,32 +12573,32 @@ }, { "name": "slevomat/coding-standard", - "version": "8.14.1", + "version": "8.15.0", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926" + "reference": "7d1d957421618a3803b593ec31ace470177d7817" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/fea1fd6f137cc84f9cba0ae30d549615dbc6a926", - "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/7d1d957421618a3803b593ec31ace470177d7817", + "reference": "7d1d957421618a3803b593ec31ace470177d7817", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", "php": "^7.2 || ^8.0", "phpstan/phpdoc-parser": "^1.23.1", - "squizlabs/php_codesniffer": "^3.7.1" + "squizlabs/php_codesniffer": "^3.9.0" }, "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.10.37", + "phpstan/phpstan": "1.10.60", "phpstan/phpstan-deprecation-rules": "1.1.4", - "phpstan/phpstan-phpunit": "1.3.14", - "phpstan/phpstan-strict-rules": "1.5.1", - "phpunit/phpunit": "8.5.21|9.6.8|10.3.5" + "phpstan/phpstan-phpunit": "1.3.16", + "phpstan/phpstan-strict-rules": "1.5.2", + "phpunit/phpunit": "8.5.21|9.6.8|10.5.11" }, "type": "phpcodesniffer-standard", "extra": { @@ -12622,7 +12622,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.14.1" + "source": "https://github.com/slevomat/coding-standard/tree/8.15.0" }, "funding": [ { @@ -12634,7 +12634,7 @@ "type": "tidelift" } ], - "time": "2023-10-08T07:28:08+00:00" + "time": "2024-03-09T15:20:58+00:00" }, { "name": "squizlabs/php_codesniffer", diff --git a/src/Command/Api/ApiBaseCommand.php b/src/Command/Api/ApiBaseCommand.php index bb2b8cb5b..e75f65ce3 100644 --- a/src/Command/Api/ApiBaseCommand.php +++ b/src/Command/Api/ApiBaseCommand.php @@ -263,8 +263,6 @@ private function createCallableValidator(InputArgument $argument, array $params) } /** - * @param array $schema - * @param array $constraints * @return array */ private function createLengthConstraint(array $schema, array $constraints): array { @@ -282,8 +280,6 @@ private function createLengthConstraint(array $schema, array $constraints): arra } /** - * @param array $schema - * @param array $constraints * @return array */ protected function createRegexConstraint(array $schema, array $constraints): array { @@ -389,7 +385,6 @@ private function askFreeFormQuestion(InputArgument $argument, array $params): mi } /** - * @param array $paramSpec * @return null|array */ private function getParamTypeOneOf(array $paramSpec): ?array { diff --git a/src/Command/Api/ApiCommandHelper.php b/src/Command/Api/ApiCommandHelper.php index df2794c09..f9570dd3e 100644 --- a/src/Command/Api/ApiCommandHelper.php +++ b/src/Command/Api/ApiCommandHelper.php @@ -59,10 +59,6 @@ private function addOptionExampleToUsageForGetEndpoint(array $paramDefinition, s return $usage; } - /** - * @param array $schema - * @param array $acquiaCloudSpec - */ private function addApiCommandParameters(array $schema, array $acquiaCloudSpec, ApiBaseCommand $command): void { $inputDefinition = []; $usage = ''; @@ -112,8 +108,6 @@ private function addApiCommandParameters(array $schema, array $acquiaCloudSpec, } /** - * @param array $schema - * @param array $acquiaCloudSpec * @return array */ private function addApiCommandParametersForRequestBody(array $schema, array $acquiaCloudSpec): array { @@ -211,8 +205,6 @@ private function addPostArgumentUsageToExample(mixed $requestBody, mixed $propKe } /** - * @param array $schema - * @param array $acquiaCloudSpec * @return array */ private function addApiCommandParametersForPathAndQuery(array $schema, array $acquiaCloudSpec): array { @@ -255,10 +247,6 @@ private function addApiCommandParametersForPathAndQuery(array $schema, array $ac return [$inputDefinition, $usage]; } - /** - * @param array $acquiaCloudSpec - * @param $schema - */ private function getParameterDefinitionFromSpec(string $paramKey, array $acquiaCloudSpec, mixed $schema): mixed { $uppercaseKey = ucfirst($paramKey); if (array_key_exists('parameters', $acquiaCloudSpec['components']) @@ -421,8 +409,6 @@ private function addAliasParameterDescriptions(mixed &$paramDefinition): void { } /** - * @param array $schema - * @param array $acquiaCloudSpec * @return array */ private function getRequestBodyFromParameterSchema(array $schema, array $acquiaCloudSpec): array { @@ -439,10 +425,6 @@ private function getRequestBodyFromParameterSchema(array $schema, array $acquiaC return $requestBodySchema; } - /** - * @param array $requestBodySchema - * @param $parameterDefinition - */ private function getPropertySpecFromRequestBodyParam(array $requestBodySchema, mixed $parameterDefinition): mixed { return $requestBodySchema['properties'][$parameterDefinition->getName()] ?? NULL; } @@ -477,7 +459,6 @@ public static function restoreRenamedParameter(string $propKey): int|string { } /** - * @param array $apiCommands * @return ApiListCommandBase[] */ private function generateApiListCommands(array $apiCommands, string $commandPrefix, CommandFactoryInterface $commandFactory): array { diff --git a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php index f06a77895..ec0aa0029 100644 --- a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php +++ b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php @@ -76,8 +76,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** * Check whether wizard command is executed by checking the env variable of codestudio project. - * - * @param array $project */ private function checkGitLabCiCdVariables(array $project): void { $gitlabCicdVariables = CodeStudioCiCdVariables::getList(); @@ -93,7 +91,6 @@ private function checkGitLabCiCdVariables(array $project): void { /** * Check acquia-pipeline.yml file exists in the root repo and remove ci_config_path from codestudio project. * - * @param array $project * @return array */ private function getAcquiaPipelinesFileContents(array $project): array { @@ -163,10 +160,6 @@ private function getPipelinesSection(array $acquiaPipelinesFileContents, string return $acquiaPipelinesFileContents['events'][$eventName]['steps'] ?? NULL; } - /** - * @param array $acquiaPipelinesFileContents - * @param array $gitlabCiFileContents - */ private function migrateEventsSection(array $acquiaPipelinesFileContents, array &$gitlabCiFileContents): void { // phpcs:disable SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys $eventsMap = [ diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index 4eb86cb90..b8053244d 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -140,7 +140,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int } /** - * @param array $project * @return array|null */ private function getGitLabScheduleByDescription(array $project, string $scheduledPipelineDescription): ?array { @@ -154,7 +153,6 @@ private function getGitLabScheduleByDescription(array $project, string $schedule } /** - * @param array $project * @return array|null ? */ private function getGitLabProjectAccessTokenByName(array $project, string $name): ?array { diff --git a/src/Command/Email/ConfigurePlatformEmailCommand.php b/src/Command/Email/ConfigurePlatformEmailCommand.php index 79845a9d8..3075dd46a 100644 --- a/src/Command/Email/ConfigurePlatformEmailCommand.php +++ b/src/Command/Email/ConfigurePlatformEmailCommand.php @@ -97,8 +97,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** * Generates Zone File for DNS records of the registered domain. - * - * @param array $records */ private function generateZoneFile(string $baseDomain, array $records): void { diff --git a/src/Command/Email/EmailInfoForSubscriptionCommand.php b/src/Command/Email/EmailInfoForSubscriptionCommand.php index a46c7e47e..11196015f 100644 --- a/src/Command/Email/EmailInfoForSubscriptionCommand.php +++ b/src/Command/Email/EmailInfoForSubscriptionCommand.php @@ -63,8 +63,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** * Renders tables showing email domain verification statuses, * as well as exports these statuses to respective CSV files. - * - * @param array $domainList */ private function writeDomainsToTables(OutputInterface $output, SubscriptionResponse $subscription, array $domainList): void { @@ -156,8 +154,6 @@ private function writeDomainsToTables(OutputInterface $output, SubscriptionRespo /** * Nicely renders a given array of tables. - * - * @param array $tables */ private function renderDomainInfoTables(array $tables): void { foreach ($tables as $table) { diff --git a/src/DataStore/Datastore.php b/src/DataStore/Datastore.php index 708eddaba..388c069fb 100644 --- a/src/DataStore/Datastore.php +++ b/src/DataStore/Datastore.php @@ -56,7 +56,6 @@ public function exists(string $key): bool { } /** - * @param array $config * @param string $path Path to the datastore on disk. * @return array */ diff --git a/src/DataStore/JsonDataStore.php b/src/DataStore/JsonDataStore.php index a75ea649f..6c7f90d9f 100644 --- a/src/DataStore/JsonDataStore.php +++ b/src/DataStore/JsonDataStore.php @@ -36,9 +36,6 @@ public function dump(): void { $this->fileSystem->dumpFile($this->filepath, json_encode($this->data->export(), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT)); } - /** - * @param array $array - */ protected function cleanLegacyConfig(array &$array): bool { // Legacy format of credential storage. $dump = FALSE; diff --git a/src/Helpers/SshHelper.php b/src/Helpers/SshHelper.php index 8a9759117..e2adb4eb2 100644 --- a/src/Helpers/SshHelper.php +++ b/src/Helpers/SshHelper.php @@ -30,7 +30,6 @@ public function __construct( /** * Execute the command in a remote environment. * - * @param array $commandArgs * @param int|null $timeout */ public function executeCommand(EnvironmentResponse|string $target, array $commandArgs, bool $printOutput = TRUE, int $timeout = NULL): Process { @@ -66,8 +65,6 @@ private function sendCommand(?string $url, array $command, bool $printOutput, ?i /** * Return the first item of the $commandArgs that is not an option. - * - * @param array $commandArgs */ private function firstArguments(array $commandArgs): string { $result = ''; @@ -98,8 +95,6 @@ private function getOutputCallback(): callable { * Return a summary of the command that does not include the * arguments. This avoids potential information disclosure in * CI scripts. - * - * @param array $commandArgs */ private function getCommandSummary(array $commandArgs): string { return $this->firstArguments($commandArgs); diff --git a/tests/phpunit/src/AcsfApi/AcsfServiceTest.php b/tests/phpunit/src/AcsfApi/AcsfServiceTest.php index 0f4c0d474..7466f875e 100644 --- a/tests/phpunit/src/AcsfApi/AcsfServiceTest.php +++ b/tests/phpunit/src/AcsfApi/AcsfServiceTest.php @@ -44,7 +44,6 @@ public function providerTestIsMachineAuthenticated(): array { /** * @dataProvider providerTestIsMachineAuthenticated - * @param array $envVars */ public function testIsMachineAuthenticated(array $envVars, bool $isAuthenticated): void { self::setEnvVars($envVars); diff --git a/tests/phpunit/src/CloudApi/AcsfClientServiceTest.php b/tests/phpunit/src/CloudApi/AcsfClientServiceTest.php index c02549be2..b2607a4d0 100644 --- a/tests/phpunit/src/CloudApi/AcsfClientServiceTest.php +++ b/tests/phpunit/src/CloudApi/AcsfClientServiceTest.php @@ -35,7 +35,6 @@ public function providerTestIsMachineAuthenticated(): array { /** * @dataProvider providerTestIsMachineAuthenticated - * @param array $envVars */ public function testIsMachineAuthenticated(array $envVars, bool $isAuthenticated): void { self::setEnvVars($envVars); diff --git a/tests/phpunit/src/CloudApi/ClientServiceTest.php b/tests/phpunit/src/CloudApi/ClientServiceTest.php index 3e5fffec6..ae5d4e993 100644 --- a/tests/phpunit/src/CloudApi/ClientServiceTest.php +++ b/tests/phpunit/src/CloudApi/ClientServiceTest.php @@ -38,7 +38,6 @@ public function providerTestIsMachineAuthenticated(): array { /** * @dataProvider providerTestIsMachineAuthenticated - * @param array $envVars */ public function testIsMachineAuthenticated(array $envVars, bool $isAuthenticated): void { self::setEnvVars($envVars); diff --git a/tests/phpunit/src/Commands/Acsf/AcsfAuthLogoutCommandTest.php b/tests/phpunit/src/Commands/Acsf/AcsfAuthLogoutCommandTest.php index c6d4bc04f..b02959a5a 100644 --- a/tests/phpunit/src/Commands/Acsf/AcsfAuthLogoutCommandTest.php +++ b/tests/phpunit/src/Commands/Acsf/AcsfAuthLogoutCommandTest.php @@ -49,8 +49,6 @@ public function providerTestAuthLogoutCommand(): array { /** * @dataProvider providerTestAuthLogoutCommand - * @param array $inputs - * @param array $config */ public function testAcsfAuthLogoutCommand(bool $machineIsAuthenticated, array $inputs, array $config = []): void { if (!$machineIsAuthenticated) { diff --git a/tests/phpunit/src/Commands/App/NewCommandTest.php b/tests/phpunit/src/Commands/App/NewCommandTest.php index 59cabf4c6..cc2171f3e 100644 --- a/tests/phpunit/src/Commands/App/NewCommandTest.php +++ b/tests/phpunit/src/Commands/App/NewCommandTest.php @@ -49,7 +49,6 @@ public function provideTestNewNextJsAppCommand(): array { /** * @dataProvider provideTestNewDrupalCommand - * @param array $package */ public function testNewDrupalCommand(array $package, string $directory = 'drupal'): void { $this->newProjectDir = Path::makeAbsolute($directory, $this->projectDir); @@ -88,7 +87,6 @@ public function testNewDrupalCommand(array $package, string $directory = 'drupal /** * @dataProvider provideTestNewNextJsAppCommand - * @param array $package */ public function testNewNextJSAppCommand(array $package, string $directory = 'nextjs'): void { $this->newProjectDir = Path::makeAbsolute($directory, $this->projectDir); diff --git a/tests/phpunit/src/Commands/Remote/AliasesDownloadCommandTest.php b/tests/phpunit/src/Commands/Remote/AliasesDownloadCommandTest.php index 526aa0d7d..d6760ae9d 100644 --- a/tests/phpunit/src/Commands/Remote/AliasesDownloadCommandTest.php +++ b/tests/phpunit/src/Commands/Remote/AliasesDownloadCommandTest.php @@ -42,8 +42,6 @@ public function providerTestRemoteAliasesDownloadCommand(): array { } /** - * @param array $inputs - * @param array $args * @param string|null $destinationDir * @param bool $all Download aliases for all applications. * @dataProvider providerTestRemoteAliasesDownloadCommand diff --git a/tests/phpunit/src/Commands/Remote/DrushCommandTest.php b/tests/phpunit/src/Commands/Remote/DrushCommandTest.php index 2d6c5f0eb..2376421e3 100644 --- a/tests/phpunit/src/Commands/Remote/DrushCommandTest.php +++ b/tests/phpunit/src/Commands/Remote/DrushCommandTest.php @@ -40,7 +40,6 @@ public function providerTestRemoteDrushCommand(): array { /** * @dataProvider providerTestRemoteDrushCommand - * @param array $args * @group serial */ public function testRemoteDrushCommand(array $args): void { diff --git a/tests/phpunit/src/Commands/TelemetryCommandTest.php b/tests/phpunit/src/Commands/TelemetryCommandTest.php index 3a7fe62f5..b7ac1897a 100644 --- a/tests/phpunit/src/Commands/TelemetryCommandTest.php +++ b/tests/phpunit/src/Commands/TelemetryCommandTest.php @@ -60,7 +60,6 @@ public function providerTestTelemetryPrompt(): array { * Tests telemetry prompt. * * @dataProvider providerTestTelemetryPrompt - * @param array $inputs * @param $message */ public function testTelemetryPrompt(array $inputs, mixed $message): void {