From a7830f305e13d0b640e373fa35b7413930ee29f0 Mon Sep 17 00:00:00 2001 From: Ramon Rietdijk Date: Wed, 25 Sep 2024 14:13:58 +0200 Subject: [PATCH 1/2] Fixed breaking change from akeneo/api-php-client --- composer.json | 120 +++++++++++++++++----------------- phpstan.neon | 4 +- src/Actions/DispatchEvent.php | 3 +- src/Client/Client.php | 2 +- src/Client/ClientBuilder.php | 2 +- 5 files changed, 65 insertions(+), 66 deletions(-) diff --git a/composer.json b/composer.json index 812a1f3..a9f23c5 100644 --- a/composer.json +++ b/composer.json @@ -1,63 +1,63 @@ { - "name": "justbetter/laravel-akeneo-client", - "description": "A Laravel package for the Akeneo API", - "type": "package", - "license": "MIT", - "homepage": "https://github.com/justbetter/laravel-akeneo-client", - "authors": [ - { - "name": "Ramon Rietdijk", - "email": "ramon@justbetter.nl", - "role": "Developer" - } - ], - "require": { - "php": "^8.2|^8.3", - "akeneo/api-php-client": "^11.0", - "guzzlehttp/guzzle": "^7.5", - "laravel/framework": "^10.0|^11.0" - }, - "require-dev": { - "laravel/pint": "^1.6", - "larastan/larastan": "^2.5", - "orchestra/testbench": "^8.11|^9.0", - "phpstan/phpstan-mockery": "^1.1", - "phpunit/phpunit": "^10.0" - }, - "autoload": { - "psr-4": { - "JustBetter\\AkeneoClient\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "JustBetter\\AkeneoClient\\Tests\\": "tests" - } - }, - "scripts": { - "test": "phpunit", - "analyse": "phpstan", - "style": "pint --test", - "quality": [ - "@test", - "@analyse", - "@style" + "name": "justbetter/laravel-akeneo-client", + "description": "A Laravel package for the Akeneo API", + "type": "package", + "license": "MIT", + "homepage": "https://github.com/justbetter/laravel-akeneo-client", + "authors": [ + { + "name": "Ramon Rietdijk", + "email": "ramon@justbetter.nl", + "role": "Developer" + } ], - "fix-style": "pint" - }, - "config": { - "sort-packages": true, - "allow-plugins": { - "php-http/discovery": true - } - }, - "extra": { - "laravel": { - "providers": [ - "JustBetter\\AkeneoClient\\ServiceProvider" - ] - } - }, - "minimum-stability": "dev", - "prefer-stable": true + "require": { + "php": "^8.2|^8.3", + "akeneo/api-php-client": "^11.4", + "guzzlehttp/guzzle": "^7.5", + "laravel/framework": "^10.0|^11.0" + }, + "require-dev": { + "laravel/pint": "^1.18", + "larastan/larastan": "^2.9", + "orchestra/testbench": "^8.27|^9.5", + "phpstan/phpstan-mockery": "^1.1", + "phpunit/phpunit": "^10.5" + }, + "autoload": { + "psr-4": { + "JustBetter\\AkeneoClient\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "JustBetter\\AkeneoClient\\Tests\\": "tests" + } + }, + "scripts": { + "test": "phpunit", + "analyse": "phpstan", + "style": "pint --test", + "quality": [ + "@test", + "@analyse", + "@style" + ], + "fix-style": "pint" + }, + "config": { + "sort-packages": true, + "allow-plugins": { + "php-http/discovery": true + } + }, + "extra": { + "laravel": { + "providers": [ + "JustBetter\\AkeneoClient\\ServiceProvider" + ] + } + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/phpstan.neon b/phpstan.neon index 75d23d6..ffdbf4b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,5 +7,5 @@ parameters: - src - tests level: 8 - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false + ignoreErrors: + - identifier: missingType.iterableValue diff --git a/src/Actions/DispatchEvent.php b/src/Actions/DispatchEvent.php index e5d85e5..0f05cc8 100644 --- a/src/Actions/DispatchEvent.php +++ b/src/Actions/DispatchEvent.php @@ -10,8 +10,7 @@ class DispatchEvent implements DispatchesEvents { public function __construct( public ResolvesEvents $resolvesEvents - ) { - } + ) {} public function dispatch(array $event): void { diff --git a/src/Client/Client.php b/src/Client/Client.php index 15d2c16..6a34f65 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -20,7 +20,7 @@ public function sendRequest(RequestInterface $request): ResponseInterface ->toPsrResponse(); } - public function sendAsyncRequest(RequestInterface $request): PromiseInterface|Promise + public function sendAsync(RequestInterface $request): PromiseInterface|Promise { /** @var Promise $promise */ $promise = $this->buildHttpRequest($request) diff --git a/src/Client/ClientBuilder.php b/src/Client/ClientBuilder.php index d0450aa..aef3e88 100644 --- a/src/Client/ClientBuilder.php +++ b/src/Client/ClientBuilder.php @@ -13,6 +13,6 @@ public function __construct(string $baseUri) { parent::__construct($baseUri); - $this->httpClient = new Client(); + $this->httpClient = new Client; } } From aab4ba6f691aad775f650b954b4099c4631679f9 Mon Sep 17 00:00:00 2001 From: Ramon Rietdijk Date: Wed, 25 Sep 2024 14:22:19 +0200 Subject: [PATCH 2/2] Added pestphp/pest to dev dependencies --- .github/workflows/coverage.yml | 3 +-- composer.json | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c85cbf7..43a8795 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -33,8 +33,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 diff --git a/composer.json b/composer.json index a9f23c5..257a092 100644 --- a/composer.json +++ b/composer.json @@ -18,9 +18,10 @@ "laravel/framework": "^10.0|^11.0" }, "require-dev": { - "laravel/pint": "^1.18", "larastan/larastan": "^2.9", + "laravel/pint": "^1.18", "orchestra/testbench": "^8.27|^9.5", + "pestphp/pest": "^2.0", "phpstan/phpstan-mockery": "^1.1", "phpunit/phpunit": "^10.5" }, @@ -48,7 +49,8 @@ "config": { "sort-packages": true, "allow-plugins": { - "php-http/discovery": true + "php-http/discovery": true, + "pestphp/pest-plugin": true } }, "extra": {