Index

PhpFunctionRegistry

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

class

PhpFunctionRegistry

PhpFunctionRegistry.php:16

The php callables an scs source is allowed to invoke through php::name(...).

class MMO\client\scs\PhpFunctionRegistry
Namespace
MMO\client\scs
This is the whole php bridge: a function that was not explicitly registered here is simply not callable from scs, so a stylesheet can never reach arbitrary php (`the` spec, 15A and 48B.10).
$registry = new PhpFunctionRegistry(); $registry->allow('php::round', 'round'); $registry->allowContext('php::cardPadding', \App\Css\Functions::cardPadding(...));

Index

contextual
functions
allow($name, $callable)Authorize a php callable.
allowContext($name, $callable)Authorize a php callable that also receives the current EvaluationContext as its first argument.
clear()Forget every authorized function.
get($name, $origin)
has($name)
isContextual($name)
names()
Normalize($name) static

Properties2

contextual

protected array $contextual = []
Type
array

functions

protected array $functions = []
Type
array

Methods8

allow($name, $callable)

PhpFunctionRegistry.php:27

Authorize a php callable. The scs name may be given with or without its php:: namespace.

function allow(string $name, callable $callable): void
$namestringex: php::round
$callablecallableex: round(...)
returnsvoid

allowContext($name, $callable)

PhpFunctionRegistry.php:38

Authorize a php callable that also receives the current EvaluationContext as its first argument.

function allowContext(string $name, callable $callable): void
$namestring
$callablecallablefunction(EvaluationContext $context, ...$args): mixed
returnsvoid