Skip to content

Commit

Permalink
Bump acquia/coding-standards from 1.1.0 to 3.0.1 (#588)
Browse files Browse the repository at this point in the history
* 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](acquia/coding-standards-php@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] <[email protected]>

* 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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sayan goswami <[email protected]>
Co-authored-by: Raksha-Bharuka <[email protected]>
  • Loading branch information
3 people authored Sep 26, 2024
1 parent 895bf0d commit b989b82
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 120 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
60 changes: 30 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)%"
Expand Down
3 changes: 0 additions & 3 deletions example/src/ExampleComplexity.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ class ExampleComplexity {

/**
* Creates some cyclomatic complexity.
*
* @return int
* An arbitrary number.
*/
public function createComplexity(): int {
$x = 0;
Expand Down
14 changes: 8 additions & 6 deletions src/Enum/PhpcsStandardEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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),
];
}

Expand Down
10 changes: 6 additions & 4 deletions tests/Console/Command/Qa/QaFixerCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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],
];
}
Expand Down Expand Up @@ -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],
];
}
Expand Down
12 changes: 7 additions & 5 deletions tests/Console/Command/Qa/QaStaticAnalysisCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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],
];
}
Expand Down Expand Up @@ -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],
];
}
Expand Down
Loading

0 comments on commit b989b82

Please sign in to comment.