File tree Expand file tree Collapse file tree 4 files changed +23
-6
lines changed Expand file tree Collapse file tree 4 files changed +23
-6
lines changed Original file line number Diff line number Diff line change 2020 "require" : {
2121 "php" : " >=8.0" ,
2222 "amphp/amp" : " v2.6.*" ,
23- "amphp/socket" : " v1.1 .*" ,
23+ "amphp/socket" : " v1.2 .*" ,
2424 "phpinnacle/buffer" : " v1.2.*"
2525 },
2626 "require-dev" : {
2727 "phpunit/phpunit" : " v9.5.*" ,
28- "vimeo/psalm" : " v4.13 .*" ,
29- "phpstan/phpstan" : " v1.2 .*"
28+ "vimeo/psalm" : " v4.18 .*" ,
29+ "phpstan/phpstan" : " v1.4 .*"
3030 },
3131 "prefer-stable" : true ,
3232 "autoload" : {
5252 },
5353 "config" : {
5454 "sort-packages" : true ,
55- "optimize-autoloader" : true
55+ "optimize-autoloader" : true ,
56+ "allow-plugins" : {
57+ "composer/package-versions-deprecated" : false
58+ }
5659 }
5760}
Original file line number Diff line number Diff line change 11parameters :
22 checkMissingIterableValueType : false
33 checkGenericClassInNonGenericObjectType : false
4- ignoreErrors :
5- - ' #Cannot cast mixed to int #'
4+
Original file line number Diff line number Diff line change @@ -136,6 +136,8 @@ function () {
136136
137137 $ this ->connection ->write ($ buffer );
138138 $ this ->connection ->close ();
139+
140+ $ this ->disableConnectionMonitor ();
139141 }
140142 );
141143
@@ -161,6 +163,8 @@ function(): void
161163 */
162164 public function disconnect (int $ code = 0 , string $ reason = '' ): Promise
163165 {
166+ $ this ->disableConnectionMonitor ();
167+
164168 return call (
165169 function () use ($ code , $ reason ) {
166170 if (\in_array ($ this ->state , [self ::STATE_NOT_CONNECTED , self ::STATE_DISCONNECTING ])) {
@@ -446,4 +450,13 @@ static function (Protocol\AbstractFrame $frame) use ($deferred) {
446450
447451 return $ deferred ->promise ();
448452 }
453+
454+ private function disableConnectionMonitor (): void {
455+ if ($ this ->connectionMonitorWatcherId !== null ) {
456+
457+ Loop::cancel ($ this ->connectionMonitorWatcherId );
458+
459+ $ this ->connectionMonitorWatcherId = null ;
460+ }
461+ }
449462}
Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ protected function runTestAsync(...$args)
5353
5454 $ return = yield call ([$ this , $ this ->realTestName ], ...$ args );
5555
56+ yield $ client ->disconnect ();
57+
5658 $ info = Loop::getInfo ();
5759 $ count = $ info ['enabled_watchers ' ]['referenced ' ];
5860
You can’t perform that action at this time.
0 commit comments