From 897511d9082fe42efe2d04578863171d8cffe4b7 Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Wed, 2 Sep 2026 11:06:34 +0100 Subject: [PATCH] chore(deps): update to Coding Style 5.x --- .github/workflows/static.yml | 13 +++++++------ .github/workflows/tests.yml | 8 ++++---- composer.json | 6 +++--- rector.php | 16 ++-------------- src/Generator/GeneratorFile.php | 10 +++++----- src/GraphQL/Mutations/CreateExport.php | 4 ++-- src/Processor/EloquentProcessor.php | 2 -- src/Processor/ProcessorData.php | 4 ++-- src/Processor/ProcessorRepository.php | 3 +-- src/Services/CreateExportDTO.php | 16 ++++++++-------- src/Services/UpdateExportDTO.php | 4 ++-- 11 files changed, 36 insertions(+), 50 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index c5dcaf0..34fe543 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@v6 + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 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@v6 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 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 7746634..4baddc9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,13 +24,13 @@ jobs: name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - - name: Checkout code - uses: actions/checkout@v6 + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 with: - php-version: ${{ matrix.php }} + php-version: '8.4' coverage: none - name: Setup problem matchers diff --git a/composer.json b/composer.json index 2ddaa0e..37b0d98 100644 --- a/composer.json +++ b/composer.json @@ -20,9 +20,9 @@ "larastan/larastan": "^3.9", "nunomaduro/collision": "^7.10 || ^8.1.1", "orchestra/testbench": "^10.8 || ^11.0", - "pestphp/pest": "^4.7", - "pestphp/pest-plugin-laravel": "^4.1", - "worksome/coding-style": "^4.0" + "pestphp/pest": "^4.7 || ^5.1", + "pestphp/pest-plugin-laravel": "^4.1 || ^5.0", + "worksome/coding-style": "^5.2" }, "autoload": { "psr-4": { diff --git a/rector.php b/rector.php index e1706e6..84949ab 100644 --- a/rector.php +++ b/rector.php @@ -2,22 +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', ]); - - // Define extra rule sets to be applied - $rectorConfig->sets([ - // SetList::DEAD_CODE, - ]); - - // Register extra a single rules - // $rectorConfig->rule(ClassOnObjectRector::class); -}; diff --git a/src/Generator/GeneratorFile.php b/src/Generator/GeneratorFile.php index ababa56..d2e3f43 100644 --- a/src/Generator/GeneratorFile.php +++ b/src/Generator/GeneratorFile.php @@ -5,11 +5,11 @@ class GeneratorFile { public function __construct( - private string $path, - private int $size, - private string $url, - private int $count, - private string $mimeType, + private readonly string $path, + private readonly int $size, + private readonly string $url, + private readonly int $count, + private readonly string $mimeType, ) { } diff --git a/src/GraphQL/Mutations/CreateExport.php b/src/GraphQL/Mutations/CreateExport.php index 5b32fd0..e10eab3 100644 --- a/src/GraphQL/Mutations/CreateExport.php +++ b/src/GraphQL/Mutations/CreateExport.php @@ -11,8 +11,8 @@ class CreateExport { public function __construct( - private CreateExportService $createExportService, - private ExportValidator $exportValidator, + private readonly CreateExportService $createExportService, + private readonly ExportValidator $exportValidator, ) { } diff --git a/src/Processor/EloquentProcessor.php b/src/Processor/EloquentProcessor.php index 98bf61a..b82e295 100644 --- a/src/Processor/EloquentProcessor.php +++ b/src/Processor/EloquentProcessor.php @@ -25,8 +25,6 @@ abstract class EloquentProcessor implements ProcessorDriver /** * Additional data fields to be included for each record in the export. - * - * @return array */ public function additional($item): array { diff --git a/src/Processor/ProcessorData.php b/src/Processor/ProcessorData.php index d082713..afe66db 100644 --- a/src/Processor/ProcessorData.php +++ b/src/Processor/ProcessorData.php @@ -5,8 +5,8 @@ class ProcessorData { public function __construct( - private array $data, - private string $type, + private readonly array $data, + private readonly string $type, ) { } diff --git a/src/Processor/ProcessorRepository.php b/src/Processor/ProcessorRepository.php index ee2347c..8ba7192 100644 --- a/src/Processor/ProcessorRepository.php +++ b/src/Processor/ProcessorRepository.php @@ -14,7 +14,7 @@ class ProcessorRepository private array $processors = []; public function __construct( - private Container $container, + private readonly Container $container, ) { } @@ -30,7 +30,6 @@ public function get(string $processor): ProcessorDriver } /** - * @param string $processorName * @param class-string $processorClass */ public function register(string $processorName, string $processorClass): void diff --git a/src/Services/CreateExportDTO.php b/src/Services/CreateExportDTO.php index 91e8bdf..998d1ec 100644 --- a/src/Services/CreateExportDTO.php +++ b/src/Services/CreateExportDTO.php @@ -5,14 +5,14 @@ class CreateExportDTO { public function __construct( - private int $userId, - private int $accountId, - private string $accountType, - private string $type, - private string $generatorType, - private array $deliveries, - private array $args, - private int|null $impersonatorId = null, + private readonly int $userId, + private readonly int $accountId, + private readonly string $accountType, + private readonly string $type, + private readonly string $generatorType, + private readonly array $deliveries, + private readonly array $args, + private readonly int|null $impersonatorId = null, ) { } diff --git a/src/Services/UpdateExportDTO.php b/src/Services/UpdateExportDTO.php index ff8d90f..652102a 100644 --- a/src/Services/UpdateExportDTO.php +++ b/src/Services/UpdateExportDTO.php @@ -8,8 +8,8 @@ class UpdateExportDTO { public function __construct( - private Export $export, - private GeneratorFile $generatorFile, + private readonly Export $export, + private readonly GeneratorFile $generatorFile, ) { }