Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/SqlCommonConnectionPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ public function __construct(

// Close connection and remove it from the pool.
$idle->shift();
/** @psalm-suppress InvalidArgument SplObjectStorage::detach() expects an argument. */
$connections->detach($connection);
/** @psalm-suppress InvalidArgument SplObjectStorage::offsetUnset() expects an argument. */
$connections->offsetUnset($connection);
$connection->close();
}
});
Expand Down Expand Up @@ -232,7 +232,7 @@ public function close(): void
public function extractConnection(): SqlConnection
{
$connection = $this->pop();
$this->connections->detach($connection);
$this->connections->offsetUnset($connection);
return $connection;
}

Expand Down Expand Up @@ -292,7 +292,7 @@ protected function pop(): SqlConnection
break 2; // Break to throwing exception.
}

$this->connections->attach($connection);
$this->connections->offsetSet($connection);
return $connection;
}

Expand All @@ -315,7 +315,7 @@ protected function pop(): SqlConnection
return $connection;
}

$this->connections->detach($connection);
$this->connections->offsetUnset($connection);
} while (!$this->isClosed());

throw new SqlException("Pool closed before an active connection could be obtained");
Expand Down
Loading