Skip to content

Commit 735da17

Browse files
luzrainkelunik
authored andcommitted
Fix php 8.5 deprecation
1 parent 6e8ffd1 commit 735da17

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/SqlCommonConnectionPool.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ public function __construct(
138138

139139
// Close connection and remove it from the pool.
140140
$idle->shift();
141-
/** @psalm-suppress InvalidArgument SplObjectStorage::detach() expects an argument. */
142-
$connections->detach($connection);
141+
/** @psalm-suppress InvalidArgument SplObjectStorage::offsetUnset() expects an argument. */
142+
$connections->offsetUnset($connection);
143143
$connection->close();
144144
}
145145
});
@@ -232,7 +232,7 @@ public function close(): void
232232
public function extractConnection(): SqlConnection
233233
{
234234
$connection = $this->pop();
235-
$this->connections->detach($connection);
235+
$this->connections->offsetUnset($connection);
236236
return $connection;
237237
}
238238

@@ -292,7 +292,7 @@ protected function pop(): SqlConnection
292292
break 2; // Break to throwing exception.
293293
}
294294

295-
$this->connections->attach($connection);
295+
$this->connections->offsetSet($connection);
296296
return $connection;
297297
}
298298

@@ -315,7 +315,7 @@ protected function pop(): SqlConnection
315315
return $connection;
316316
}
317317

318-
$this->connections->detach($connection);
318+
$this->connections->offsetUnset($connection);
319319
} while (!$this->isClosed());
320320

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

0 commit comments

Comments
 (0)