From ef45ba63fd633df46eb669e4d39f3a38d0343c14 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 30 Jan 2024 17:23:24 +0100 Subject: [PATCH] Fix client api version to 2.4 --- .github/workflows/phpstan-9.yaml | 2 +- composer.json | 2 +- composer.lock | 29 ++++++++++++++--------------- src/CustomerExtractor.php | 1 - src/FilterGroup.php | 6 ++---- src/QueryParameters.php | 6 ++---- 6 files changed, 20 insertions(+), 26 deletions(-) diff --git a/.github/workflows/phpstan-9.yaml b/.github/workflows/phpstan-9.yaml index c0fe8c0..68dbcae 100644 --- a/.github/workflows/phpstan-9.yaml +++ b/.github/workflows/phpstan-9.yaml @@ -1,4 +1,4 @@ -name: PHPStan level 8 +name: PHPStan level 9 on: push jobs: phpstan-9: diff --git a/composer.json b/composer.json index b3580f3..aceceed 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "psr/log": "^3.0", "nyholm/psr7": "^1.5", "php-etl/bucket": "*", - "php-etl/magento2-api-client": "^0.1.0", + "php-etl/magento2-api-client": "2.4.x-dev", "psr/simple-cache": "^3.0", "php-etl/mapping-contracts": "0.4.*" }, diff --git a/composer.lock b/composer.lock index d5e0fd3..9ee5222 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "032582e526fc85372024e11317f4a7be", + "content-hash": "971b575cae686edbfb95693562fcdba5", "packages": [ { "name": "clue/stream-filter", @@ -614,16 +614,16 @@ }, { "name": "php-etl/magento2-api-client", - "version": "dev-main", + "version": "2.4.x-dev", "source": { "type": "git", "url": "https://github.com/php-etl/magento2-api-client.git", - "reference": "8997167f00c6ea2f939aac95b9f4810ef43fb4a3" + "reference": "46a2c89a5275af40809f9c045577f22b0e53dce9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-etl/magento2-api-client/zipball/8997167f00c6ea2f939aac95b9f4810ef43fb4a3", - "reference": "8997167f00c6ea2f939aac95b9f4810ef43fb4a3", + "url": "https://api.github.com/repos/php-etl/magento2-api-client/zipball/46a2c89a5275af40809f9c045577f22b0e53dce9", + "reference": "46a2c89a5275af40809f9c045577f22b0e53dce9", "shasum": "" }, "require": { @@ -631,10 +631,10 @@ "php": "^8.0" }, "require-dev": { - "jane-php/open-api-3": "^7.3", - "phpunit/phpunit": "^9.5" + "jane-php/open-api-2": "^7.5", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.15" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -643,10 +643,7 @@ }, "autoload": { "psr-4": { - "Kiboko\\Magento\\V2_1\\": "src/v2_1", - "Kiboko\\Magento\\V2_2\\": "src/v2_2", - "Kiboko\\Magento\\V2_3\\": "src/v2_3", - "Kiboko\\Magento\\V2_4\\": "src/v2_4" + "Kiboko\\Magento\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -662,9 +659,9 @@ "description": "This package provides Jane-PHP generated API models and client based on the OpenAPI specification for Magento 2.3.x", "support": { "issues": "https://github.com/php-etl/magento2-api-client/issues", - "source": "https://github.com/php-etl/magento2-api-client/tree/main" + "source": "https://github.com/php-etl/magento2-api-client/tree/2.4" }, - "time": "2022-09-23T08:47:45+00:00" + "time": "2024-01-22T09:20:52+00:00" }, { "name": "php-etl/mapping-contracts", @@ -4641,7 +4638,9 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "php-etl/magento2-api-client": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { diff --git a/src/CustomerExtractor.php b/src/CustomerExtractor.php index dae4dc4..fec6054 100644 --- a/src/CustomerExtractor.php +++ b/src/CustomerExtractor.php @@ -7,7 +7,6 @@ use Kiboko\Component\Bucket\AcceptanceResultBucket; use Kiboko\Component\Bucket\RejectionResultBucket; use Kiboko\Contract\Bucket\RejectionResultBucketInterface; -use Kiboko\Contract\Bucket\ResultBucketInterface; use Kiboko\Contract\Pipeline\ExtractorInterface; use Kiboko\Magento\Client; use Kiboko\Magento\Exception\GetV1CustomersSearchInternalServerErrorException; diff --git a/src/FilterGroup.php b/src/FilterGroup.php index 4460cb9..daa34cb 100644 --- a/src/FilterGroup.php +++ b/src/FilterGroup.php @@ -19,11 +19,9 @@ public function withFilter(FilterInterface $filter): self return $this; } - public function withFilters(FilterInterface ...$filter): self + public function withFilters(FilterInterface ...$filters): self { - foreach ($filter as $item) { - $this->filters[] = $item; - } + array_push($this->filters, ...$filters); return $this; } diff --git a/src/QueryParameters.php b/src/QueryParameters.php index e14af9e..3d6ced8 100644 --- a/src/QueryParameters.php +++ b/src/QueryParameters.php @@ -16,11 +16,9 @@ public function withGroup(FilterGroup $group): self return $this; } - public function withGroups(FilterGroup ...$group): self + public function withGroups(FilterGroup ...$groups): self { - foreach ($group as $item) { - $this->groups[] = $item; - } + array_push($this->groups, ...$groups); return $this; }