From c2575ebdaeaf1a1e2112497a9d287254d258ace9 Mon Sep 17 00:00:00 2001 From: Vincent Boon Date: Thu, 13 Feb 2025 15:19:47 +0100 Subject: [PATCH 1/2] Laravel 12 support --- .github/workflows/analyse.yml | 4 ++-- .github/workflows/coverage.yml | 5 ++--- .github/workflows/style.yml | 2 +- .github/workflows/tests.yml | 7 ++----- composer.json | 26 ++++++++++++++------------ 5 files changed, 21 insertions(+), 23 deletions(-) diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml index 471bedd..f9c9c19 100644 --- a/.github/workflows/analyse.yml +++ b/.github/workflows/analyse.yml @@ -9,8 +9,8 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.3] - laravel: [ 11.*] + php: [8.3, 8.4] + laravel: [11.*] stability: [prefer-stable] include: - laravel: 11.* diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0532e49..8bb396f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.3] + php: [8.4] laravel: [11.*] stability: [prefer-stable] include: @@ -31,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 }}" --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 c502770..5b04952 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,15 +9,12 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.2, 8.3] + php: [8.3, 8.4] laravel: [11.*] - stability: [prefer-stable] + stability: [prefer-lowest, prefer-stable] include: - 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 3308913..4303f2e 100644 --- a/composer.json +++ b/composer.json @@ -11,21 +11,21 @@ } ], "require": { - "php": "^8.2", + "php": "^8.3", "justbetter/laravel-magento-async": "^1.0", "justbetter/laravel-magento-client": "^2.6.1", "justbetter/laravel-magento-products": "^1.4", - "laravel/framework": "11.*", + "laravel/framework": "^11.0|^12.0", "spatie/laravel-activitylog": "^4.7" }, "require-dev": { - "orchestra/testbench": "9.*", "doctrine/dbal": "^3.4", - "larastan/larastan": "^2.9", - "laravel/pint": "^1.6", - "phpstan/phpstan-mockery": "^1.1", - "phpunit/phpunit": "^10.0", - "pestphp/pest": "^2.0" + "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": { @@ -39,14 +39,16 @@ }, "scripts": { "test": "phpunit", - "analyse": "phpstan", + "analyse": "phpstan --memory-limit=256M", "style": "pint --test", "quality": [ - "@test", + "@style", "@analyse", - "@style" + "@test", + "@coverage" ], - "fix-style": "pint" + "fix-style": "pint", + "coverage": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage --min=100" }, "config": { "sort-packages": true, From 52415cb10016b0a0650bfe0af238e75e2dd3c100 Mon Sep 17 00:00:00 2001 From: Vincent Boon Date: Thu, 13 Feb 2025 15:21:26 +0100 Subject: [PATCH 2/2] SCA --- .github/workflows/tests.yml | 2 +- src/Listeners/BulkOperationStatusListener.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5b04952..09b309b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: os: [ubuntu-latest] php: [8.3, 8.4] laravel: [11.*] - stability: [prefer-lowest, prefer-stable] + stability: [prefer-stable] include: - laravel: 11.* testbench: 9.* diff --git a/src/Listeners/BulkOperationStatusListener.php b/src/Listeners/BulkOperationStatusListener.php index 1cf4701..68b345e 100644 --- a/src/Listeners/BulkOperationStatusListener.php +++ b/src/Listeners/BulkOperationStatusListener.php @@ -28,7 +28,7 @@ public function execute(BulkOperation $operation): void activity() ->useLog('error') ->withProperties([ - 'status' => $operation->status?->name ?? 'unknown', + 'status' => $operation->status->name ?? 'unknown', 'response' => $operation->response, ]) ->log('Failed to update Magento stock for SKU: '.$stock->sku);