From b5ad678aacd657a00ad5b17e4942467e2a3afce2 Mon Sep 17 00:00:00 2001 From: Ken Rickard Date: Mon, 8 Apr 2024 04:34:24 -0400 Subject: [PATCH] Upgrade project tooling to PHP 8.2 (#300) * Php 8.2 * Wait for 12.1.11 release of symplify/rule-doc-generator/tags * Stylf fix (line endings?) --------- Co-authored-by: bjorn --- .github/workflows/codestyle.yml | 2 +- .../workflows/functional_test__rector_examples.yml | 3 +++ .github/workflows/phpstan.yml | 2 +- .github/workflows/phpunit.yml | 2 +- composer.json | 6 +++--- src/Drupal8/Rector/Deprecation/DrupalLRector.php | 2 +- .../Rector/Deprecation/SafeMarkupFormatRector.php | 12 ++++++------ 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 93c9f18e..08d499ac 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.2 coverage: none # disable xdebug, pcov tools: composer:v2 extensions: zip diff --git a/.github/workflows/functional_test__rector_examples.yml b/.github/workflows/functional_test__rector_examples.yml index 2402ecf3..dc4657ff 100644 --- a/.github/workflows/functional_test__rector_examples.yml +++ b/.github/workflows/functional_test__rector_examples.yml @@ -30,6 +30,9 @@ jobs: - php-version: "8.1" drupal: "^10.0" fixture: "d10" + - php-version: "8.2" + drupal: "^10.0" + fixture: "d10" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 4e7e99ba..af3574ca 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.2 coverage: none # disable xdebug, pcov tools: composer:v2 extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 6a968ed3..5af6600d 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: php-version: - - "8.1" + - "8.2" steps: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 diff --git a/composer.json b/composer.json index 77faedc0..e436e109 100644 --- a/composer.json +++ b/composer.json @@ -74,15 +74,15 @@ "enable-patching": true }, "require-dev": { - "php": "^8.1", + "php": "^8.2", "cweagans/composer-patches": "^1.7.2", - "friendsofphp/php-cs-fixer": "^3.38", + "friendsofphp/php-cs-fixer": "^3.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", "phpstan/phpstan-deprecation-rules": "^1.0", "phpunit/phpunit": "^10.0", "symfony/yaml": "^5 || ^6", - "symplify/rule-doc-generator": "^12.0", + "symplify/rule-doc-generator": "dev-main", "symplify/vendor-patches": "^11.0" }, "scripts": { diff --git a/src/Drupal8/Rector/Deprecation/DrupalLRector.php b/src/Drupal8/Rector/Deprecation/DrupalLRector.php index ce176653..16b84240 100644 --- a/src/Drupal8/Rector/Deprecation/DrupalLRector.php +++ b/src/Drupal8/Rector/Deprecation/DrupalLRector.php @@ -46,7 +46,7 @@ public function getRuleDefinition(): RuleDefinition public function getNodeTypes(): array { return [ - Node\Expr\StaticCall::class, + Node\Expr\StaticCall::class, ]; } diff --git a/src/Drupal8/Rector/Deprecation/SafeMarkupFormatRector.php b/src/Drupal8/Rector/Deprecation/SafeMarkupFormatRector.php index d59b7acd..74059525 100644 --- a/src/Drupal8/Rector/Deprecation/SafeMarkupFormatRector.php +++ b/src/Drupal8/Rector/Deprecation/SafeMarkupFormatRector.php @@ -27,15 +27,15 @@ final class SafeMarkupFormatRector extends AbstractRector public function getRuleDefinition(): RuleDefinition { return new RuleDefinition('Fixes deprecated SafeMarkup::format() calls', [ - new CodeSample( - <<<'CODE_BEFORE' + new CodeSample( + <<<'CODE_BEFORE' $safe_string_markup_object = \Drupal\Component\Utility\SafeMarkup::format('hello world'); CODE_BEFORE - , - <<<'CODE_AFTER' + , + <<<'CODE_AFTER' $safe_string_markup_object = new \Drupal\Component\Render\FormattableMarkup('hello world'); CODE_AFTER - ), + ), ]); } @@ -45,7 +45,7 @@ public function getRuleDefinition(): RuleDefinition public function getNodeTypes(): array { return [ - Node\Expr\StaticCall::class, + Node\Expr\StaticCall::class, ]; }