Skip to content

Commit

Permalink
Merge pull request #41 from WyriHaximus-labs/always_ensure_we_have_a_…
Browse files Browse the repository at this point in the history
…connection_at_index_0

Always ensure we have a connection at index 0
  • Loading branch information
mbonneau authored Aug 19, 2019
2 parents 5422773 + 88d0cdb commit 61658fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PgAsync/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ private function createNewConnection()
$this->connections[] = $connection;

$connection->on('close', function () use ($connection) {
$this->connections = array_filter($this->connections, function ($c) use ($connection) {
$this->connections = array_values(array_filter($this->connections, function ($c) use ($connection) {
return $connection !== $c;
});
}));
});

return $connection;
Expand Down

0 comments on commit 61658fe

Please sign in to comment.