From 4f19f4e6c31d251d342ec98f633a701a7b71aec2 Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Wed, 28 Oct 2026 10:08:17 +0000 Subject: [PATCH] chore(deps-dev): JIRA-18502 Update to Coding Style 6.x This updates to Coding Style 6.x, which uses PHPStan Extension Installer. --- .github/workflows/dependabot-auto-merge.yml | 2 +- .github/workflows/static.yml | 13 +++++++------ .github/workflows/tests.yml | 8 +++----- composer.json | 8 +++++--- phpstan.neon.dist | 1 - rector.php | 8 ++------ src/Casts/NumberFromCents.php | 2 +- src/Casts/NumberFromDecimal.php | 4 ++-- src/GraphQL/Scalars/PercentageType.php | 2 -- 9 files changed, 21 insertions(+), 27 deletions(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 0460982..35a9c03 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v3 + uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 738d492..65656d5 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -14,16 +14,17 @@ jobs: name: PHPStan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: '8.4' coverage: none - name: Install composer dependencies - uses: ramsey/composer-install@v4 + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - name: Run PHPStan run: composer test:types @@ -35,16 +36,16 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: '8.4' coverage: none - name: Install composer dependencies - uses: ramsey/composer-install@v4 + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - name: Run ECS run: composer test:style diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aaafa93..bc8c896 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,22 +13,20 @@ jobs: matrix: os: [ubuntu-latest] php: [8.4, 8.5] - laravel: [12.*, 13.*] + laravel: [13.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 13.* testbench: ^11.0 - - laravel: 12.* - testbench: ^10.7 name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: ${{ matrix.php }} coverage: none diff --git a/composer.json b/composer.json index 1a9b98e..a87cb5f 100644 --- a/composer.json +++ b/composer.json @@ -21,12 +21,13 @@ "webonyx/graphql-php": "^15.30" }, "require-dev": { + "canvural/larastan-strict-rules": "^3.0", "larastan/larastan": "^3.9", "nunomaduro/collision": "^8.9", "nuwave/lighthouse": "^6.65", - "orchestra/testbench": "^10.9|^11.0", + "orchestra/testbench": "^11.0", "pestphp/pest": "^4.4", - "worksome/coding-style": "^4.0" + "worksome/coding-style": "^6.0" }, "autoload": { "psr-4": { @@ -67,7 +68,8 @@ "allow-plugins": { "pestphp/pest-plugin": true, "dealerdirect/phpcodesniffer-composer-installer": true, - "worksome/coding-style": true + "worksome/coding-style": true, + "phpstan/extension-installer": true } }, "minimum-stability": "dev", diff --git a/phpstan.neon.dist b/phpstan.neon.dist index cddc118..5e6cbd8 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,5 +1,4 @@ includes: - - ./vendor/worksome/coding-style/larastan.neon - phpstan-baseline.neon parameters: diff --git a/rector.php b/rector.php index 5561c99..84949ab 100644 --- a/rector.php +++ b/rector.php @@ -2,14 +2,10 @@ declare(strict_types=1); -use Rector\Config\RectorConfig; use Worksome\CodingStyle\WorksomeRectorConfig; -return static function (RectorConfig $rectorConfig): void { - WorksomeRectorConfig::setup($rectorConfig); - - $rectorConfig->paths([ +return WorksomeRectorConfig::configure() + ->withPaths([ __DIR__ . '/src', __DIR__ . '/tests', ]); -}; diff --git a/src/Casts/NumberFromCents.php b/src/Casts/NumberFromCents.php index 8f3d74f..d233396 100644 --- a/src/Casts/NumberFromCents.php +++ b/src/Casts/NumberFromCents.php @@ -17,7 +17,7 @@ class NumberFromCents implements CastsAttributes { /** @param class-string $class */ public function __construct( - private string $class = MonetaryAmount::class, + private readonly string $class = MonetaryAmount::class, ) { } diff --git a/src/Casts/NumberFromDecimal.php b/src/Casts/NumberFromDecimal.php index b4473ee..05787d4 100644 --- a/src/Casts/NumberFromDecimal.php +++ b/src/Casts/NumberFromDecimal.php @@ -17,8 +17,8 @@ class NumberFromDecimal implements CastsAttributes { /** @param class-string $class */ public function __construct( - private int $decimals = 2, - private string $class = Number::class, + private readonly int $decimals = 2, + private readonly string $class = Number::class, ) { } diff --git a/src/GraphQL/Scalars/PercentageType.php b/src/GraphQL/Scalars/PercentageType.php index 104941d..68e1243 100644 --- a/src/GraphQL/Scalars/PercentageType.php +++ b/src/GraphQL/Scalars/PercentageType.php @@ -22,8 +22,6 @@ final class PercentageType extends ScalarType /** * @param string|int|float $value * - * @return float - * * @throws Error */ public function serialize($value): float