@@ -71,7 +71,7 @@ public function testItCanTryAcquireLockWithinTransaction(
7171 accessMode: $ accessMode ,
7272 );
7373
74- $ this ->assertTrue ($ isLockAcquired-> wasAcquired );
74+ $ this ->assertTrue ($ isLockAcquired );
7575 $ this ->assertPgAdvisoryLocksCount (1 );
7676 $ this ->assertPgAdvisoryLockExistsInConnection ($ dbConnection , $ lockKey , $ accessMode );
7777 }
@@ -177,8 +177,7 @@ public function testItCannotAcquireSameLockInTwoConnections(): void
177177 $ dbConnection1 = $ this ->initPostgresPdoConnection ();
178178 $ dbConnection2 = $ this ->initPostgresPdoConnection ();
179179 $ lockKey = PostgresLockKey::create ('test ' );
180- // TODO: Fix corner-case: without variable its self-destructing instantly
181- $ connection1Lock = $ locker ->acquireSessionLevelLock (
180+ $ locker ->acquireSessionLevelLock (
182181 $ dbConnection1 ,
183182 $ lockKey ,
184183 );
@@ -200,7 +199,7 @@ public function testItCanReleaseLock(
200199 $ locker = $ this ->initLocker ();
201200 $ dbConnection = $ this ->initPostgresPdoConnection ();
202201 $ lockKey = PostgresLockKey::create ('test ' );
203- $ connectionLock = $ locker ->acquireSessionLevelLock (
202+ $ locker ->acquireSessionLevelLock (
204203 $ dbConnection ,
205204 $ lockKey ,
206205 accessMode: $ accessMode ,
@@ -236,7 +235,7 @@ public function testItCanNotReleaseLockOfDifferentModes(
236235 $ locker = $ this ->initLocker ();
237236 $ dbConnection = $ this ->initPostgresPdoConnection ();
238237 $ lockKey = PostgresLockKey::create ('test ' );
239- $ connectionLock = $ locker ->acquireSessionLevelLock (
238+ $ locker ->acquireSessionLevelLock (
240239 $ dbConnection ,
241240 $ lockKey ,
242241 accessMode: $ acquireMode ,
@@ -272,11 +271,11 @@ public function testItCanReleaseLockTwiceIfAcquiredTwice(): void
272271 $ locker = $ this ->initLocker ();
273272 $ dbConnection = $ this ->initPostgresPdoConnection ();
274273 $ lockKey = PostgresLockKey::create ('test ' );
275- $ connectionLock1 = $ locker ->acquireSessionLevelLock (
274+ $ locker ->acquireSessionLevelLock (
276275 $ dbConnection ,
277276 $ lockKey ,
278277 );
279- $ connectionLock2 = $ locker ->acquireSessionLevelLock (
278+ $ locker ->acquireSessionLevelLock (
280279 $ dbConnection ,
281280 $ lockKey ,
282281 );
@@ -320,11 +319,11 @@ public function testItCannotAcquireLockInSecondConnectionAfterOneReleaseTwiceLoc
320319 $ dbConnection1 = $ this ->initPostgresPdoConnection ();
321320 $ dbConnection2 = $ this ->initPostgresPdoConnection ();
322321 $ lockKey = PostgresLockKey::create ('test ' );
323- $ connection1Lock1 = $ locker ->acquireSessionLevelLock (
322+ $ locker ->acquireSessionLevelLock (
324323 $ dbConnection1 ,
325324 $ lockKey ,
326325 );
327- $ connection1Lock2 = $ locker ->acquireSessionLevelLock (
326+ $ locker ->acquireSessionLevelLock (
328327 $ dbConnection1 ,
329328 $ lockKey ,
330329 );
@@ -360,7 +359,7 @@ public function testItCannotReleaseLockIfAcquiredInOtherConnection(): void
360359 $ dbConnection1 = $ this ->initPostgresPdoConnection ();
361360 $ dbConnection2 = $ this ->initPostgresPdoConnection ();
362361 $ lockKey = PostgresLockKey::create ('test ' );
363- $ connection1Lock = $ locker ->acquireSessionLevelLock (
362+ $ locker ->acquireSessionLevelLock (
364363 $ dbConnection1 ,
365364 $ lockKey ,
366365 );
@@ -413,19 +412,19 @@ public function testItCanReleaseAllLocksInConnectionButKeepsOtherConnectionLocks
413412 $ lockKey2 = PostgresLockKey::create ('test2 ' );
414413 $ lockKey3 = PostgresLockKey::create ('test3 ' );
415414 $ lockKey4 = PostgresLockKey::create ('test4 ' );
416- $ connect1Lock1 = $ locker ->acquireSessionLevelLock (
415+ $ locker ->acquireSessionLevelLock (
417416 $ dbConnection1 ,
418417 $ lockKey1 ,
419418 );
420- $ connect1Lock2 = $ locker ->acquireSessionLevelLock (
419+ $ locker ->acquireSessionLevelLock (
421420 $ dbConnection1 ,
422421 $ lockKey2 ,
423422 );
424- $ connect2Lock3 = $ locker ->acquireSessionLevelLock (
423+ $ locker ->acquireSessionLevelLock (
425424 $ dbConnection2 ,
426425 $ lockKey3 ,
427426 );
428- $ connect2Lock4 = $ locker ->acquireSessionLevelLock (
427+ $ locker ->acquireSessionLevelLock (
429428 $ dbConnection2 ,
430429 $ lockKey4 ,
431430 );
@@ -461,7 +460,7 @@ public function testItCannotAcquireLockInSecondConnectionIfTakenWithinTransactio
461460 $ dbConnection2 = $ this ->initPostgresPdoConnection ();
462461 $ lockKey = PostgresLockKey::create ('test ' );
463462 $ dbConnection1 ->beginTransaction ();
464- $ connection1Lock = $ locker ->acquireSessionLevelLock (
463+ $ locker ->acquireSessionLevelLock (
465464 $ dbConnection1 ,
466465 $ lockKey ,
467466 );
0 commit comments