Skip to content

Commit 550d089

Browse files
committed
fix: psalm
1 parent e25711f commit 550d089

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Internal/Support/Facade.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ abstract class Facade
2020
*/
2121
private const ERROR_NO_CONTEXT =
2222
'Calling facade methods can only be made ' .
23-
'from the currently running process'
24-
;
23+
'from the currently running process';
2524

2625
private static ?object $ctx = null;
2726

@@ -51,7 +50,12 @@ public static function getCurrentContext(): ?object
5150
*/
5251
public static function getContextId(): int
5352
{
54-
return \spl_object_id(static::getCurrentContext());
53+
$context = static::getCurrentContext();
54+
if ($context === null) {
55+
throw new \RuntimeException(self::ERROR_NO_CONTEXT);
56+
}
57+
58+
return \spl_object_id($context);
5559
}
5660

5761
/**

0 commit comments

Comments
 (0)