diff --git a/composer.json b/composer.json index bf52850..c22a99e 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "php": "^8.2", "phpunit/phpunit": "^10.0", "nikic/php-parser": "^4.10", - "php-etl/pipeline-contracts": "0.4.*", + "php-etl/pipeline-contracts": "0.5.*", "php-http/message": "^1.11", "php-http/mock-client": "^1.4@dev", "fakerphp/faker": "^1.19", @@ -15,7 +15,7 @@ }, "require-dev": { "phpstan/phpstan": "^1.10", - "friendsofphp/php-cs-fixer": "^3.0", + "friendsofphp/php-cs-fixer": "^3.38", "infection/infection": "^0.26.18", "rector/rector": "^0.15" }, @@ -47,7 +47,7 @@ }, "extra": { "branch-alias": { - "dev-main": "0.5.x-dev" + "dev-main": "0.7.x-dev" } } } diff --git a/composer.lock b/composer.lock index 772c372..ba816b6 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": "3b93b4e4becc5149b073be1441542282", + "content-hash": "5e102058c956bf7aaf4ea51b1c4c11d0", "packages": [ { "name": "clue/stream-filter", @@ -516,16 +516,16 @@ }, { "name": "php-etl/bucket-contracts", - "version": "v0.2.0", + "version": "v0.3.0", "source": { "type": "git", "url": "https://github.com/php-etl/bucket-contracts.git", - "reference": "e96726f9b89dea7308482fa6c2ce4db0757960ce" + "reference": "64170754cb1f5e556c8e526177be51d905c3b15f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-etl/bucket-contracts/zipball/e96726f9b89dea7308482fa6c2ce4db0757960ce", - "reference": "e96726f9b89dea7308482fa6c2ce4db0757960ce", + "url": "https://api.github.com/repos/php-etl/bucket-contracts/zipball/64170754cb1f5e556c8e526177be51d905c3b15f", + "reference": "64170754cb1f5e556c8e526177be51d905c3b15f", "shasum": "" }, "require": { @@ -539,7 +539,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "0.2.x-dev" + "dev-main": "0.3.x-dev" } }, "autoload": { @@ -564,27 +564,28 @@ "description": "This library describes contracts for the data-interchange buckets.", "support": { "issues": "https://github.com/php-etl/bucket-contracts/issues", - "source": "https://github.com/php-etl/bucket-contracts/tree/v0.2.0" + "source": "https://github.com/php-etl/bucket-contracts/tree/v0.3.0" }, - "time": "2023-04-03T12:42:10+00:00" + "time": "2023-11-14T14:39:36+00:00" }, { "name": "php-etl/pipeline-contracts", - "version": "v0.4.0", + "version": "v0.5.0", "source": { "type": "git", "url": "https://github.com/php-etl/pipeline-contracts.git", - "reference": "47e1e32aedb425c4624c1f6d9acf5ae839287fdf" + "reference": "29aac4a1644c960355a17876e4a84bb8f0b89654" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-etl/pipeline-contracts/zipball/47e1e32aedb425c4624c1f6d9acf5ae839287fdf", - "reference": "47e1e32aedb425c4624c1f6d9acf5ae839287fdf", + "url": "https://api.github.com/repos/php-etl/pipeline-contracts/zipball/29aac4a1644c960355a17876e4a84bb8f0b89654", + "reference": "29aac4a1644c960355a17876e4a84bb8f0b89654", "shasum": "" }, "require": { "php": "^8.2", - "php-etl/bucket-contracts": "0.2.0" + "php-etl/bucket-contracts": "0.3.*", + "php-etl/satellite-contracts": "0.1.*" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.0", @@ -594,7 +595,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "0.4.x-dev" + "dev-main": "0.5.x-dev" } }, "autoload": { @@ -619,9 +620,61 @@ "description": "This library describes contracts for the Extract-Transform-Load pattern.", "support": { "issues": "https://github.com/php-etl/pipeline-contracts/issues", - "source": "https://github.com/php-etl/pipeline-contracts/tree/v0.4.0" + "source": "https://github.com/php-etl/pipeline-contracts/tree/v0.5.0" }, - "time": "2023-04-06T10:08:37+00:00" + "time": "2023-11-15T10:45:24+00:00" + }, + { + "name": "php-etl/satellite-contracts", + "version": "v0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-etl/satellite-contracts.git", + "reference": "1d2bc6822bfdb3efc6a1f490e706db995c99ef41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-etl/satellite-contracts/zipball/1d2bc6822bfdb3efc6a1f490e706db995c99ef41", + "reference": "1d2bc6822bfdb3efc6a1f490e706db995c99ef41", + "shasum": "" + }, + "require": { + "php": "^8.2" + }, + "require-dev": { + "rector/rector": "^0.15.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Kiboko\\Contract\\Satellite\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kiboko SAS", + "homepage": "http://kiboko.fr" + }, + { + "name": "Grégory Planchat", + "email": "gregory@kiboko.fr" + } + ], + "description": "This library describes contracts for defining satellite formats", + "support": { + "issues": "https://github.com/php-etl/satellite-contracts/issues", + "source": "https://github.com/php-etl/satellite-contracts/tree/v0.1.0" + }, + "time": "2023-04-18T13:53:22+00:00" }, { "name": "php-http/client-common", @@ -3207,159 +3260,6 @@ ], "time": "2022-02-25T21:32:43+00:00" }, - { - "name": "doctrine/annotations", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^2 || ^3", - "ext-tokenizer": "*", - "php": "^7.2 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^2.0", - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/2.0.1" - }, - "time": "2023-02-02T22:02:53+00:00" - }, - { - "name": "doctrine/lexer", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "84a527db05647743d50373e0ec53a152f2cde568" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", - "reference": "84a527db05647743d50373e0ec53a152f2cde568", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "time": "2022-12-15T16:57:16+00:00" - }, { "name": "fidry/cpu-core-counter", "version": "0.4.1", @@ -3423,23 +3323,21 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.16.0", + "version": "v3.38.2", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc" + "reference": "d872cdd543797ade030aaa307c0a4954a712e081" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", - "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d872cdd543797ade030aaa307c0a4954a712e081", + "reference": "d872cdd543797ade030aaa307c0a4954a712e081", "shasum": "" }, "require": { "composer/semver": "^3.3", "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^2", - "doctrine/lexer": "^2 || ^3", "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", @@ -3456,6 +3354,7 @@ "symfony/stopwatch": "^5.4 || ^6.0" }, "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", "justinrainbow/json-schema": "^5.2", "keradus/cli-executor": "^2.0", "mikey179/vfsstream": "^1.6.11", @@ -3466,8 +3365,6 @@ "phpspec/prophecy": "^1.16", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.6", - "phpunitgoodpractices/traits": "^1.9.2", "symfony/phpunit-bridge": "^6.2.3", "symfony/yaml": "^5.4 || ^6.0" }, @@ -3507,7 +3404,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.16.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.38.2" }, "funding": [ { @@ -3515,7 +3412,7 @@ "type": "github" } ], - "time": "2023-04-02T19:30:06+00:00" + "time": "2023-11-14T00:19:22+00:00" }, { "name": "infection/abstract-testframework-adapter", @@ -4032,55 +3929,6 @@ ], "time": "2023-04-12T10:33:29+00:00" }, - { - "name": "psr/cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "time": "2021-02-03T23:26:27+00:00" - }, { "name": "psr/event-dispatcher", "version": "1.0.0", diff --git a/src/Mock/ApiClientMockBuilder.php b/src/Mock/ApiClientMockBuilder.php index bfedded..223b0b4 100644 --- a/src/Mock/ApiClientMockBuilder.php +++ b/src/Mock/ApiClientMockBuilder.php @@ -9,6 +9,7 @@ use PhpParser\Builder; use PhpParser\Node; +/** @deprecated This should be moved to php-etl/akeneo-plugin as it is very specific to Akeneo plugin */ final class ApiClientMockBuilder implements Builder { private Node\Expr $node; diff --git a/src/Mock/RequestMatcher/RequestMatcherBuilder.php b/src/Mock/RequestMatcher/RequestMatcherBuilder.php index 91f0f78..ee5a8c0 100644 --- a/src/Mock/RequestMatcher/RequestMatcherBuilder.php +++ b/src/Mock/RequestMatcher/RequestMatcherBuilder.php @@ -4,6 +4,7 @@ namespace Kiboko\Component\PHPUnitExtension\Mock\RequestMatcher; +use Http\Message\RequestMatcher; use PhpParser\Node; final class RequestMatcherBuilder implements RequestMatcherBuilderInterface @@ -19,7 +20,7 @@ public function __construct( public function getNode(): Node { return new Node\Expr\New_( - class: new Node\Name\FullyQualified(\Http\Message\RequestMatcher\RequestMatcher::class), + class: new Node\Name\FullyQualified(RequestMatcher::class), args: [ new Node\Arg( value: null !== $this->path ? new Node\Scalar\String_($this->path) : new Node\Expr\ConstFetch(new Node\Name('null')), diff --git a/src/PipelineRunner.php b/src/PipelineRunner.php index 8b0c01b..1164478 100644 --- a/src/PipelineRunner.php +++ b/src/PipelineRunner.php @@ -7,20 +7,17 @@ use Kiboko\Contract\Bucket\AcceptanceResultBucketInterface; use Kiboko\Contract\Bucket\RejectionResultBucketInterface; use Kiboko\Contract\Pipeline\PipelineRunnerInterface; -use Kiboko\Contract\Pipeline\RejectionInterface; -use Kiboko\Contract\Pipeline\StateInterface; +use Kiboko\Contract\Pipeline\StepRejectionInterface; +use Kiboko\Contract\Pipeline\StepStateInterface; final class PipelineRunner implements PipelineRunnerInterface { public function run( \Iterator $source, \Generator $async, - RejectionInterface $rejection, - StateInterface $state, + StepRejectionInterface $rejection, + StepStateInterface $state, ): \Iterator { - $state->initialize(); - $rejection->initialize(); - $source->rewind(); $async->rewind(); @@ -40,8 +37,5 @@ public function run( $source->next(); } - - $rejection->teardown(); - $state->teardown(); } }