From b989b820bab92afd268b7454c0a8dc995a5c9797 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:31:20 +0530 Subject: [PATCH] Bump acquia/coding-standards from 1.1.0 to 3.0.1 (#588) * Bump acquia/coding-standards from 1.1.0 to 3.0.1 Bumps [acquia/coding-standards](https://github.com/acquia/coding-standards-php) from 1.1.0 to 3.0.1. - [Release notes](https://github.com/acquia/coding-standards-php/releases) - [Commits](https://github.com/acquia/coding-standards-php/compare/v1.1.0...v3.0.1) --- updated-dependencies: - dependency-name: acquia/coding-standards dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Fix static analysis issues * fix static analysis test * fix static analysis test * fix static analysis test * fix static analysis test * fix static analysis test * Updated tests --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: sayan goswami Co-authored-by: Raksha-Bharuka --- composer.json | 2 +- composer.lock | 60 ++++---- config/services.yml | 2 +- example/src/ExampleComplexity.php | 3 - src/Enum/PhpcsStandardEnum.php | 14 +- .../Console/Command/Qa/QaFixerCommandTest.php | 10 +- .../Qa/QaStaticAnalysisCommandTest.php | 12 +- tests/Domain/Package/PackageTest.php | 140 +++++++++--------- 8 files changed, 123 insertions(+), 120 deletions(-) diff --git a/composer.json b/composer.json index 3f5a96260..2181b40cf 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "ext-dom": "*", "ext-json": "*", "ext-sqlite3": "*", - "acquia/coding-standards": "^1.1.0", + "acquia/coding-standards": "^3.0.1", "composer/composer": "^2.5.5", "cweagans/composer-patches": "^1.7.3", "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", diff --git a/composer.lock b/composer.lock index 9c2efd27d..a15347dd9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "90eb379bcea4d4edae91d101c9e2ae34", + "content-hash": "e252e143a64e58d9c1b4d2df939d9d20", "packages": [ { "name": "acquia/coding-standards", - "version": "v1.1.0", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/acquia/coding-standards-php.git", - "reference": "92f87ecabcd0e54ff347fb86a041540e0bbc18e5" + "reference": "7315583494b81cbcbd8817d7e00dd8f4fba34b88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/acquia/coding-standards-php/zipball/92f87ecabcd0e54ff347fb86a041540e0bbc18e5", - "reference": "92f87ecabcd0e54ff347fb86a041540e0bbc18e5", + "url": "https://api.github.com/repos/acquia/coding-standards-php/zipball/7315583494b81cbcbd8817d7e00dd8f4fba34b88", + "reference": "7315583494b81cbcbd8817d7e00dd8f4fba34b88", "shasum": "" }, "require": { @@ -33,7 +33,7 @@ "type": "phpcodesniffer-standard", "extra": { "branch-alias": { - "dev-develop": "0.x-dev" + "dev-develop": "3.x-dev" } }, "autoload": { @@ -43,7 +43,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0-only" + "GPL-2.0-or-later" ], "authors": [ { @@ -63,7 +63,7 @@ "issues": "https://github.com/acquia/coding-standards/issues", "source": "https://github.com/acquia/coding-standards" }, - "time": "2023-03-03T22:51:37+00:00" + "time": "2024-07-11T20:08:50+00:00" }, { "name": "composer/ca-bundle", @@ -2269,16 +2269,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.29.0", + "version": "1.29.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc" + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/536889f2b340489d328f5ffb7b02bb6b183ddedc", - "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", "shasum": "" }, "require": { @@ -2310,9 +2310,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" }, - "time": "2024-05-06T12:04:23+00:00" + "time": "2024-05-31T08:52:43+00:00" }, { "name": "phpstan/phpstan", @@ -2870,16 +2870,16 @@ }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.18", + "version": "v2.11.19", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "ca242a0b7309e0f9d1f73b236e04ecf4ca3248d0" + "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/ca242a0b7309e0f9d1f73b236e04ecf4ca3248d0", - "reference": "ca242a0b7309e0f9d1f73b236e04ecf4ca3248d0", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", + "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", "shasum": "" }, "require": { @@ -2924,7 +2924,7 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2024-04-13T16:42:46+00:00" + "time": "2024-06-26T20:08:34+00:00" }, { "name": "slevomat/coding-standard", @@ -2993,16 +2993,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.9.2", + "version": "3.10.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480" + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/aac1f6f347a5c5ac6bc98ad395007df00990f480", - "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", "shasum": "" }, "require": { @@ -3069,7 +3069,7 @@ "type": "open_collective" } ], - "time": "2024-04-23T20:25:34+00:00" + "time": "2024-05-22T21:24:41+00:00" }, { "name": "symfony/cache", @@ -5091,16 +5091,16 @@ }, { "name": "symfony/yaml", - "version": "v6.4.7", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "53e8b1ef30a65f78eac60fddc5ee7ebbbdb1dee0" + "reference": "52903de178d542850f6f341ba92995d3d63e60c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/53e8b1ef30a65f78eac60fddc5ee7ebbbdb1dee0", - "reference": "53e8b1ef30a65f78eac60fddc5ee7ebbbdb1dee0", + "url": "https://api.github.com/repos/symfony/yaml/zipball/52903de178d542850f6f341ba92995d3d63e60c9", + "reference": "52903de178d542850f6f341ba92995d3d63e60c9", "shasum": "" }, "require": { @@ -5143,7 +5143,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.4.7" + "source": "https://github.com/symfony/yaml/tree/v6.4.8" }, "funding": [ { @@ -5159,7 +5159,7 @@ "type": "tidelift" } ], - "time": "2024-04-28T10:28:08+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "webflo/drupal-finder", diff --git a/config/services.yml b/config/services.yml index dd25c210b..d8c884c6e 100644 --- a/config/services.yml +++ b/config/services.yml @@ -12,7 +12,7 @@ parameters: env(ORCA_PACKAGES_CONFIG): config/packages.yml ORCA_PACKAGES_CONFIG: "%env(ORCA_PACKAGES_CONFIG)%" env(ORCA_PACKAGES_CONFIG_ALTER): ~ - env(ORCA_PHPCS_STANDARD): "AcquiaDrupalTransitional" + env(ORCA_PHPCS_STANDARD): "AcquiaDrupalMinimal" env(ORCA_PHPUNIT_DEBUG_MODE_ENABLE): "false" env(ORCA_TELEMETRY_ENABLE): "false" env(ORCA_IS_ALLOWED_FAILURE): "%env(ORCA_IS_ALLOWED_FAILURE)%" diff --git a/example/src/ExampleComplexity.php b/example/src/ExampleComplexity.php index 0cb824071..2e52b9256 100644 --- a/example/src/ExampleComplexity.php +++ b/example/src/ExampleComplexity.php @@ -7,9 +7,6 @@ class ExampleComplexity { /** * Creates some cyclomatic complexity. - * - * @return int - * An arbitrary number. */ public function createComplexity(): int { $x = 0; diff --git a/src/Enum/PhpcsStandardEnum.php b/src/Enum/PhpcsStandardEnum.php index 7e36f4c09..dd52f4eef 100644 --- a/src/Enum/PhpcsStandardEnum.php +++ b/src/Enum/PhpcsStandardEnum.php @@ -14,13 +14,14 @@ */ final class PhpcsStandardEnum extends Enum { - public const ACQUIA_PHP = 'AcquiaPHP'; + public const ACQUIA_PHP_MINIMAL = 'AcquiaPHPMinimal '; + public const ACQUIA_PHP_STRICT = 'AcquiaPHPStrict '; public const ACQUIA_DRUPAL_STRICT = 'AcquiaDrupalStrict'; - public const ACQUIA_DRUPAL_TRANSITIONAL = 'AcquiaDrupalTransitional'; + public const ACQUIA_DRUPAL_MINIMAL = 'AcquiaDrupalMinimal'; - public const DEFAULT = self::ACQUIA_DRUPAL_TRANSITIONAL; + public const DEFAULT = self::ACQUIA_DRUPAL_MINIMAL; /** * Provides help text for commands that accept PHPCS standard input. @@ -30,9 +31,10 @@ final class PhpcsStandardEnum extends Enum { */ public static function commandHelp(): array { return [ - sprintf('- %s: Contains sniffs applicable to all PHP projects', self::ACQUIA_PHP), - sprintf('- %s: Recommended for new Drupal projects and teams familiar with Drupal coding standards', self::ACQUIA_DRUPAL_STRICT), - sprintf('- %s: A relaxed standard for legacy Drupal codebases or teams new to Drupal coding standards', self::ACQUIA_DRUPAL_TRANSITIONAL), + sprintf('- %s: Based on PSR-12 and is intended for use on all public non-Drupal projects', self::ACQUIA_PHP_MINIMAL), + sprintf('- %s: Based on AcquiaDrupal and adds the more opinionated DrupalPractice standard. It is intended for use on all internal Drupal projects', self::ACQUIA_DRUPAL_STRICT), + sprintf('- %s: Based on AcquiaPHP and adds additional, more opinionated standards. It is intended for use on all internal, non-Drupal projects', self::ACQUIA_PHP_STRICT), + sprintf('- %s: Based on the Drupal coding standard and is intended for use on all public Drupal projects', self::ACQUIA_DRUPAL_MINIMAL), ]; } diff --git a/tests/Console/Command/Qa/QaFixerCommandTest.php b/tests/Console/Command/Qa/QaFixerCommandTest.php index ff1780a91..168dbdd2a 100644 --- a/tests/Console/Command/Qa/QaFixerCommandTest.php +++ b/tests/Console/Command/Qa/QaFixerCommandTest.php @@ -153,8 +153,9 @@ public function testPhpcsStandardOption($args, $standard): void { public static function providerPhpcsStandardOption(): array { return [ [[], PhpcsStandardEnum::DEFAULT], - [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_PHP], PhpcsStandardEnum::ACQUIA_PHP], - [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_DRUPAL_TRANSITIONAL], PhpcsStandardEnum::ACQUIA_DRUPAL_TRANSITIONAL], + [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_PHP_MINIMAL], PhpcsStandardEnum::ACQUIA_PHP_MINIMAL], + [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_PHP_STRICT], PhpcsStandardEnum::ACQUIA_PHP_STRICT], + [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_DRUPAL_MINIMAL], PhpcsStandardEnum::ACQUIA_DRUPAL_MINIMAL], [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_DRUPAL_STRICT], PhpcsStandardEnum::ACQUIA_DRUPAL_STRICT], ]; } @@ -195,8 +196,9 @@ public function testPhpcsStandardEnvVar($standard): void { public static function providerPhpcsStandardEnvVar(): array { return [ - [PhpcsStandardEnum::ACQUIA_PHP], - [PhpcsStandardEnum::ACQUIA_DRUPAL_TRANSITIONAL], + [PhpcsStandardEnum::ACQUIA_PHP_STRICT], + [PhpcsStandardEnum::ACQUIA_PHP_MINIMAL], + [PhpcsStandardEnum::ACQUIA_DRUPAL_MINIMAL], [PhpcsStandardEnum::ACQUIA_DRUPAL_STRICT], ]; } diff --git a/tests/Console/Command/Qa/QaStaticAnalysisCommandTest.php b/tests/Console/Command/Qa/QaStaticAnalysisCommandTest.php index 824c50f9d..054b2b814 100644 --- a/tests/Console/Command/Qa/QaStaticAnalysisCommandTest.php +++ b/tests/Console/Command/Qa/QaStaticAnalysisCommandTest.php @@ -136,7 +136,7 @@ public static function providerOptions(): array { ['composer', FALSE], ['coverage', FALSE], ['phpcs', FALSE], - ['phpcs-standard', 'AcquiaDrupalTransitional'], + ['phpcs-standard', 'AcquiaDrupalMinimal'], ['phplint', FALSE], ['phploc', FALSE], ['phpmd', FALSE], @@ -307,8 +307,9 @@ public function testPhpcsStandardOption(array $args, $standard): void { public static function providerPhpcsStandardOption(): array { return [ [[], PhpcsStandardEnum::DEFAULT], - [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_PHP], PhpcsStandardEnum::ACQUIA_PHP], - [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_DRUPAL_TRANSITIONAL], PhpcsStandardEnum::ACQUIA_DRUPAL_TRANSITIONAL], + [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_PHP_STRICT], PhpcsStandardEnum::ACQUIA_PHP_STRICT], + [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_PHP_MINIMAL], PhpcsStandardEnum::ACQUIA_PHP_MINIMAL], + [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_DRUPAL_MINIMAL], PhpcsStandardEnum::ACQUIA_DRUPAL_MINIMAL], [['--phpcs-standard' => PhpcsStandardEnum::ACQUIA_DRUPAL_STRICT], PhpcsStandardEnum::ACQUIA_DRUPAL_STRICT], ]; } @@ -344,8 +345,9 @@ public function testPhpcsStandardEnvVar($standard): void { public static function providerPhpcsStandardEnvVar(): array { return [ - [PhpcsStandardEnum::ACQUIA_PHP], - [PhpcsStandardEnum::ACQUIA_DRUPAL_TRANSITIONAL], + [PhpcsStandardEnum::ACQUIA_PHP_STRICT], + [PhpcsStandardEnum::ACQUIA_PHP_MINIMAL], + [PhpcsStandardEnum::ACQUIA_DRUPAL_MINIMAL], [PhpcsStandardEnum::ACQUIA_DRUPAL_STRICT], ]; } diff --git a/tests/Domain/Package/PackageTest.php b/tests/Domain/Package/PackageTest.php index 6cf39e44a..8e994d4fb 100644 --- a/tests/Domain/Package/PackageTest.php +++ b/tests/Domain/Package/PackageTest.php @@ -91,95 +91,95 @@ public static function providerConstructionAndGetters(): array { ], ], ], - 'drupal/example_library', - 'example_library', - NULL, - 'library', - '/var/www/example_library', - 'custom/path/to/example_library', - '2.x', - '2.x-dev', - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - TRUE, + 'package_name' => 'drupal/example_library', + 'project_name' => 'example_library', + 'drupal_extension_name' => NULL, + 'type' => 'library', + 'raw_repository_url' => '/var/www/example_library', + 'install_path' => 'custom/path/to/example_library', + 'version' => '2.x', + 'dev_version' => '2.x-dev', + 'is_extension' => FALSE, + 'is_module' => FALSE, + 'is_theme' => FALSE, + 'is_project_template' => FALSE, + 'enable' => FALSE, + 'require' => TRUE, ], 'Minimum specification/default values' => [ 'data' => [], - 'drupal/example_module', - 'example_module', - 'example_module', - 'drupal-module', - '../example_module', - 'docroot/modules/contrib/example_module', - '*', - '*@dev', - TRUE, - TRUE, - FALSE, - FALSE, - TRUE, - TRUE, + 'package_name' => 'drupal/example_module', + 'project_name' => 'example_module', + 'drupal_extension_name' => 'example_module', + 'type' => 'drupal-module', + 'raw_repository_url' => '../example_module', + 'install_path' => 'docroot/modules/contrib/example_module', + 'version' => '*', + 'dev_version' => '*@dev', + 'is_extension' => TRUE, + 'is_module' => TRUE, + 'is_theme' => FALSE, + 'is_project_template' => FALSE, + 'enable' => TRUE, + 'require' => TRUE, ], 'Module that should be enabled' => [ 'data' => [ 'version' => NULL, 'version_dev' => NULL, ], - 'drupal/example_module', - 'example_module', - 'example_module', - 'drupal-module', - '../example_module', - 'docroot/modules/contrib/example_module', - NULL, - NULL, - TRUE, - TRUE, - FALSE, - FALSE, - TRUE, - TRUE, + 'package_name' => 'drupal/example_module', + 'project_name' => 'example_module', + 'drupal_extension_name' => 'example_module', + 'type' => 'drupal-module', + 'raw_repository_url' => '../example_module', + 'install_path' => 'docroot/modules/contrib/example_module', + 'version' => NULL, + 'dev_version' => NULL, + 'is_extension' => TRUE, + 'is_module' => TRUE, + 'is_theme' => FALSE, + 'is_project_template' => FALSE, + 'enable' => TRUE, + 'require' => TRUE, ], 'Module that should not be enabled' => [ 'data' => [ 'enable' => FALSE, ], - 'drupal/example_module', - 'example_module', - 'example_module', - 'drupal-module', - '../example_module', - 'docroot/modules/contrib/example_module', - '*', - '*@dev', - TRUE, - TRUE, - FALSE, - FALSE, - FALSE, - TRUE, + 'package_name' => 'drupal/example_module', + 'project_name' => 'example_module', + 'drupal_extension_name' => 'example_module', + 'type' => 'drupal-module', + 'raw_repository_url' => '../example_module', + 'install_path' => 'docroot/modules/contrib/example_module', + 'version' => '*', + 'dev_version' => '*@dev', + 'is_extension' => TRUE, + 'is_module' => TRUE, + 'is_theme' => FALSE, + 'is_project_template' => FALSE, + 'enable' => FALSE, + 'require' => TRUE, ], 'Theme' => [ 'data' => [ 'type' => 'drupal-theme', ], - 'drupal/example_theme', - 'example_theme', - 'example_theme', - 'drupal-theme', - '../example_theme', - 'docroot/themes/contrib/example_theme', - '*', - '*@dev', - TRUE, - FALSE, - TRUE, - FALSE, - TRUE, - TRUE, + 'package_name' => 'drupal/example_theme', + 'project_name' => 'example_theme', + 'drupal_extension_name' => 'example_theme', + 'type' => 'drupal-theme', + 'raw_repository_url' => '../example_theme', + 'install_path' => 'docroot/themes/contrib/example_theme', + 'version' => '*', + 'dev_version' => '*@dev', + 'is_extension' => TRUE, + 'is_module' => FALSE, + 'is_theme' => TRUE, + 'is_project_template' => FALSE, + 'enable' => TRUE, + 'require' => TRUE, ], ]; }