Skip to content

Internals Vfs Resource Event ContextSwitchEvent

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

vfs\resource\event\ContextSwitchEvent

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/vfs/resource/event/ContextSwitchEvent.php · Snapshot 8411f4287706.

VFS includes package resource lookup, database-backed file metadata, filesystem collaborators, transient pools and persistent PHP-array caches.

Imports and dependencies

use event\interfaces\IEvent;
use event\interfaces\IEventListener;

ContextSwitchEvent

Declaration and architectural role

class ContextSwitchEvent implements IEventListener

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
$contextName public string $contextName; Used by handle().

Method index

Method Signature
handle public function handle(IEvent $event): array

handle

Source line 11

public function handle(IEvent $event): array

Parameters

Parameter Type, modifiers and default Purpose
$event IEvent $event Event object; its name selects listeners and its bundle carries their payload.

Return expressions (including local callbacks): [].

Implementation, validation guards and interaction order
public function handle(IEvent $event): array
    {
        $context = $event->bundle()['context'];
        $context->context = $this->contextName;
        return [];
    }

Related types

Clone this wiki locally