File tree Expand file tree Collapse file tree 6 files changed +6
-15
lines changed Expand file tree Collapse file tree 6 files changed +6
-15
lines changed Original file line number Diff line number Diff line change 1515 "clue/redis-protocol" : " 0.3.*" ,
1616 "evenement/evenement" : " ^3.0 || ^2.0 || ^1.0" ,
1717 "react/event-loop" : " ^1.2" ,
18- "react/promise" : " ^3 || ^2.0 || ^1.1 " ,
18+ "react/promise" : " ^3" ,
1919 "react/promise-timer" : " ^1.10" ,
2020 "react/socket" : " ^1.15"
2121 },
Original file line number Diff line number Diff line change @@ -6,10 +6,7 @@ parameters:
66 - src/
77 - tests/
88
9- reportUnmatchedIgnoredErrors: false
109 ignoreErrors:
11- # ignore generic usage like `PromiseInterface<T>` for Promise v2/v1
12- - '/^PHPDoc tag @return contains generic type React\\Promise\\PromiseInterface<.+> but interface React\\Promise\\PromiseInterface is not generic\.$/'
1310 # ignore undefined methods due to magic `__call()` method
1411 - '/^Call to an undefined method Clue\\React\\Redis\\RedisClient::.+\(\)\.$/'
1512 - '/^Call to an undefined method Clue\\React\\Redis\\Io\\StreamingClient::.+\(\)\.$/'
Original file line number Diff line number Diff line change @@ -80,7 +80,6 @@ public function createClient(string $uri): PromiseInterface
8080 unset($ parts ['path ' ]);
8181 }
8282
83- /** @var PromiseInterface<ConnectionInterface> $connecting */
8483 $ connecting = $ this ->connector ->connect ($ authority );
8584
8685 $ deferred = new Deferred (function ($ _ , $ reject ) use ($ connecting , $ uri ) {
@@ -96,7 +95,6 @@ public function createClient(string $uri): PromiseInterface
9695 }, function () {
9796 // ignore to avoid reporting unhandled rejection
9897 });
99- assert (\method_exists ($ connecting , 'cancel ' ));
10098 $ connecting ->cancel ();
10199 });
102100
Original file line number Diff line number Diff line change @@ -229,7 +229,6 @@ public function close(): void
229229 // ignore to avoid reporting unhandled rejection
230230 });
231231 if ($ this ->promise !== null ) {
232- assert (\method_exists ($ this ->promise , 'cancel ' ));
233232 $ this ->promise ->cancel ();
234233 $ this ->promise = null ;
235234 }
Original file line number Diff line number Diff line change @@ -459,7 +459,6 @@ public function testCancelWillRejectPromise(): void
459459
460460 $ promise = $ this ->factory ->createClient ('redis://127.0.0.1:2 ' );
461461
462- assert (method_exists ($ promise , 'cancel ' ));
463462 $ promise ->cancel ();
464463
465464 $ promise ->then (null , $ this ->expectCallableOnceWith ($ this ->isInstanceOf (\RuntimeException::class)));
@@ -542,7 +541,6 @@ public function testCancelWillRejectWithUriInMessageAndCancelConnectorWhenConnec
542541
543542 $ promise = $ this ->factory ->createClient ($ uri );
544543
545- assert (method_exists ($ promise , 'cancel ' ));
546544 $ promise ->cancel ();
547545
548546 $ promise ->then (null , $ this ->expectCallableOnceWith (
@@ -568,7 +566,6 @@ public function testCancelWillCloseConnectionWhenConnectionWaitsForSelect(): voi
568566
569567 $ promise = $ this ->factory ->createClient ('redis://127.0.0.1:2/123 ' );
570568
571- assert (method_exists ($ promise , 'cancel ' ));
572569 $ promise ->cancel ();
573570
574571 $ promise ->then (null , $ this ->expectCallableOnceWith (
Original file line number Diff line number Diff line change 22
33namespace Clue \Tests \React \Redis ;
44
5- use PHPUnit \Framework \MockObject \MockBuilder ;
65use PHPUnit \Framework \MockObject \MockObject ;
76use PHPUnit \Framework \TestCase as BaseTestCase ;
87use React \Promise \PromiseInterface ;
@@ -39,12 +38,13 @@ protected function expectCallableNever(): callable
3938
4039 protected function createCallableMock (): MockObject
4140 {
42- if (method_exists (MockBuilder::class, 'addMethods ' )) {
43- // @phpstan-ignore-next-line requires PHPUnit 9+
44- return $ this ->getMockBuilder (\stdClass::class)->addMethods (['__invoke ' ])->getMock ();
41+ $ builder = $ this ->getMockBuilder (\stdClass::class);
42+ if (method_exists ($ builder , 'addMethods ' )) {
43+ // PHPUnit 9+
44+ return $ builder ->addMethods (['__invoke ' ])->getMock ();
4545 } else {
4646 // legacy PHPUnit < 9
47- return $ this -> getMockBuilder (\stdClass::class) ->setMethods (['__invoke ' ])->getMock ();
47+ return $ builder ->setMethods (['__invoke ' ])->getMock ();
4848 }
4949 }
5050
You can’t perform that action at this time.
0 commit comments