From e3ddf59954f8c7a2df1d46418f7d1e3dc550b7d1 Mon Sep 17 00:00:00 2001 From: tolga ulas Date: Wed, 20 Oct 2021 01:49:44 +0300 Subject: [PATCH 01/10] As of v1.2 eventloop:factory is depreciated. --- src/ReactFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ReactFactory.php b/src/ReactFactory.php index 62dbe94..99468ec 100644 --- a/src/ReactFactory.php +++ b/src/ReactFactory.php @@ -2,7 +2,7 @@ namespace Http\Adapter\React; -use React\EventLoop\Factory as EventLoopFactory; +use \React\EventLoop\Loop; use React\EventLoop\LoopInterface; use React\Http\Browser; use React\Socket\ConnectorInterface; @@ -19,7 +19,7 @@ class ReactFactory */ public static function buildEventLoop(): LoopInterface { - return EventLoopFactory::create(); + return Loop::get(); } /** From 3123eb2757b29bcf023468a7151fe0c2661868a1 Mon Sep 17 00:00:00 2001 From: tolga ulas <1431106+tolgaulas@users.noreply.github.com> Date: Wed, 20 Oct 2021 02:07:41 +0300 Subject: [PATCH 02/10] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22a7e6b..5b93293 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed +## [3.0.1] - 2021-10-20 +### Changed + +- Replaced factory with loop::get() as factory depreciated. ## [3.0.0] - 2020-12-17 From 6e44c3b0cc1c7dc2b96e16f9b328462afacced3a Mon Sep 17 00:00:00 2001 From: tolga ulas <1431106+tolgaulas@users.noreply.github.com> Date: Wed, 20 Oct 2021 04:54:38 +0300 Subject: [PATCH 03/10] added cancel function in accordance to the php-http/promise interface PR --- src/Promise.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Promise.php b/src/Promise.php index ec7d852..1746a4d 100644 --- a/src/Promise.php +++ b/src/Promise.php @@ -130,4 +130,11 @@ public function wait($unwrap = true) return $this->response; } } + + public function cancel(){ + $loop = $this->loop; + $loop->futureTick(function () use ($loop) { + $loop->stop(); + }); + } } From f853e7bdc139e481c3a64c709399094a8132d587 Mon Sep 17 00:00:00 2001 From: tolga ulas <1431106+tolgaulas@users.noreply.github.com> Date: Wed, 20 Oct 2021 04:58:55 +0300 Subject: [PATCH 04/10] composer update with PR of php-http/promise --- composer.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4f3005f..8c243c4 100644 --- a/composer.json +++ b/composer.json @@ -15,13 +15,21 @@ "php-http/httplug": "^2.0", "react/http": "^1.0", "react/event-loop": "^1.0", - "php-http/discovery": "^1.0" + "php-http/discovery": "^1.0", + "php-http/promise":"dev-master" }, "require-dev": { "php-http/client-integration-tests": "^3.0", "php-http/message": "^1.0", "nyholm/psr7": "^1.3" }, + "repositories": [ + { + "only": ["php-http/promise"], + "type": "vcs", + "url": "https://github.com/tolgaulas/promise" + } + ], "provide": { "php-http/client-implementation": "1.0", "php-http/async-client-implementation": "1.0" From c42716675b73c06b71b943b165ee997c2f77e3f6 Mon Sep 17 00:00:00 2001 From: Tolga Ulas Date: Wed, 20 Oct 2021 11:21:57 +0300 Subject: [PATCH 05/10] Update src/ReactFactory.php Co-authored-by: David Buchmann --- src/ReactFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactFactory.php b/src/ReactFactory.php index 99468ec..e882326 100644 --- a/src/ReactFactory.php +++ b/src/ReactFactory.php @@ -2,7 +2,7 @@ namespace Http\Adapter\React; -use \React\EventLoop\Loop; +use React\EventLoop\Loop; use React\EventLoop\LoopInterface; use React\Http\Browser; use React\Socket\ConnectorInterface; From e9413184d17c67add698139b6f561ff5344bf146 Mon Sep 17 00:00:00 2001 From: Tolga Ulas Date: Wed, 20 Oct 2021 11:22:06 +0300 Subject: [PATCH 06/10] Update composer.json Co-authored-by: David Buchmann --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8c243c4..1a360f4 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "php": "^7.1|^8.0", "php-http/httplug": "^2.0", "react/http": "^1.0", - "react/event-loop": "^1.0", + "react/event-loop": "^1.2", "php-http/discovery": "^1.0", "php-http/promise":"dev-master" }, From e67b69d0099feec90d7e66ed66c40d419f86ca6e Mon Sep 17 00:00:00 2001 From: tolga ulas <1431106+tolgaulas@users.noreply.github.com> Date: Wed, 20 Oct 2021 11:33:06 +0300 Subject: [PATCH 07/10] undo promise.cancel --- composer.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 1a360f4..762641f 100644 --- a/composer.json +++ b/composer.json @@ -15,21 +15,13 @@ "php-http/httplug": "^2.0", "react/http": "^1.0", "react/event-loop": "^1.2", - "php-http/discovery": "^1.0", - "php-http/promise":"dev-master" + "php-http/discovery": "^1.0" }, "require-dev": { "php-http/client-integration-tests": "^3.0", "php-http/message": "^1.0", "nyholm/psr7": "^1.3" }, - "repositories": [ - { - "only": ["php-http/promise"], - "type": "vcs", - "url": "https://github.com/tolgaulas/promise" - } - ], "provide": { "php-http/client-implementation": "1.0", "php-http/async-client-implementation": "1.0" From 99754df46bf7af11f9942922f06bb5502ca577f6 Mon Sep 17 00:00:00 2001 From: tolga ulas <1431106+tolgaulas@users.noreply.github.com> Date: Wed, 20 Oct 2021 11:36:24 +0300 Subject: [PATCH 08/10] promise.cancel removed --- src/Promise.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Promise.php b/src/Promise.php index 1746a4d..ec7d852 100644 --- a/src/Promise.php +++ b/src/Promise.php @@ -130,11 +130,4 @@ public function wait($unwrap = true) return $this->response; } } - - public function cancel(){ - $loop = $this->loop; - $loop->futureTick(function () use ($loop) { - $loop->stop(); - }); - } } From d7917f1511a69c73237493e0150496ab3807f5ab Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Wed, 20 Oct 2021 10:55:39 +0200 Subject: [PATCH 09/10] Apply suggestions from code review --- CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b93293..749bd67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Changed -## [3.0.1] - 2021-10-20 - ### Changed - Replaced factory with loop::get() as factory depreciated. From 59ce34ba1ea19b1c0da97c4307c792efddd55cb3 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Wed, 20 Oct 2021 10:56:30 +0200 Subject: [PATCH 10/10] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 749bd67..0ecb328 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Replaced factory with loop::get() as factory depreciated. +- Replaced EventFactory::create with Loop::get as the factory has been deprecated. ## [3.0.0] - 2020-12-17