Skip to content

Commit 0205b4b

Browse files
committed
Leave only *Handler API
1 parent e37960f commit 0205b4b

File tree

4 files changed

+118
-118
lines changed

4 files changed

+118
-118
lines changed

src/Postgres/LockHandle/SessionLevelLockHandle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class SessionLevelLockHandle
2828
public function __construct(
2929
private readonly PDO $dbConnection,
3030
private readonly PostgresAdvisoryLocker $locker,
31-
public readonly PostgresLockKey $lockId,
31+
public readonly PostgresLockKey $lockKey,
3232
public readonly PostgresLockAccessModeEnum $accessMode,
3333
public readonly bool $wasAcquired,
3434
) {}
@@ -49,7 +49,7 @@ public function release(): bool
4949

5050
$wasReleased = $this->locker->releaseSessionLevelLock(
5151
$this->dbConnection,
52-
$this->lockId,
52+
$this->lockKey,
5353
);
5454

5555
if ($wasReleased) {

test/Integration/AbstractIntegrationTestCase.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,39 +44,39 @@ protected function initPostgresPdoConnection(): PDO
4444

4545
protected function assertPgAdvisoryLockExistsInConnection(
4646
PDO $dbConnection,
47-
PostgresLockKey $postgresLockId,
47+
PostgresLockKey $postgresLockKey,
4848
PostgresLockAccessModeEnum $mode = PostgresLockAccessModeEnum::Exclusive,
4949
): void {
5050
$row = $this->findPostgresAdvisoryLockInConnection(
5151
$dbConnection,
52-
$postgresLockId,
52+
$postgresLockKey,
5353
$mode,
5454
);
5555

56-
$lockIdString = $postgresLockId->humanReadableValue;
56+
$lockKeyString = $postgresLockKey->humanReadableValue;
5757

5858
$this->assertTrue(
5959
$row !== null,
60-
"Lock id `$lockIdString` does not exists",
60+
"Lock id `$lockKeyString` does not exists",
6161
);
6262
}
6363

6464
protected function assertPgAdvisoryLockMissingInConnection(
6565
PDO $dbConnection,
66-
PostgresLockKey $postgresLockId,
66+
PostgresLockKey $postgresLockKey,
6767
PostgresLockAccessModeEnum $mode = PostgresLockAccessModeEnum::Exclusive,
6868
): void {
6969
$row = $this->findPostgresAdvisoryLockInConnection(
7070
$dbConnection,
71-
$postgresLockId,
71+
$postgresLockKey,
7272
$mode,
7373
);
7474

75-
$lockIdString = $postgresLockId->humanReadableValue;
75+
$lockKeyString = $postgresLockKey->humanReadableValue;
7676

7777
$this->assertTrue(
7878
$row === null,
79-
"Lock id `$lockIdString` is present",
79+
"Lock id `$lockKeyString` is present",
8080
);
8181
}
8282

@@ -95,7 +95,7 @@ protected function assertPgAdvisoryLocksCount(
9595

9696
private function findPostgresAdvisoryLockInConnection(
9797
PDO $dbConnection,
98-
PostgresLockKey $postgresLockId,
98+
PostgresLockKey $postgresLockKey,
9999
PostgresLockAccessModeEnum $mode,
100100
): object | null {
101101
$statement = $dbConnection->prepare(
@@ -112,8 +112,8 @@ private function findPostgresAdvisoryLockInConnection(
112112
);
113113
$statement->execute(
114114
[
115-
'lock_class_id' => $postgresLockId->classId,
116-
'lock_object_id' => $postgresLockId->objectId,
115+
'lock_class_id' => $postgresLockKey->classId,
116+
'lock_object_id' => $postgresLockKey->objectId,
117117
'lock_object_subid' => 2, // Using two keyed locks
118118
'connection_pid' => $dbConnection->pgsqlGetPid(),
119119
'mode' => $mode->value,

0 commit comments

Comments
 (0)