@@ -71,7 +71,7 @@ public function testItCanTryAcquireLockWithinTransaction(
71
71
accessMode: $ accessMode ,
72
72
);
73
73
74
- $ this ->assertTrue ($ isLockAcquired-> wasAcquired );
74
+ $ this ->assertTrue ($ isLockAcquired );
75
75
$ this ->assertPgAdvisoryLocksCount (1 );
76
76
$ this ->assertPgAdvisoryLockExistsInConnection ($ dbConnection , $ lockKey , $ accessMode );
77
77
}
@@ -177,8 +177,7 @@ public function testItCannotAcquireSameLockInTwoConnections(): void
177
177
$ dbConnection1 = $ this ->initPostgresPdoConnection ();
178
178
$ dbConnection2 = $ this ->initPostgresPdoConnection ();
179
179
$ lockKey = PostgresLockKey::create ('test ' );
180
- // TODO: Fix corner-case: without variable its self-destructing instantly
181
- $ connection1Lock = $ locker ->acquireSessionLevelLock (
180
+ $ locker ->acquireSessionLevelLock (
182
181
$ dbConnection1 ,
183
182
$ lockKey ,
184
183
);
@@ -200,7 +199,7 @@ public function testItCanReleaseLock(
200
199
$ locker = $ this ->initLocker ();
201
200
$ dbConnection = $ this ->initPostgresPdoConnection ();
202
201
$ lockKey = PostgresLockKey::create ('test ' );
203
- $ connectionLock = $ locker ->acquireSessionLevelLock (
202
+ $ locker ->acquireSessionLevelLock (
204
203
$ dbConnection ,
205
204
$ lockKey ,
206
205
accessMode: $ accessMode ,
@@ -236,7 +235,7 @@ public function testItCanNotReleaseLockOfDifferentModes(
236
235
$ locker = $ this ->initLocker ();
237
236
$ dbConnection = $ this ->initPostgresPdoConnection ();
238
237
$ lockKey = PostgresLockKey::create ('test ' );
239
- $ connectionLock = $ locker ->acquireSessionLevelLock (
238
+ $ locker ->acquireSessionLevelLock (
240
239
$ dbConnection ,
241
240
$ lockKey ,
242
241
accessMode: $ acquireMode ,
@@ -272,11 +271,11 @@ public function testItCanReleaseLockTwiceIfAcquiredTwice(): void
272
271
$ locker = $ this ->initLocker ();
273
272
$ dbConnection = $ this ->initPostgresPdoConnection ();
274
273
$ lockKey = PostgresLockKey::create ('test ' );
275
- $ connectionLock1 = $ locker ->acquireSessionLevelLock (
274
+ $ locker ->acquireSessionLevelLock (
276
275
$ dbConnection ,
277
276
$ lockKey ,
278
277
);
279
- $ connectionLock2 = $ locker ->acquireSessionLevelLock (
278
+ $ locker ->acquireSessionLevelLock (
280
279
$ dbConnection ,
281
280
$ lockKey ,
282
281
);
@@ -320,11 +319,11 @@ public function testItCannotAcquireLockInSecondConnectionAfterOneReleaseTwiceLoc
320
319
$ dbConnection1 = $ this ->initPostgresPdoConnection ();
321
320
$ dbConnection2 = $ this ->initPostgresPdoConnection ();
322
321
$ lockKey = PostgresLockKey::create ('test ' );
323
- $ connection1Lock1 = $ locker ->acquireSessionLevelLock (
322
+ $ locker ->acquireSessionLevelLock (
324
323
$ dbConnection1 ,
325
324
$ lockKey ,
326
325
);
327
- $ connection1Lock2 = $ locker ->acquireSessionLevelLock (
326
+ $ locker ->acquireSessionLevelLock (
328
327
$ dbConnection1 ,
329
328
$ lockKey ,
330
329
);
@@ -360,7 +359,7 @@ public function testItCannotReleaseLockIfAcquiredInOtherConnection(): void
360
359
$ dbConnection1 = $ this ->initPostgresPdoConnection ();
361
360
$ dbConnection2 = $ this ->initPostgresPdoConnection ();
362
361
$ lockKey = PostgresLockKey::create ('test ' );
363
- $ connection1Lock = $ locker ->acquireSessionLevelLock (
362
+ $ locker ->acquireSessionLevelLock (
364
363
$ dbConnection1 ,
365
364
$ lockKey ,
366
365
);
@@ -413,19 +412,19 @@ public function testItCanReleaseAllLocksInConnectionButKeepsOtherConnectionLocks
413
412
$ lockKey2 = PostgresLockKey::create ('test2 ' );
414
413
$ lockKey3 = PostgresLockKey::create ('test3 ' );
415
414
$ lockKey4 = PostgresLockKey::create ('test4 ' );
416
- $ connect1Lock1 = $ locker ->acquireSessionLevelLock (
415
+ $ locker ->acquireSessionLevelLock (
417
416
$ dbConnection1 ,
418
417
$ lockKey1 ,
419
418
);
420
- $ connect1Lock2 = $ locker ->acquireSessionLevelLock (
419
+ $ locker ->acquireSessionLevelLock (
421
420
$ dbConnection1 ,
422
421
$ lockKey2 ,
423
422
);
424
- $ connect2Lock3 = $ locker ->acquireSessionLevelLock (
423
+ $ locker ->acquireSessionLevelLock (
425
424
$ dbConnection2 ,
426
425
$ lockKey3 ,
427
426
);
428
- $ connect2Lock4 = $ locker ->acquireSessionLevelLock (
427
+ $ locker ->acquireSessionLevelLock (
429
428
$ dbConnection2 ,
430
429
$ lockKey4 ,
431
430
);
@@ -461,7 +460,7 @@ public function testItCannotAcquireLockInSecondConnectionIfTakenWithinTransactio
461
460
$ dbConnection2 = $ this ->initPostgresPdoConnection ();
462
461
$ lockKey = PostgresLockKey::create ('test ' );
463
462
$ dbConnection1 ->beginTransaction ();
464
- $ connection1Lock = $ locker ->acquireSessionLevelLock (
463
+ $ locker ->acquireSessionLevelLock (
465
464
$ dbConnection1 ,
466
465
$ lockKey ,
467
466
);
0 commit comments