@@ -33,31 +33,34 @@ public function testRestartChain(PluginClient $client, string $method, string $r
3333
3434 public function clientAndMethodProvider ()
3535 {
36- $ syncClient = new class implements ClientInterface {
36+ $ syncClient = new class () implements ClientInterface {
3737 public function sendRequest (RequestInterface $ request ): ResponseInterface
3838 {
3939 return new Response ();
4040 }
4141 };
4242
43- $ asyncClient = new class implements HttpAsyncClient {
43+ $ asyncClient = new class () implements HttpAsyncClient {
4444 public function sendAsyncRequest (RequestInterface $ request )
4545 {
4646 return new HttpFulfilledPromise (new Response ());
4747 }
4848 };
4949
50- $ headerAppendPlugin = new HeaderAppendPlugin (['Content-Type ' => 'text/html ' ]);
50+ $ headerAppendPlugin = new HeaderAppendPlugin (['Content-Type ' => 'text/html ' ]);
5151 $ redirectPlugin = new RedirectPlugin ();
52- $ restartOncePlugin = new class implements Plugin {
52+ $ restartOncePlugin = new class () implements Plugin {
5353 private $ firstRun = true ;
5454
5555 public function handleRequest (RequestInterface $ request , callable $ next , callable $ first ): Promise
5656 {
5757 if ($ this ->firstRun ) {
5858 $ this ->firstRun = false ;
59- return $ first ($ request )->wait ();
59+
60+ return $ first ($ request );
6061 }
62+ $ this ->firstRun = true ;
63+
6164 return $ next ($ request );
6265 }
6366 };
@@ -73,4 +76,4 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
7376 yield [$ pluginClient , 'sendRequest ' , ResponseInterface::class];
7477 yield [$ pluginClient , 'sendAsyncRequest ' , Promise::class];
7578 }
76- }
79+ }
0 commit comments