Skip to content

Internals Context Context

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

context\Context

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/context/Context.php · Snapshot 8411f4287706.

Context carries the current package root, name and ID. Context events let consumers request or replace that information through the dispatcher.

Context

Declaration and architectural role

final class Context

Constants, enum cases, traits and properties

Declarations below preserve visibility, type, default and modifiers exactly. A typed property without an initializer remains uninitialized until its constructor or another method assigns it. Mutable fields belong to this instance unless marked static; readonly fields can be initialized once. Constructor-promoted properties are also listed below.

Member Declaration Purpose or source contract
Constructor-promoted public string $contextPath Initialized from the constructor argument; default expression is evaluated when the argument is omitted.
Constructor-promoted public string $contextName Initialized from the constructor argument; default expression is evaluated when the argument is omitted.
Constructor-promoted public string $contextId Initialized from the constructor argument; default expression is evaluated when the argument is omitted.

Method index

Method Signature
__construct public function __construct( public string $contextPath, public string $contextName, public string $contextId, )

__construct

Source line 7

public function __construct(
        public string $contextPath,
        public string $contextName,
        public string $contextId,
    )

Parameters

Parameter Type, modifiers and default Purpose
$contextPath public string $contextPath Operation input; the exact use, validation and propagation are shown in the implementation trace.
$contextName public string $contextName Operation input; the exact use, validation and propagation are shown in the implementation trace.
$contextId public string $contextId Operation input; the exact use, validation and propagation are shown in the implementation trace.

State writes: $this->contextPath, $this->contextName, $this->contextId.

Implementation, validation guards and interaction order
public function __construct(
        public string $contextPath,
        public string $contextName,
        public string $contextId,
    ) {
        $this->contextPath = $contextPath;
        $this->contextName = $contextName;
        $this->contextId = $contextId;
    }

Clone this wiki locally