Skip to content

Commit c388a77

Browse files
committed
Standardize nullable type hints to 'null|Type' order
Refactors type hints and docblocks across the codebase to consistently use the 'null|Type' order for nullable types, improving code readability and alignment with modern PHP standards. No functional changes are introduced; this is a documentation and type annotation update only.
1 parent 3252949 commit c388a77

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Annotation/BlockableAspect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint)
3030
{
3131
$arguments = $proceedingJoinPoint->arguments['keys'] ?? [];
3232
$annotationMetadata = $proceedingJoinPoint->getAnnotationMetadata();
33-
/** @var Blockable|null $annotation */
33+
/** @var null|Blockable $annotation */
3434
$annotation = $annotationMetadata->method[Blockable::class] ?? null;
3535

3636
if (! $annotation || $annotation->seconds <= 0) {

src/Driver/AbstractLock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function betweenBlockedAttemptsSleepFor($milliseconds): self
124124
/**
125125
* Determine whether this lock is owned by the given identifier.
126126
*
127-
* @param string|null $owner
127+
* @param null|string $owner
128128
*/
129129
public function isOwnedBy($owner): bool
130130
{

src/Driver/CoroutineLock.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ class CoroutineLock extends AbstractLock
2525
protected static array $channels = [];
2626

2727
/**
28-
* @var WeakMap<Channel, string>|null
28+
* @var null|WeakMap<Channel, string>
2929
*/
3030
protected static ?WeakMap $owners = null;
3131

3232
protected static ?Timer $timer = null;
3333

3434
/**
35-
* @var WeakMap<Channel, int>|null
35+
* @var null|WeakMap<Channel, int>
3636
*/
3737
protected static ?WeakMap $timers = null;
3838

src/Driver/LockInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface LockInterface
1818
/**
1919
* Attempt to acquire the lock.
2020
* @template T
21-
* @param (callable(): T)|null $callback
21+
* @param null|(callable(): T) $callback
2222
* @return ($callback is null ? bool : T)
2323
*/
2424
public function get(?callable $callback = null);
@@ -27,7 +27,7 @@ public function get(?callable $callback = null);
2727
* Attempt to acquire the lock for the given number of seconds.
2828
*
2929
* @template T
30-
* @param (callable(): T)|null $callback
30+
* @param null|(callable(): T) $callback
3131
* @return ($callback is null ? bool : T)
3232
* @throws LockTimeoutException
3333
*/

0 commit comments

Comments
 (0)