Skip to content

Internals Runtime RuntimeFlagHandler

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

runtime\RuntimeFlagHandler

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/runtime/RuntimeFlagHandler.php · Snapshot 8411f4287706.

Runtime state, package API classes, loader, executor and orchestrator have separate responsibilities. Dependency validation precedes package code and nested execution restores context.

Imports and dependencies

use runtime\enums\ERuntimeFlags;
use runtime\interface\IRuntimeFlagHandler;

RuntimeFlagHandler

Declaration and architectural role

final class RuntimeFlagHandler implements IRuntimeFlagHandler

Constants, enum cases, traits and properties

No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.

Method index

Method Signature
normalize public function normalize(array $flags): array

normalize

Source line 10

public function normalize(array $flags): array

Parameters

Parameter Type, modifiers and default Purpose
$flags array $flags List of runtime flag cases; invalid non-enum entries fail normalization.

Validate and deduplicate native runtime flags.

Return expressions (including local callbacks): array_values($normalized).

Explicit exceptions: \InvalidArgumentException. The guards in the implementation below show when each is raised; exceptions from collaborators also propagate unless caught.

Implementation, validation guards and interaction order
/** Validate and deduplicate native runtime flags. */
    public function normalize(array $flags): array
    {
        $normalized = [];
        foreach ($flags as $flag) {
            if (!$flag instanceof ERuntimeFlags) {
                throw new \InvalidArgumentException('Runtime flags must be ERuntimeFlags cases.');
            }
            $normalized[$flag->name] = $flag;
        }
        return array_values($normalized);
    }

Related types

Clone this wiki locally