diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml index f8a0fe8..f9c9c19 100644 --- a/.github/workflows/analyse.yml +++ b/.github/workflows/analyse.yml @@ -9,12 +9,10 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.3] - laravel: [10.*, 11.*] + php: [8.3, 8.4] + laravel: [11.*] stability: [prefer-stable] include: - - laravel: 10.* - testbench: 8.* - laravel: 11.* testbench: 9.* diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c85cbf7..8bb396f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -9,12 +9,10 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.3] - laravel: [10.*, 11.*] + php: [8.4] + laravel: [11.*] stability: [prefer-stable] include: - - laravel: 10.* - testbench: 8.* - laravel: 11.* testbench: 9.* @@ -33,8 +31,7 @@ jobs: - name: Install dependencies run: | - composer config allow-plugins.pestphp/pest-plugin true - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" pestphp/pest --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: Execute tests - run: XDEBUG_MODE=coverage php vendor/bin/pest --coverage --min=100 + run: composer coverage diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index e9a5c3d..0439b8d 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -16,7 +16,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo coverage: none diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7000deb..5b04952 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,17 +9,12 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.2, 8.3] - laravel: [10.*, 11.*] - stability: [prefer-stable] + php: [8.3, 8.4] + laravel: [11.*] + stability: [prefer-lowest, prefer-stable] include: - - laravel: 10.* - testbench: 8.* - laravel: 11.* testbench: 9.* - exclude: - - laravel: 11.* - php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index 509de8a..a9d47e4 100644 --- a/composer.json +++ b/composer.json @@ -11,16 +11,17 @@ } ], "require": { - "php": "^8.1", + "php": "^8.3", "justbetter/laravel-akeneo-client": "^1.4", - "laravel/framework": "^10.0|^11.0" + "laravel/framework": "^11.0|^12.0" }, "require-dev": { - "larastan/larastan": "^2.9", - "laravel/pint": "^1.10", - "orchestra/testbench": "^8.0|^9.0", - "phpstan/phpstan-mockery": "^1.1", - "phpunit/phpunit": "^10.2" + "larastan/larastan": "^3.0", + "laravel/pint": "^1.20", + "orchestra/testbench": "^9.0", + "pestphp/pest": "^3.7", + "phpstan/phpstan-mockery": "^2.0", + "phpunit/phpunit": "^11.5" }, "autoload": { "psr-4": { @@ -34,18 +35,21 @@ }, "scripts": { "test": "phpunit", - "analyse": "phpstan", + "analyse": "phpstan --memory-limit=256M", "style": "pint --test", "quality": [ - "@test", + "@style", "@analyse", - "@style" - ] + "@test", + "@coverage" + ], + "coverage": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage --min=100" }, "config": { "sort-packages": true, "allow-plugins": { - "php-http/discovery": true + "php-http/discovery": true, + "pestphp/pest-plugin": true } }, "extra": { diff --git a/phpstan.neon b/phpstan.neon index ae42faf..ffdbf4b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,4 +7,5 @@ parameters: - src - tests level: 8 - checkMissingIterableValueType: false + ignoreErrors: + - identifier: missingType.iterableValue diff --git a/src/Actions/UploadImage.php b/src/Actions/UploadImage.php index 8134100..4bb8c74 100644 --- a/src/Actions/UploadImage.php +++ b/src/Actions/UploadImage.php @@ -11,8 +11,7 @@ class UploadImage implements UploadsImage { public function __construct( protected Akeneo $akeneo - ) { - } + ) {} public function upload(Image $image): Image { diff --git a/tests/Jobs/ProcessImageJobTest.php b/tests/Jobs/ProcessImageJobTest.php index 6bf6e19..1aa4aea 100644 --- a/tests/Jobs/ProcessImageJobTest.php +++ b/tests/Jobs/ProcessImageJobTest.php @@ -18,7 +18,7 @@ public function it_can_process_images(): void ->shouldReceive('process') ->with('::disk::', '::path::', ['key' => 'value'], false) ->once() - ->andReturn(new Image()); + ->andReturn(new Image); }); ProcessImageJob::dispatch('::disk::', '::path::', ['key' => 'value'], false); diff --git a/tests/Jobs/UploadImageJobTest.php b/tests/Jobs/UploadImageJobTest.php index 52d3638..7c8b5a4 100644 --- a/tests/Jobs/UploadImageJobTest.php +++ b/tests/Jobs/UploadImageJobTest.php @@ -23,7 +23,7 @@ public function it_can_upload_images(): void $mock ->shouldReceive('upload') ->once() - ->andReturn(new Image()); + ->andReturn(new Image); }); UploadImageJob::dispatch($image); diff --git a/tests/Models/ImageTest.php b/tests/Models/ImageTest.php index 960a985..4b5ccd1 100644 --- a/tests/Models/ImageTest.php +++ b/tests/Models/ImageTest.php @@ -14,7 +14,7 @@ class ImageTest extends TestCase */ public function it_can_get_meta(?array $meta, int|string $key, mixed $default, mixed $expected): void { - $image = new Image(); + $image = new Image; $image->meta = $meta; $this->assertEquals($expected, $image->meta($key, $default));