From eb868b8f2e23388b542b47314fe209c54eabfbcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clavi=C3=A9?= Date: Tue, 3 Nov 2020 12:48:14 +0100 Subject: [PATCH 1/5] Use shivammathur github action --- .github/workflows/ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27339b4..9b99a36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + + - uses: shivammathur/setup-php@v2 + with: + php-version: '7.3' + tools: composer:v2, psalm - name: Install dependencies run: composer install --prefer-dist --no-progress --no-suggest - - name: Install Psalm - run: composer require --dev vimeo/psalm:dev-master@dev --no-suggest - - name: Psalm - run: vendor/bin/psalm --output-format=github --shepherd + run: psalm --output-format=github --shepherd From 1111cbc06650e1ec07d54ccf06454b8c5e79a0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clavi=C3=A9?= Date: Tue, 3 Nov 2020 13:25:54 +0100 Subject: [PATCH 2/5] Bump to at least discovery 1.11 --- composer.json | 3 ++- src/Container.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index fb72e41..9849db3 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "psr/http-factory": "^1.0", "psr/http-factory-implementation": "^1.0", - "php-http/discovery": "^1.0", + "php-http/discovery": "^1.11", "php-http/client-common": "^2.0", "container-interop/container-interop": "^1.0" @@ -45,6 +45,7 @@ }, "conflict": { + "php-http/discovery": "< 1.11", "behat/behat": "< 3.5", "symfony/dependency-injection": "< 2.8" }, diff --git a/src/Container.php b/src/Container.php index 9d99ad3..d9a68e2 100644 --- a/src/Container.php +++ b/src/Container.php @@ -69,7 +69,7 @@ public function get($id) private function getPluginClientBuilder(): PluginClientBuilder { $builder = new PluginClientBuilder; - $uriFactory = Psr17FactoryDiscovery::findUrlFactory(); + $uriFactory = Psr17FactoryDiscovery::findUriFactory(); $baseUri = $uriFactory->createUri($this->baseUrl); $httpHistory = $this->services[HttpHistory::class]; From 3c2d26f8a3a872abb6907cf40268bc7d1bbedb7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clavi=C3=A9?= Date: Tue, 3 Nov 2020 13:28:37 +0100 Subject: [PATCH 3/5] Remove the `--no-suggest` flag in github action --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b99a36..be1eb7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,10 +17,11 @@ jobs: - uses: shivammathur/setup-php@v2 with: php-version: '7.3' + coverage: none tools: composer:v2, psalm - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest + run: composer install --prefer-dist --no-progress --ansi - name: Psalm run: psalm --output-format=github --shepherd From 601390275aa5af6f7819cfd80a495f8d72ef4d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clavi=C3=A9?= Date: Tue, 3 Nov 2020 13:30:30 +0100 Subject: [PATCH 4/5] Use composer update instead of install in github actions There's no lock file, so an update is find and advised by composer installation anyways. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be1eb7e..5b375a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: tools: composer:v2, psalm - name: Install dependencies - run: composer install --prefer-dist --no-progress --ansi + run: composer update --prefer-dist --no-progress --ansi - name: Psalm run: psalm --output-format=github --shepherd From b8244464c4312da0cecdc1aa53be8fc1a1b03304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clavi=C3=A9?= Date: Tue, 3 Nov 2020 13:34:53 +0100 Subject: [PATCH 5/5] Use proper PSR container as a dependency now that behat supports it --- README.md | 5 +---- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e0550b1..4387f46 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Behapi ====== Behat extension to help write describe features related to HTTP APIs. -PHP 7.3, Behat 3.5 and a discoverable php-http client are required to make +PHP 7.3, Behat 3.7 and a discoverable php-http client are required to make this extension work. Installing this extension requires you to require `taluu/behapi` and an @@ -11,9 +11,6 @@ implementation of a http client (providing `psr/http-factory-implementation ^1.0` and `psr/http-message-implementation ^1.0`). -This still requires the interop container, while Behat doesn't have 1st class -support for the psr-11. - You can find some examples on the `examples/` directory. Howto diff --git a/composer.json b/composer.json index 9849db3..95a9ebe 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "php-http/discovery": "^1.11", "php-http/client-common": "^2.0", - "container-interop/container-interop": "^1.0" + "psr/container": "^1.0" }, "suggest": { @@ -46,7 +46,7 @@ "conflict": { "php-http/discovery": "< 1.11", - "behat/behat": "< 3.5", + "behat/behat": "< 3.7", "symfony/dependency-injection": "< 2.8" },