Index

Scope

MMO\client\scs · 1 symbol · generated 30 Sep 2026

class

Scope

Scope.php:15

A chain of compile-time variables (@let).

class MMO\client\scs\Scope
Namespace
MMO\client\scs
Lookup walks up to the parent scope, declaration always happens locally: a `@let` inside a block therefore shadows the outer variable of the same name instead of overwriting it (`the` spec, 38).
$global = new Scope(); $global->define('spacing', Value::Number(16, 'px')); $local = $global->child(); $local->define('spacing', Value::Number(24, 'px')); // the local one wins inside $local only

Index

parent
variables
all()
child()
define($name, $value)Declare a variable in this scope, shadowing any parent one.
get($name)
has($name)
parent()
set($name, $value)Assign to the scope that declares $name, or to this one when nothing declares it.
__construct($parent)

Properties2

parent

protected ?MMO\client\scs\Scope $parent
Type
null | Scope

variables

protected array $variables = []
Type
array

Methods8

all()

Scope.php:47
function all(): array
returnsarrayevery variable visible from this scope, the closest one winning

define($name, $value)

Scope.php:34

Declare a variable in this scope, shadowing any parent one.

function define(string $name, MMO\client\scs\Value $value): void
$namestring
$valueValue
returnsvoid

set($name, $value)

Scope.php:39

Assign to the scope that declares $name, or to this one when nothing declares it.

function set(string $name, MMO\client\scs\Value $value): void
$namestring
$valueValue
returnsvoid

__construct($parent)

Scope.php:19
function __construct(?MMO\client\scs\Scope $parent = null)
$parent = nullnull | Scope