From 5f004bb929d3ad9dabbbf1c9d5ee3da060621f0b Mon Sep 17 00:00:00 2001 From: Shift Date: Wed, 25 Feb 2026 16:49:39 +0000 Subject: [PATCH 1/8] Bump dependencies for Laravel 13 --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 484656c..c469034 100644 --- a/composer.json +++ b/composer.json @@ -20,13 +20,13 @@ "require": { "php": "^7.2.5|^8.0", "guzzlehttp/guzzle": "^7.0", - "illuminate/console": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0", - "illuminate/support": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0" + "illuminate/console": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "illuminate/support": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0" }, "require-dev": { "mockery/mockery": "^0.9|^1.0", - "orchestra/testbench": "^3.5|^4.0|^5.0|^6.0|^8.0|^9.0|^10.0", - "phpunit/phpunit": "^7.0|^8.5|^9.3|^10.5|^11.5.3" + "orchestra/testbench": "^3.5|^4.0|^5.0|^6.0|^8.0|^9.0|^10.0|^11.0", + "phpunit/phpunit": "^7.0|^8.5|^9.3|^10.5|^11.5.3|^12.5.12" }, "autoload": { "psr-4": { From 6b2523f9e9d619771f2fe6d8159a4b4b8b4dd4ab Mon Sep 17 00:00:00 2001 From: Shift Date: Wed, 25 Feb 2026 16:49:39 +0000 Subject: [PATCH 2/8] Update GitHub Actions for Laravel 13 --- .github/workflows/tests-php7.yml | 15 ++++++++++++--- .github/workflows/tests-php8.yml | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests-php7.yml b/.github/workflows/tests-php7.yml index b483b61..22ca543 100644 --- a/.github/workflows/tests-php7.yml +++ b/.github/workflows/tests-php7.yml @@ -11,8 +11,8 @@ jobs: strategy: fail-fast: false matrix: - php: [7.2, 7.3, 7.4] - laravel: ["5.5.*", "5.6.*", "5.7.*", "5.8.*", ^6.0, ^7.0, ^8.0] + php: ['7.2', '7.3', '7.4', '8.3', '8.4', '8.5'] + laravel: ['5.5.*', '5.6.*', '5.7.*', '5.8.*', '13.*', ^6.0, ^7.0, ^8.0] include: - laravel: 5.5.* testbench: ^3.5 @@ -35,6 +35,9 @@ jobs: - laravel: ^8.0 testbench: ^6.0 phpunit: 9.3 + - laravel: 13.* + testbench: ^11.0 + phpunit: '8.3' exclude: - laravel: 5.5.* php: 7.4 @@ -46,6 +49,12 @@ jobs: php: 7.4 - laravel: ^8.0 php: 7.2 + - laravel: 13.* + php: '7.2' + - laravel: 13.* + php: '7.3' + - laravel: 13.* + php: '7.4' name: P${{ matrix.php }} - L${{ matrix.laravel }} @@ -88,7 +97,7 @@ jobs: composer update --prefer-dist --no-interaction --no-progress - name: Setup PCOV - if: "${{ matrix.phpunit < 8 }}" + if: ${{ matrix.phpunit < 8 }} run: | composer require pcov/clobber vendor/bin/pcov clobber diff --git a/.github/workflows/tests-php8.yml b/.github/workflows/tests-php8.yml index c6a3773..05f6f79 100644 --- a/.github/workflows/tests-php8.yml +++ b/.github/workflows/tests-php8.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: php: [8.4, 8.3, 8.2, 8.1, 8.0] - laravel: [^12.0, ^11.0, ^10.0, ^9.0, ^8.0, ^7.0, ^6.0] + laravel: [^6.0, ^7.0, ^8.0, ^9.0, ^10.0, ^11.0, ^12.0, ^13.0] include: - laravel: ^6.0 testbench: ^4.0 @@ -26,8 +26,10 @@ jobs: testbench: ^8.0 - laravel: ^11.0 testbench: ^9.0 - - laravel: "12.0" + - laravel: '12.0' testbench: ^10.0 + - laravel: ^13.0 + testbench: ^11.0 exclude: - laravel: ^6.0 php: 8.1 @@ -61,10 +63,16 @@ jobs: php: 8.0 - laravel: ^11.0 php: 8.1 - - laravel: "12.0" + - laravel: '12.0' php: 8.0 - - laravel: "12.0" + - laravel: '12.0' php: 8.1 + - laravel: ^13.0 + php: 8.2 + - laravel: ^13.0 + php: 8.1 + - laravel: ^13.0 + php: 8.0 name: P${{ matrix.php }} - L${{ matrix.laravel }} From 1de052b2afa9688ea2cf8317c1dc20c939b6abd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nikolaou?= Date: Wed, 3 Jun 2026 18:37:36 +0300 Subject: [PATCH 3/8] Drop support for PHP 7.x --- .github/workflows/tests-php7.yml | 111 ------------------ .../workflows/{tests-php8.yml => tests.yml} | 6 +- .gitignore | 2 +- CHANGELOG.md | 6 + README.md | 6 +- composer.json | 12 +- tests/BlockIpCommandTest.php | 40 ++----- tests/ClientTest.php | 17 +-- tests/CollectionTest.php | 13 +- tests/PurgeCommandTest.php | 47 +++----- tests/ServiceProviderTest.php | 37 ++---- tests/TestCase.php | 6 +- 12 files changed, 65 insertions(+), 238 deletions(-) delete mode 100644 .github/workflows/tests-php7.yml rename .github/workflows/{tests-php8.yml => tests.yml} (97%) diff --git a/.github/workflows/tests-php7.yml b/.github/workflows/tests-php7.yml deleted file mode 100644 index 22ca543..0000000 --- a/.github/workflows/tests-php7.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: Tests php 7.x - -on: - push: - pull_request: - -jobs: - tests: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - php: ['7.2', '7.3', '7.4', '8.3', '8.4', '8.5'] - laravel: ['5.5.*', '5.6.*', '5.7.*', '5.8.*', '13.*', ^6.0, ^7.0, ^8.0] - include: - - laravel: 5.5.* - testbench: ^3.5 - phpunit: 6.0 - - laravel: 5.6.* - testbench: ^3.6 - phpunit: 7.0 - - laravel: 5.7.* - testbench: ^3.7 - phpunit: 7.0 - - laravel: 5.8.* - testbench: ^3.8 - phpunit: 7.5 - - laravel: ^6.0 - testbench: ^4.0 - phpunit: 8.5 - - laravel: ^7.0 - testbench: ^5.0 - phpunit: 8.5 - - laravel: ^8.0 - testbench: ^6.0 - phpunit: 9.3 - - laravel: 13.* - testbench: ^11.0 - phpunit: '8.3' - exclude: - - laravel: 5.5.* - php: 7.4 - - laravel: 5.6.* - php: 7.3 - - laravel: 5.6.* - php: 7.4 - - laravel: 5.7.* - php: 7.4 - - laravel: ^8.0 - php: 7.2 - - laravel: 13.* - php: '7.2' - - laravel: 13.* - php: '7.3' - - laravel: 13.* - php: '7.4' - - name: P${{ matrix.php }} - L${{ matrix.laravel }} - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip - tools: composer:v2 - coverage: pcov - - - name: Setup problem matchers for PHP - run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - - name: Setup problem matchers for PHPUnit - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: Get composer cache directory - id: composer-cache - run: | - echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer- - - - name: Install dependencies - run: | - composer config --no-plugins allow-plugins.kylekatarnls/update-helper true - composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "phpunit/phpunit:^${{ matrix.phpunit }}" --no-interaction --no-update - composer update --prefer-dist --no-interaction --no-progress - - - name: Setup PCOV - if: ${{ matrix.phpunit < 8 }} - run: | - composer require pcov/clobber - vendor/bin/pcov clobber - - - name: Execute tests - run: vendor/bin/phpunit --verbose --whitelist=src --coverage-clover=build/coverage/clover.xml - - - name: Upload coverage - uses: sudo-bot/action-scrutinizer@latest - with: - cli-args: --format=php-clover build/coverage/clover.xml diff --git a/.github/workflows/tests-php8.yml b/.github/workflows/tests.yml similarity index 97% rename from .github/workflows/tests-php8.yml rename to .github/workflows/tests.yml index 05f6f79..827c905 100644 --- a/.github/workflows/tests-php8.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Tests php 8.x +name: Tests on: push: @@ -78,7 +78,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -102,7 +102,7 @@ jobs: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/.gitignore b/.gitignore index a37a26a..2ee24d4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ build composer.lock vendor phpunit.xml -.phpunit.result.cache +.phpunit.cache diff --git a/CHANGELOG.md b/CHANGELOG.md index d6ec61f..c57f3ca 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to `artisan-cloudflare` will be documented in this file. +## 2.9.0 - 2026-06-03 + +- Laravel 13.x Compatibility [#28](https://github.com/sebdesign/artisan-cloudflare/pull/28) +- Drop support for PHP 7.x +- Drop support for Laravel 5.x + ## 2.8.0 - 2025-02-20 - Laravel 12.x Compatibility [#27](https://github.com/sebdesign/artisan-cloudflare/pull/27) diff --git a/README.md b/README.md index dd8c051..24d45cf 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Latest Version on Packagist](https://img.shields.io/packagist/v/sebdesign/artisan-cloudflare.svg?style=flat-square)](https://packagist.org/packages/sebdesign/artisan-cloudflare) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) -[![Build Status](https://img.shields.io/github/workflow/status/sebdesign/artisan-cloudflare/Tests/master?style=flat-square)](https://github.com/sebdesign/artisan-cloudflare/actions) +[![Build Status](https://img.shields.io/github/actions/workflow/status/sebdesign/artisan-cloudflare/tests.yml?branch=master&style=flat-square)](https://github.com/sebdesign/artisan-cloudflare/actions) [![Quality Score](https://img.shields.io/scrutinizer/g/sebdesign/artisan-cloudflare.svg?style=flat-square)](https://scrutinizer-ci.com/g/sebdesign/artisan-cloudflare) [![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/sebdesign/artisan-cloudflare.svg?style=flat-square)](https://scrutinizer-ci.com/g/sebdesign/artisan-cloudflare) [![StyleCI](https://styleci.io/repos/74228812/shield?style=flat-square)](https://styleci.io/repos/74228812) @@ -13,13 +13,13 @@ Laravel artisan commands for interacting with the CloudFlare API. ## Installation -You can install the package via composer. This package requires Laravel 5.5 or higher. +You can install the package via composer. This package requires Laravel 6.0 or higher. ``` bash composer require sebdesign/artisan-cloudflare ``` -Since version 5.5, Laravel uses package auto-discovery, so doesn't require you to manually add the ServiceProvider. If you don't use auto-discovery or you are using an older version, add the service provider in `config/app.php`. +Since version 5.5, Laravel uses package auto-discovery, so doesn't require you to manually add the ServiceProvider. If you don't use auto-discovery, add the service provider in `config/app.php`. ``` php mockClient(); } - /** - * @test - */ + #[Test] public function it_fails_if_no_zone_identifier_is_found(): void { // Arrange @@ -40,9 +40,7 @@ public function it_fails_if_no_zone_identifier_is_found(): void ->withoutSuccessCode(); } - /** - * @test - */ + #[Test] public function it_fails_if_ip_is_not_valid(): void { // Act @@ -57,9 +55,7 @@ public function it_fails_if_ip_is_not_valid(): void ->withoutSuccessCode(); } - /** - * @test - */ + #[Test] public function it_outputs_an_error_if_the_api_throws_an_exception(): void { // Arrange @@ -83,9 +79,7 @@ public function it_outputs_an_error_if_the_api_throws_an_exception(): void ->withoutSuccessCode(); } - /** - * @test - */ + #[Test] public function it_outputs_an_error_if_the_api_returns_an_error(): void { // Arrange @@ -115,9 +109,7 @@ public function it_outputs_an_error_if_the_api_returns_an_error(): void ->withoutSuccessCode(); } - /** - * @test - */ + #[Test] public function it_runs_without_zone_argument(): void { // Arrange @@ -156,9 +148,7 @@ public function it_runs_without_zone_argument(): void ->withSuccessCode(); } - /** - * @test - */ + #[Test] public function it_runs_with_ipv6_address(): void { // Arrange @@ -190,9 +180,7 @@ public function it_runs_with_ipv6_address(): void ->withSuccessCode(); } - /** - * @test - */ + #[Test] public function it_runs_with_notes_argument(): void { // Arrange @@ -223,9 +211,7 @@ public function it_runs_with_notes_argument(): void ->withSuccessCode(); } - /** - * @test - */ + #[Test] public function it_accepts_an_existing_zone(): void { // Arrange @@ -257,9 +243,7 @@ public function it_accepts_an_existing_zone(): void ->withSuccessCode(); } - /** - * @test - */ + #[Test] public function it_accepts_a_custom_zone(): void { // Arrange @@ -287,7 +271,7 @@ public function it_accepts_a_custom_zone(): void $this->seeInConsole('my-zone') ->dontSeeInConsole('zone-identifier') - ->SeeInConsole('6.6.6.6') + ->seeInConsole('6.6.6.6') ->withSuccessCode(); } } diff --git a/tests/ClientTest.php b/tests/ClientTest.php index aa212d1..9cabea4 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -3,6 +3,7 @@ namespace Sebdesign\ArtisanCloudflare\Test; use Illuminate\Support\Collection; +use PHPUnit\Framework\Attributes\Test; use Sebdesign\ArtisanCloudflare\Client; use Sebdesign\ArtisanCloudflare\Zone; @@ -20,9 +21,7 @@ public function setUp(): void $this->mockClient(); } - /** - * @test - */ + #[Test] public function it_purges_a_zone_with_success(): void { // Arrange @@ -45,9 +44,7 @@ public function it_purges_a_zone_with_success(): void $this->assertEquals(new Zone(['success' => true]), $results->get('foo')); } - /** - * @test - */ + #[Test] public function it_blocks_ip_address_with_success(): void { // Arrange @@ -70,9 +67,7 @@ public function it_blocks_ip_address_with_success(): void $this->assertEquals(new Zone(['success' => true]), $results->get('foo')); } - /** - * @test - */ + #[Test] public function it_handles_client_errors(): void { // Arrange @@ -98,9 +93,7 @@ public function it_handles_client_errors(): void ]), $results->get('foo')); } - /** - * @test - */ + #[Test] public function it_handles_server_errors(): void { // Arrange diff --git a/tests/CollectionTest.php b/tests/CollectionTest.php index c264822..8866f33 100644 --- a/tests/CollectionTest.php +++ b/tests/CollectionTest.php @@ -3,6 +3,7 @@ namespace Sebdesign\ArtisanCloudflare\Test; use Illuminate\Support\Collection; +use PHPUnit\Framework\Attributes\Test; class CollectionTest extends TestCase { @@ -13,9 +14,7 @@ public function setUp(): void $this->registerServiceProvider(); } - /** - * @test - */ + #[Test] public function it_transposes_a_collection(): void { // Arrange @@ -65,9 +64,7 @@ public function it_transposes_a_collection(): void $this->assertEquals(Collection::make($expected), $actual); } - /** - * @test - */ + #[Test] public function it_inserts_a_value_between_items(): void { // Arrange @@ -95,9 +92,7 @@ public function it_inserts_a_value_between_items(): void $this->assertEquals(Collection::make($expected), $actual); } - /** - * @test - */ + #[Test] public function it_reorders_a_collection(): void { // Arrange diff --git a/tests/PurgeCommandTest.php b/tests/PurgeCommandTest.php index a8d5a77..a0f3371 100644 --- a/tests/PurgeCommandTest.php +++ b/tests/PurgeCommandTest.php @@ -2,6 +2,8 @@ namespace Sebdesign\ArtisanCloudflare\Test; +use PHPUnit\Framework\Attributes\Test; + class PurgeCommandTest extends TestCase { use ConsoleHelpers, GuzzleHelpers; @@ -16,9 +18,7 @@ public function setUp(): void $this->mockClient(); } - /** - * @test - */ + #[Test] public function it_fails_if_no_zone_identifier_is_found(): void { // Arrange @@ -37,9 +37,7 @@ public function it_fails_if_no_zone_identifier_is_found(): void ->withoutSuccessCode(); } - /** - * @test - */ + #[Test] public function it_outputs_an_error_if_the_api_throws_an_exception(): void { // Arrange @@ -63,9 +61,7 @@ public function it_outputs_an_error_if_the_api_throws_an_exception(): void ->withoutSuccessCode(); } - /** - * @test - */ + #[Test] public function it_outputs_an_error_if_the_api_returns_an_error(): void { // Arrange @@ -95,9 +91,7 @@ public function it_outputs_an_error_if_the_api_returns_an_error(): void ->withoutSuccessCode(); } - /** - * @test - */ + #[Test] public function it_runs_without_arguments_and_options(): void { // Arrange @@ -131,9 +125,7 @@ public function it_runs_without_arguments_and_options(): void ->withSuccessCode(); } - /** - * @test - */ + #[Test] public function it_accepts_an_existing_zone(): void { // Arrange @@ -159,9 +151,7 @@ public function it_accepts_an_existing_zone(): void ->withSuccessCode(); } - /** - * @test - */ + #[Test] public function it_accepts_a_custom_zone(): void { // Arrange @@ -188,9 +178,7 @@ public function it_accepts_a_custom_zone(): void ->withSuccessCode(); } - /** - * @test - */ + #[Test] public function it_accepts_files(): void { // Arrange @@ -224,9 +212,7 @@ public function it_accepts_files(): void ->withSuccessCode(); } - /** - * @test - */ + #[Test] public function it_accepts_tags(): void { // Arrange @@ -260,9 +246,7 @@ public function it_accepts_tags(): void ->withSuccessCode(); } - /** - * @test - */ + #[Test] public function it_accepts_hosts(): void { // Arrange @@ -296,9 +280,7 @@ public function it_accepts_hosts(): void ->withSuccessCode(); } - /** - * @test - */ + #[Test] public function it_accepts_files_and_tags_and_hosts(): void { // Arrange @@ -342,9 +324,8 @@ public function it_accepts_files_and_tags_and_hosts(): void ->withSuccessCode(); } - /** - * @test - */ + + #[Test] public function it_accepts_a_zone_with_files_and_files_and_tags(): void { // Arrange diff --git a/tests/ServiceProviderTest.php b/tests/ServiceProviderTest.php index 7e5c00f..3b21e44 100644 --- a/tests/ServiceProviderTest.php +++ b/tests/ServiceProviderTest.php @@ -2,15 +2,14 @@ namespace Sebdesign\ArtisanCloudflare\Test; +use PHPUnit\Framework\Attributes\Test; use Sebdesign\ArtisanCloudflare\Client; use Sebdesign\ArtisanCloudflare\Commands\Cache\Purge; use Sebdesign\ArtisanCloudflare\ServiceProvider; class ServiceProviderTest extends TestCase { - /** - * @test - */ + #[Test] public function it_publishes_the_configuration(): void { // Act @@ -24,9 +23,7 @@ public function it_publishes_the_configuration(): void $this->assertFileExists($path); } - /** - * @test - */ + #[Test] public function it_merges_the_configuration(): void { // Arrange @@ -46,9 +43,7 @@ public function it_merges_the_configuration(): void $this->assertEquals($this->app['config']['cloudflare'], $config); } - /** - * @test - */ + #[Test] public function is_deferred(): void { // Act @@ -63,9 +58,7 @@ public function is_deferred(): void ); } - /** - * @test - */ + #[Test] public function it_registers_the_api_wrapper(): void { // Arrange @@ -85,9 +78,7 @@ public function it_registers_the_api_wrapper(): void $this->assertEquals(Client::BASE_URI, $base_uri); } - /** - * @test - */ + #[Test] public function it_authenticates_with_an_api_token(): void { // Arrange @@ -107,9 +98,7 @@ public function it_authenticates_with_an_api_token(): void $this->assertEquals('Bearer API_TOKEN', $headers['Authorization']); } - /** - * @test - */ + #[Test] public function it_authenticates_with_an_api_key(): void { // Arrange @@ -133,9 +122,7 @@ public function it_authenticates_with_an_api_key(): void $this->assertEquals('email@example.com', $headers['X-Auth-Email']); } - /** - * @test - */ + #[Test] public function it_registers_the_purge_command(): void { // Arrange @@ -151,9 +138,7 @@ public function it_registers_the_purge_command(): void $this->assertInstanceOf(Purge::class, $command); } - /** - * @test - */ + #[Test] public function it_provides_the_api_client(): void { $provider = new ServiceProvider($this->app); @@ -161,9 +146,7 @@ public function it_provides_the_api_client(): void $this->assertContains(Client::class, $provider->provides()); } - /** - * @test - */ + #[Test] public function it_provides_the_purge_command(): void { $provider = new ServiceProvider($this->app); diff --git a/tests/TestCase.php b/tests/TestCase.php index 6c15580..917e6d6 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -48,10 +48,6 @@ protected function getEnvironmentSetUp($app) */ protected function registerServiceProvider() { - if (version_compare($this->app->version(), '5.7.0', '>=')) { - $this->app->register(new ServiceProvider($this->app), true); - } else { - $this->app->register(new ServiceProvider($this->app), [], true); - } + $this->app->register(new ServiceProvider($this->app), true); } } From c308ed7e82b5e7f19b6f72cc0841b1268716d6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nikolaou?= Date: Wed, 3 Jun 2026 18:45:03 +0300 Subject: [PATCH 4/8] Replace style.ci with pint --- .gitattributes | 2 +- .github/workflows/lint.yml | 25 +++++++++++++++++++++++++ .styleci.yml | 7 ------- README.md | 1 - composer.json | 5 ++++- pint.json | 4 ++++ src/Client.php | 27 ++++++++++++++------------- src/Commands/Cache/Purge.php | 26 ++++++++++++-------------- src/Commands/Waf/BlockIP.php | 32 +++++++++++--------------------- src/ServiceProvider.php | 3 ++- tests/BlockIpCommandTest.php | 4 +--- tests/ClientTest.php | 2 +- tests/CollectionTest.php | 2 +- tests/GuzzleHelpers.php | 9 +++++---- tests/PurgeCommandTest.php | 3 +-- tests/TestCase.php | 5 +++-- 16 files changed, 85 insertions(+), 72 deletions(-) create mode 100644 .github/workflows/lint.yml delete mode 100644 .styleci.yml create mode 100644 pint.json diff --git a/.gitattributes b/.gitattributes index 38bf01a..063f322 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,7 +6,7 @@ /.gitattributes export-ignore /.gitignore export-ignore /.scrutinizer.yml export-ignore -/.styleci.yml export-ignore /.travis.yml export-Ignore +/pint.json export-ignore /phpunit.xml.dist export-ignore /tests export-ignore diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..eb70f65 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +name: Lint + +on: + push: + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.4 + tools: composer:v2 + + - name: Install dependencies + run: composer update --prefer-dist --no-interaction --no-progress + + - name: Lint with Pint + run: vendor/bin/pint --test diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index 820e5e3..0000000 --- a/.styleci.yml +++ /dev/null @@ -1,7 +0,0 @@ -preset: laravel - -risky: try - -disabled: - - single_class_element_per_statement - - self_accessor diff --git a/README.md b/README.md index 24d45cf..023b61c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ [![Build Status](https://img.shields.io/github/actions/workflow/status/sebdesign/artisan-cloudflare/tests.yml?branch=master&style=flat-square)](https://github.com/sebdesign/artisan-cloudflare/actions) [![Quality Score](https://img.shields.io/scrutinizer/g/sebdesign/artisan-cloudflare.svg?style=flat-square)](https://scrutinizer-ci.com/g/sebdesign/artisan-cloudflare) [![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/sebdesign/artisan-cloudflare.svg?style=flat-square)](https://scrutinizer-ci.com/g/sebdesign/artisan-cloudflare) -[![StyleCI](https://styleci.io/repos/74228812/shield?style=flat-square)](https://styleci.io/repos/74228812) Laravel artisan commands for interacting with the CloudFlare API. diff --git a/composer.json b/composer.json index 4df356c..b0e8730 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0" }, "require-dev": { + "laravel/pint": "^1.21", "mockery/mockery": "^0.9|^1.0", "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", "phpunit/phpunit": "^10.5|^11.5.3|^12.5.12" @@ -40,7 +41,9 @@ }, "scripts": { "test": "vendor/bin/phpunit", - "test-coverage": "vendor/bin/phpunit --coverage-html coverage" + "test-coverage": "vendor/bin/phpunit --coverage-html coverage", + "lint": "vendor/bin/pint --test", + "format": "vendor/bin/pint" }, "config": { "sort-packages": true diff --git a/pint.json b/pint.json new file mode 100644 index 0000000..4ee3110 --- /dev/null +++ b/pint.json @@ -0,0 +1,4 @@ +{ + "preset": "laravel", + "rules": {} +} \ No newline at end of file diff --git a/src/Client.php b/src/Client.php index 499c1d1..ab2ff55 100644 --- a/src/Client.php +++ b/src/Client.php @@ -7,6 +7,7 @@ use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Promise\Each; use GuzzleHttp\Promise\PromiseInterface; +use GuzzleHttp\RequestOptions; use Illuminate\Support\Collection; use Psr\Http\Message\ResponseInterface; use Psr\Log\LoggerInterface; @@ -19,12 +20,12 @@ class Client const BASE_URI = 'https://api.cloudflare.com/client/v4/'; /** - * @var \GuzzleHttp\Client + * @var GuzzleClient */ protected $client; /** - * @var \Psr\Log\LoggerInterface + * @var LoggerInterface */ protected $logger; @@ -45,8 +46,8 @@ public function __construct(GuzzleClient $client, LoggerInterface $logger) * The promise waits until all the promises have been resolved or rejected * and returns the results of each request. * - * @param \Illuminate\Support\Collection $zones - * @return \Illuminate\Support\Collection + * @param Collection $zones + * @return Collection */ public function purge(Collection $zones): Collection { @@ -60,14 +61,14 @@ public function purge(Collection $zones): Collection /** * Block the given IP address. * - * @param \Illuminate\Support\Collection $zones - * @return \Illuminate\Support\Collection + * @param Collection $zones + * @return Collection */ public function blockIP($zones): Collection { return $zones->map(function (Zone $zone, $identifier) { return $this->client->postAsync("zones/{$identifier}/firewall/access_rules/rules", [ - \GuzzleHttp\RequestOptions::JSON => $zone, + RequestOptions::JSON => $zone, ]); })->pipe(function ($promises) { return $this->settle($promises); @@ -77,7 +78,7 @@ public function blockIP($zones): Collection protected function delete(string $identifier, Zone $zone): PromiseInterface { return $this->client->deleteAsync("zones/{$identifier}/purge_cache", [ - \GuzzleHttp\RequestOptions::JSON => $zone, + RequestOptions::JSON => $zone, ]); } @@ -87,11 +88,11 @@ protected function delete(string $identifier, Zone $zone): PromiseInterface * * The returned promise is fulfilled with a collection of results. * - * @param \Illuminate\Support\Collection $promises + * @param Collection $promises */ protected function settle(Collection $promises): PromiseInterface { - $results = new Collection(); + $results = new Collection; return Each::of( $promises->getIterator(), @@ -105,7 +106,7 @@ protected function settle(Collection $promises): PromiseInterface /** * Put the body of the fulfilled promise into the results. * - * @param \Illuminate\Support\Collection $results + * @param Collection $results * @return \Closure */ protected function onFulfilled(Collection $results) @@ -123,7 +124,7 @@ protected function onFulfilled(Collection $results) /** * Handle the rejected promise and put the errors into the results. * - * @param \Illuminate\Support\Collection $results + * @param Collection $results * @return \Closure */ protected function onRejected(Collection $results) @@ -149,7 +150,7 @@ protected function onRejected(Collection $results) protected function handleException(RequestException $e): Zone { if ($e->hasResponse()) { - /** @var \Psr\Http\Message\ResponseInterface $response */ + /** @var ResponseInterface $response */ $response = $e->getResponse(); if ($e instanceof ClientException) { diff --git a/src/Commands/Cache/Purge.php b/src/Commands/Cache/Purge.php index 4f03397..8768be3 100644 --- a/src/Commands/Cache/Purge.php +++ b/src/Commands/Cache/Purge.php @@ -38,14 +38,14 @@ class Purge extends Command /** * CloudFlare API client. * - * @var \Sebdesign\ArtisanCloudflare\Client + * @var Client */ private $client; /** * API item identifier tags. * - * @var \Illuminate\Support\Collection + * @var Collection */ private $zones; @@ -64,7 +64,6 @@ public function __construct(array $zones) /** * Execute the console command. * - * @param \Sebdesign\ArtisanCloudflare\Client $client * @return int */ public function handle(Client $client) @@ -93,8 +92,8 @@ public function handle(Client $client) * * Use the config for each zone, unless options are passed in the command. * - * @param \Illuminate\Support\Collection $zones - * @return \Illuminate\Support\Collection + * @param Collection $zones + * @return Collection */ private function applyParameters(Collection $zones): Collection { @@ -116,8 +115,8 @@ private function applyParameters(Collection $zones): Collection /** * Execute the purging operations and return each result. * - * @param \Illuminate\Support\Collection $zones - * @return \Illuminate\Support\Collection + * @param Collection $zones + * @return Collection */ private function purge(Collection $zones): Collection { @@ -129,9 +128,8 @@ private function purge(Collection $zones): Collection /** * Display a table with the results. * - * @param \Illuminate\Support\Collection $zones - * @param \Illuminate\Support\Collection $results - * @return void + * @param Collection $zones + * @param Collection $results */ private function displayResults(Collection $zones, Collection $results): void { @@ -183,7 +181,7 @@ private function displayResults(Collection $zones, Collection $results): void 'errors' => $errors, ]); - $rows = $columns->_transpose()->insertBetween(new TableSeparator()); + $rows = $columns->_transpose()->insertBetween(new TableSeparator); $this->table([$title, $headers], $rows); } @@ -216,7 +214,7 @@ private function formatErrors(array $errors): array /** * Get the zone identifier from the input argument or the configuration. * - * @return \Illuminate\Support\Collection + * @return Collection */ private function getZones(): Collection { @@ -231,14 +229,14 @@ private function getZones(): Collection } return new Collection([ - $zone => new Zone(), + $zone => new Zone, ]); } /** * Return 1 if all successes are false, otherwise return 0. * - * @param \Illuminate\Support\Collection $results + * @param Collection $results */ private function getExitCode(Collection $results): int { diff --git a/src/Commands/Waf/BlockIP.php b/src/Commands/Waf/BlockIP.php index 1a760b9..5c28274 100644 --- a/src/Commands/Waf/BlockIP.php +++ b/src/Commands/Waf/BlockIP.php @@ -37,21 +37,19 @@ class BlockIP extends Command /** * CloudFlare API client. * - * @var \Sebdesign\ArtisanCloudflare\Client + * @var Client */ private $client; /** * API item identifier tags. * - * @var \Illuminate\Support\Collection + * @var Collection */ private $zones; /** * Purge constructor. - * - * @param array $zones */ public function __construct(array $zones) { @@ -65,7 +63,6 @@ public function __construct(array $zones) /** * Execute the console command. * - * @param \Sebdesign\ArtisanCloudflare\Client $client * @return int */ public function handle(Client $client) @@ -104,9 +101,9 @@ public function handle(Client $client) * * Use the config for each zone, unless options are passed in the command. * - * @param \Illuminate\Support\Collection $zones + * @param Collection $zones * @param string $target - * @return \Illuminate\Support\Collection + * @return Collection */ private function applyParameters($zones, $target): Collection { @@ -127,7 +124,7 @@ private function applyParameters($zones, $target): Collection /** * Block the given IP address. * - * @param \Illuminate\Support\Collection $zones + * @param Collection $zones */ private function block($zones): Collection { @@ -137,9 +134,8 @@ private function block($zones): Collection /** * Display a table with the results. * - * @param \Illuminate\Support\Collection $zones - * @param \Illuminate\Support\Collection $results - * @return void + * @param Collection $zones + * @param Collection $results */ private function displayResults($zones, $results): void { @@ -179,16 +175,13 @@ private function displayResults($zones, $results): void 'errors' => $errors, ]); - $rows = $columns->_transpose()->insertBetween(new TableSeparator()); + $rows = $columns->_transpose()->insertBetween(new TableSeparator); $this->table([$title, $headers], $rows); } /** * Format an array into a multiline string. - * - * @param array $items - * @return string */ private function formatItems(array $items): string { @@ -215,7 +208,7 @@ private function formatErrors(array $errors): array /** * Get the zone identifier from the input argument or the configuration. * - * @return \Illuminate\Support\Collection + * @return Collection */ private function getZones(): Collection { @@ -230,15 +223,14 @@ private function getZones(): Collection } return new Collection([ - $zone => new Zone(), + $zone => new Zone, ]); } /** * Return 1 if all successes are false, otherwise return 0. * - * @param \Illuminate\Support\Collection $results - * @return int + * @param Collection $results */ private function getExitCode($results): int { @@ -251,7 +243,6 @@ private function getExitCode($results): int * Check if the given IP address is IPv4. * * @param string $ip - * @return bool */ private function isIPv4($ip): bool { @@ -262,7 +253,6 @@ private function isIPv4($ip): bool * Check if the given IP address is IPv6. * * @param string $ip - * @return bool */ private function isIPv6($ip): bool { diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 6b74fbe..8417134 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -3,6 +3,7 @@ namespace Sebdesign\ArtisanCloudflare; use GuzzleHttp\Client as GuzzleClient; +use GuzzleHttp\RequestOptions; use Illuminate\Support\Collection; use Illuminate\Support\ServiceProvider as IlluminateServiceProvider; @@ -52,7 +53,7 @@ protected function bootGuzzleClient(): GuzzleClient return new GuzzleClient([ 'base_uri' => Client::BASE_URI, - \GuzzleHttp\RequestOptions::HEADERS => $authorization, + RequestOptions::HEADERS => $authorization, ]); } diff --git a/tests/BlockIpCommandTest.php b/tests/BlockIpCommandTest.php index fa46c33..ce14e0d 100644 --- a/tests/BlockIpCommandTest.php +++ b/tests/BlockIpCommandTest.php @@ -11,10 +11,8 @@ class BlockIpCommandTest extends TestCase /** * Setup the test environment. - * - * @return void */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 9cabea4..43f39dc 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -14,7 +14,7 @@ class ClientTest extends TestCase /** * Setup the test environment. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/CollectionTest.php b/tests/CollectionTest.php index 8866f33..75c5dd6 100644 --- a/tests/CollectionTest.php +++ b/tests/CollectionTest.php @@ -7,7 +7,7 @@ class CollectionTest extends TestCase { - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/GuzzleHelpers.php b/tests/GuzzleHelpers.php index 9768545..888e4a2 100644 --- a/tests/GuzzleHelpers.php +++ b/tests/GuzzleHelpers.php @@ -9,6 +9,7 @@ use GuzzleHttp\Middleware; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; +use GuzzleHttp\RequestOptions; use Illuminate\Support\Collection; use PHPUnit\Framework\Constraint\StringContains; use Sebdesign\ArtisanCloudflare\Client; @@ -18,12 +19,12 @@ trait GuzzleHelpers /** * Transactions container. * - * @var \Illuminate\Support\Collection + * @var Collection */ protected $transactions; /** - * @var \GuzzleHttp\Handler\MockHandler + * @var MockHandler */ protected $handler; @@ -55,7 +56,7 @@ protected function seeRequestWithBody(array $transaction, array $body): self protected function mockClient(): void { // Attach a mock handler to the handler stack. - $this->handler = new MockHandler(); + $this->handler = new MockHandler; $stack = HandlerStack::create($this->handler); // Attach the transaction history to the handler stack. @@ -66,7 +67,7 @@ protected function mockClient(): void $guzzle = new GuzzleClient([ 'handler' => $stack, 'base_uri' => Client::BASE_URI, - \GuzzleHttp\RequestOptions::HEADERS => [ + RequestOptions::HEADERS => [ 'X-Auth-Key' => $this->app['config']['cloudflare.key'], 'X-Auth-Email' => $this->app['config']['cloudflare.email'], ], diff --git a/tests/PurgeCommandTest.php b/tests/PurgeCommandTest.php index a0f3371..f1d5c97 100644 --- a/tests/PurgeCommandTest.php +++ b/tests/PurgeCommandTest.php @@ -11,7 +11,7 @@ class PurgeCommandTest extends TestCase /** * Setup the test environment. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); @@ -324,7 +324,6 @@ public function it_accepts_files_and_tags_and_hosts(): void ->withSuccessCode(); } - #[Test] public function it_accepts_a_zone_with_files_and_files_and_tags(): void { diff --git a/tests/TestCase.php b/tests/TestCase.php index 917e6d6..c00915c 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,6 +2,7 @@ namespace Sebdesign\ArtisanCloudflare\Test; +use Illuminate\Foundation\Application; use Orchestra\Testbench\TestCase as BaseTestCase; use Sebdesign\ArtisanCloudflare\ServiceProvider; @@ -10,7 +11,7 @@ abstract class TestCase extends BaseTestCase /** * Get package providers. * - * @param \Illuminate\Foundation\Application $app + * @param Application $app * @return array */ protected function getPackageProviders($app) @@ -21,7 +22,7 @@ protected function getPackageProviders($app) /** * Define environment setup. * - * @param \Illuminate\Foundation\Application $app + * @param Application $app * @return void */ protected function getEnvironmentSetUp($app) From 0ee83508722815b5c5062968b5cc7d1aba31b7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nikolaou?= Date: Wed, 3 Jun 2026 18:52:23 +0300 Subject: [PATCH 5/8] Fix workflows --- .github/workflows/lint.yml | 4 +++- .github/workflows/tests.yml | 6 +++++- composer.json | 3 +-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index eb70f65..0c3632c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,9 @@ jobs: tools: composer:v2 - name: Install dependencies - run: composer update --prefer-dist --no-interaction --no-progress + run: | + composer update --prefer-dist --no-interaction --no-progress + composer require --dev laravel/pint --no-interaction --no-progress - name: Lint with Pint run: vendor/bin/pint --test diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 827c905..b10bea3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,12 +16,16 @@ jobs: include: - laravel: ^6.0 testbench: ^4.0 + phpunit: ^9.3 - laravel: ^7.0 testbench: ^5.0 + phpunit: ^9.3 - laravel: ^8.0 testbench: ^6.0 + phpunit: ^9.3 - laravel: ^9.0 testbench: ^7.0 + phpunit: ^10.5 - laravel: ^10.0 testbench: ^8.0 - laravel: ^11.0 @@ -111,7 +115,7 @@ jobs: - name: Install dependencies run: | composer config --no-plugins allow-plugins.kylekatarnls/update-helper true - composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" ${{ matrix.phpunit && format('"phpunit/phpunit:{0}"', matrix.phpunit) || '' }} --no-interaction --no-update composer update --prefer-dist --no-interaction --no-progress - name: Execute tests diff --git a/composer.json b/composer.json index b0e8730..1f58496 100644 --- a/composer.json +++ b/composer.json @@ -24,10 +24,9 @@ "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0" }, "require-dev": { - "laravel/pint": "^1.21", "mockery/mockery": "^0.9|^1.0", "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", - "phpunit/phpunit": "^10.5|^11.5.3|^12.5.12" + "phpunit/phpunit": "^9.3|^10.5|^11.5.3|^12.5.12" }, "autoload": { "psr-4": { From 3f35d3fc50cfaf49136a6bfd0b24484a45ffaff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nikolaou?= Date: Wed, 3 Jun 2026 18:57:40 +0300 Subject: [PATCH 6/8] Fix workflows --- .github/workflows/tests.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b10bea3..2751599 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - php: [8.4, 8.3, 8.2, 8.1, 8.0] + php: [8.5, 8.4, 8.3, 8.2, 8.1, 8.0] laravel: [^6.0, ^7.0, ^8.0, ^9.0, ^10.0, ^11.0, ^12.0, ^13.0] include: - laravel: ^6.0 @@ -28,12 +28,16 @@ jobs: phpunit: ^10.5 - laravel: ^10.0 testbench: ^8.0 + phpunit: ^10.5 - laravel: ^11.0 testbench: ^9.0 + phpunit: ^11.5.3 - laravel: '12.0' testbench: ^10.0 + phpunit: ^11.5.3 - laravel: ^13.0 testbench: ^11.0 + phpunit: ^12.5.12 exclude: - laravel: ^6.0 php: 8.1 @@ -43,6 +47,8 @@ jobs: php: 8.3 - laravel: ^6.0 php: 8.4 + - laravel: ^6.0 + php: 8.5 - laravel: ^7.0 php: 8.1 - laravel: ^7.0 @@ -51,10 +57,14 @@ jobs: php: 8.3 - laravel: ^7.0 php: 8.4 + - laravel: ^7.0 + php: 8.5 - laravel: ^8.0 php: 8.2 - laravel: ^8.0 php: 8.3 + - laravel: ^8.0 + php: 8.5 - laravel: ^8.0 php: 8.4 - laravel: ^9.0 @@ -115,7 +125,7 @@ jobs: - name: Install dependencies run: | composer config --no-plugins allow-plugins.kylekatarnls/update-helper true - composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" ${{ matrix.phpunit && format('"phpunit/phpunit:{0}"', matrix.phpunit) || '' }} --no-interaction --no-update + composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update composer update --prefer-dist --no-interaction --no-progress - name: Execute tests From b72f3a45a4d84806f6bdd4640158a250f967890d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nikolaou?= Date: Wed, 3 Jun 2026 19:04:23 +0300 Subject: [PATCH 7/8] Fix workflows --- .github/workflows/tests.yml | 72 +++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2751599..cc553d2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,80 +12,82 @@ jobs: fail-fast: false matrix: php: [8.5, 8.4, 8.3, 8.2, 8.1, 8.0] - laravel: [^6.0, ^7.0, ^8.0, ^9.0, ^10.0, ^11.0, ^12.0, ^13.0] + laravel: ['6.*', '7.*', '8.*', '9.*', '10.*', '11.*', '12.*', '13.*'] include: - - laravel: ^6.0 - testbench: ^4.0 + - laravel: 6.* + testbench: 4.* phpunit: ^9.3 - - laravel: ^7.0 - testbench: ^5.0 + - laravel: 7.* + testbench: 5.* phpunit: ^9.3 - - laravel: ^8.0 + - laravel: 8.* testbench: ^6.0 phpunit: ^9.3 - - laravel: ^9.0 + - laravel: 9.* testbench: ^7.0 phpunit: ^10.5 - - laravel: ^10.0 + - laravel: 10.* testbench: ^8.0 phpunit: ^10.5 - - laravel: ^11.0 + - laravel: 11.* testbench: ^9.0 phpunit: ^11.5.3 - - laravel: '12.0' + - laravel: 12.* testbench: ^10.0 phpunit: ^11.5.3 - - laravel: ^13.0 + - laravel: 13.* testbench: ^11.0 phpunit: ^12.5.12 exclude: - - laravel: ^6.0 + - laravel: 6.* php: 8.1 - - laravel: ^6.0 + - laravel: 6.* php: 8.2 - - laravel: ^6.0 + - laravel: 6.* php: 8.3 - - laravel: ^6.0 + - laravel: 6.* php: 8.4 - - laravel: ^6.0 + - laravel: 6.* php: 8.5 - - laravel: ^7.0 + - laravel: 7.* php: 8.1 - - laravel: ^7.0 + - laravel: 7.* php: 8.2 - - laravel: ^7.0 + - laravel: 7.* php: 8.3 - - laravel: ^7.0 + - laravel: 7.* php: 8.4 - - laravel: ^7.0 + - laravel: 7.* php: 8.5 - - laravel: ^8.0 + - laravel: 8.* php: 8.2 - - laravel: ^8.0 + - laravel: 8.* php: 8.3 - - laravel: ^8.0 + - laravel: 8.* php: 8.5 - - laravel: ^8.0 + - laravel: 8.* php: 8.4 - - laravel: ^9.0 + - laravel: 9.* php: 8.3 - - laravel: ^9.0 + - laravel: 9.* php: 8.4 - - laravel: ^10.0 + - laravel: 9.* + php: 8.5 + - laravel: 10.* php: 8.0 - - laravel: ^11.0 + - laravel: 11.* php: 8.0 - - laravel: ^11.0 + - laravel: 11.* php: 8.1 - - laravel: '12.0' + - laravel: 12.* php: 8.0 - - laravel: '12.0' + - laravel: 12.* php: 8.1 - - laravel: ^13.0 + - laravel: 13.* php: 8.2 - - laravel: ^13.0 + - laravel: 13.* php: 8.1 - - laravel: ^13.0 + - laravel: 13.* php: 8.0 name: P${{ matrix.php }} - L${{ matrix.laravel }} From ef0c18af24bd5b4c849cf71583e1beb837a167c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nikolaou?= Date: Wed, 3 Jun 2026 19:08:06 +0300 Subject: [PATCH 8/8] Fix workflows --- .github/workflows/lint.yml | 2 +- .github/workflows/tests.yml | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0c3632c..99774e3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cc553d2..cd1ed8a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,7 @@ jobs: phpunit: ^9.3 - laravel: 9.* testbench: ^7.0 - phpunit: ^10.5 + phpunit: ^9.5.10 - laravel: 10.* testbench: ^8.0 phpunit: ^10.5 @@ -94,7 +94,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 @@ -118,7 +118,7 @@ jobs: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ${{ steps.composer-cache.outputs.dir }} key: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} @@ -127,7 +127,8 @@ jobs: - name: Install dependencies run: | composer config --no-plugins allow-plugins.kylekatarnls/update-helper true - composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update + composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" --no-interaction --no-update + composer require "orchestra/testbench:${{ matrix.testbench }}" "phpunit/phpunit:${{ matrix.phpunit }}" --dev --no-interaction --no-update composer update --prefer-dist --no-interaction --no-progress - name: Execute tests