AspectCollector
class AspectCollector
Worker-wide aspect rules used to generate proxies and compile dispatch chains.
Properties
| static protected array<string, array{priority: int, classes: array<int, string>}> | $aspectRules | Aspect rules indexed by aspect class name. |
|
| static protected bool | $sealed |
Methods
Register an aspect using its public default targeting rules and priority.
Register an aspect with its class targeting rules.
Close aspect registration after application proxy generation.
Reopen aspect registration while retaining the registered rules.
Determine if any aspects have been registered.
Remove a specific aspect from the registry.
Get the class-targeting rules for every registered aspect.
Get the rules for a specific aspect.
Get the priority for a specific aspect.
Get all aspect rules.
Flush all static state.
Details
at line 36
static void
register(string $aspect)
Register an aspect using its public default targeting rules and priority.
Register before application proxy generation, or explicitly reopen registration for focused tests. Loaded classes cannot be rewritten.
at line 63
static void
setAround(string $aspect, array $classes, int|null $priority = null)
Register an aspect with its class targeting rules.
Aspect rules persist in a static property used by the compile-time proxy generator; runtime use cannot retroactively apply aspects to already-loaded classes.
at line 93
static void
seal()
Close aspect registration after application proxy generation.
Later registrations in this worker are rejected.
at line 105
static void
unseal()
Reopen aspect registration while retaining the registered rules.
This permits changes to worker-wide rules for a new application bootstrap or focused tests; it does not rewrite loaded classes.
at line 114
static bool
hasAspects()
Determine if any aspects have been registered.
at line 125
static void
forgetAspect(string $aspect)
Remove a specific aspect from the registry.
Mutates the worker-wide aspect registry; runtime use cannot retroactively update already-generated proxies.
at line 138
static array
getClassRules()
Get the class-targeting rules for every registered aspect.
at line 154
static array
getRule(string $aspect)
Get the rules for a specific aspect.
at line 162
static int
getPriority(string $aspect)
Get the priority for a specific aspect.
at line 172
static array
getRules()
Get all aspect rules.
at line 180
static void
flushState()
Flush all static state.