Skip to content

Commit

Permalink
Fixes for Psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
descawed committed Nov 2, 2020
1 parent 18f7781 commit 8caee75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/Connection/ConnectionLimitingPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,10 @@ private function removeWaiting(string $uri, int $deferredId): void

private function dropConnection(string $uri, ?int $connectionId, int $promiseId): void
{
unset($this->connections[$uri][$promiseId], $this->activeRequestCounts[$connectionId], $this->idleConnections[$connectionId]);
unset($this->connections[$uri][$promiseId]);
if ($connectionId !== null) {
unset($this->activeRequestCounts[$connectionId], $this->idleConnections[$connectionId]);
}

if ($this->connections[$uri]->count() === 0) {
unset($this->connections[$uri], $this->waitForPriorConnection[$uri]);
Expand Down
3 changes: 2 additions & 1 deletion test/Connection/ConnectionLimitingPoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ private function createMockClosableConnection(Request $request): Promise
->method('close')
->willReturnCallback(static function () use (&$content, &$closeHandlers, $connection) {
$content = 'closed';
foreach ($closeHandlers as $closeHandler)
foreach ($closeHandlers as $closeHandler) {
asyncCall($closeHandler, $connection);
}
return new Success;
});
$connection->method('onClose')
Expand Down

0 comments on commit 8caee75

Please sign in to comment.