File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ interface AsyncConnector
1414 * @param string $source Source.
1515 * @param ConnectionContext $context Runtime connection settings and methods.
1616 *
17- * @return \Closure Closure that returns a Promise or raw data .
17+ * @return mixed Async generator function or any return value compatible with Amp\call .
1818 */
19- public function fetchAsync (string $ source , ConnectionContext $ context ): \ Closure ;
19+ public function fetchAsync (string $ source , ConnectionContext $ context );
2020}
Original file line number Diff line number Diff line change @@ -77,7 +77,11 @@ public function fetchAsync(string $source): Promise
7777 return \ScriptFUSION \Retry \retryAsync (
7878 $ this ->maxFetchAttempts ,
7979 function () use ($ source ): Promise {
80- return \Amp \call ($ this ->connector ->fetchAsync ($ source , $ this ->connectionContext ));
80+ return \Amp \call (
81+ function () use ($ source ) {
82+ return $ this ->connector ->fetchAsync ($ source , $ this ->connectionContext );
83+ }
84+ );
8185 },
8286 $ this ->createExceptionHandler ()
8387 );
Original file line number Diff line number Diff line change 66use Amp \Delayed ;
77use Amp \Iterator ;
88use Amp \Producer ;
9- use Amp \Promise ;
109use Mockery \MockInterface ;
1110use ScriptFUSION \Porter \Connector \AsyncConnector ;
1211use ScriptFUSION \Porter \Connector \Connector ;
@@ -40,9 +39,7 @@ public static function mockProvider()
4039 ->andReturn (
4140 \Mockery::mock (AsyncConnector::class)
4241 ->shouldReceive ('fetchAsync ' )
43- ->andReturn (static function (): Promise {
44- return new Delayed (0 , 'foo ' );
45- })
42+ ->andReturn (new Delayed (0 , 'foo ' ))
4643 ->getMock ()
4744 )
4845 ->getMock ()
You can’t perform that action at this time.
0 commit comments