From 0ca7494f84fb35205fe0a2329df77f8b0844a2a5 Mon Sep 17 00:00:00 2001 From: Wirebox <52372076+wirebox-platform@users.noreply.github.com> Date: Wed, 21 Aug 2019 07:48:35 +0100 Subject: [PATCH 1/5] Support for PSR-15 RequestHandlerInterface for queue items Problem/details/solution noted here: https://github.com/relayphp/Relay.Relay/issues/47 --- src/Runner.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Runner.php b/src/Runner.php index aeefb6f..210bb54 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -13,6 +13,7 @@ use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Server\MiddlewareInterface; +use Psr\Http\Server\RequestHandlerInterface; /** * @@ -35,6 +36,10 @@ public function handle(ServerRequestInterface $request) : ResponseInterface if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, $this); } + + if ($middleware instanceof RequestHandlerInterface) { + return $middleware->handle($request); + } return $middleware($request, $this); } From f51c4e95e27c2ef8df348358029f03ad8b3e92d8 Mon Sep 17 00:00:00 2001 From: Wirebox <52372076+wirebox-platform@users.noreply.github.com> Date: Fri, 23 Aug 2019 14:27:23 +0100 Subject: [PATCH 2/5] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 50e09e6..b5dfd22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ sudo: false language: php php: - 7.1 + - 7.2 before_script: - composer self-update - composer install From 6f8049761b81ffe1db5940e1368438968a2a4a34 Mon Sep 17 00:00:00 2001 From: Wirebox <52372076+wirebox-platform@users.noreply.github.com> Date: Fri, 23 Aug 2019 14:32:38 +0100 Subject: [PATCH 3/5] Update .travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b5dfd22..50e09e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ sudo: false language: php php: - 7.1 - - 7.2 before_script: - composer self-update - composer install From b68d78ba600c010903db1b12117d0036b045cf66 Mon Sep 17 00:00:00 2001 From: Wirebox <52372076+wirebox-platform@users.noreply.github.com> Date: Fri, 23 Aug 2019 15:18:54 +0100 Subject: [PATCH 4/5] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 50e09e6..ded4948 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ before_script: - composer self-update - composer install script: - - phpunit --coverage-clover=coverage.clover + - php vendor/bin/phpunit --coverage-clover=coverage.clover after_script: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover From b9ff28a1a8fd8795f58153bd25b1af6e4667d104 Mon Sep 17 00:00:00 2001 From: Wirebox <52372076+wirebox-platform@users.noreply.github.com> Date: Wed, 13 Nov 2019 19:17:23 +0000 Subject: [PATCH 5/5] Update RelayTest.php --- tests/RelayTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/RelayTest.php b/tests/RelayTest.php index f9bd634..a67e84d 100644 --- a/tests/RelayTest.php +++ b/tests/RelayTest.php @@ -84,4 +84,16 @@ public function testResolverEntries() $this->assertRelay(new Relay($queue, $resolver)); } + + public function testRequestHandlerInQueue() + { + $queue = [ + new FakeMiddleware(), + new FakeMiddleware(), + new FakeMiddleware(), + $this->responder, + ]; + $requestHandler = new Relay($queue); + $this->assertRelay(new Relay([$requestHandler])); + } }