We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e25711f commit 550d089Copy full SHA for 550d089
src/Internal/Support/Facade.php
@@ -20,8 +20,7 @@ abstract class Facade
20
*/
21
private const ERROR_NO_CONTEXT =
22
'Calling facade methods can only be made ' .
23
- 'from the currently running process'
24
- ;
+ 'from the currently running process';
25
26
private static ?object $ctx = null;
27
@@ -51,7 +50,12 @@ public static function getCurrentContext(): ?object
51
50
52
public static function getContextId(): int
53
{
54
- return \spl_object_id(static::getCurrentContext());
+ $context = static::getCurrentContext();
+ if ($context === null) {
55
+ throw new \RuntimeException(self::ERROR_NO_CONTEXT);
56
+ }
57
+
58
+ return \spl_object_id($context);
59
}
60
61
/**
0 commit comments