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 4304b27 commit 61ab509Copy full SHA for 61ab509
packages/core/src/Concerns/ContextAware.php
@@ -10,4 +10,16 @@ public function setContext(array $context): void
10
{
11
$this->context = $context;
12
}
13
+
14
+ /**
15
+ * Get a value from the context by key.
16
+ *
17
+ * @param string $key The context key to retrieve
18
+ * @param mixed $default Default value if key doesn't exist
19
+ * @return mixed The context value or default
20
+ */
21
+ public function context(string $key, mixed $default = null): mixed
22
+ {
23
+ return $this->context[$key] ?? $default;
24
+ }
25
0 commit comments