AspectCollector
class AspectCollector
Static registry of aspect class rules and priorities.
Tracks which aspect classes target which classes/methods, and their execution priority. Used by ProxyManager to determine which classes need proxy generation and by ProxyDispatcher at runtime to resolve the aspect pipeline for each method call.
Properties
| static protected array<string, array{priority: int, classes: array<int, string>}> | $aspectRules | Aspect rules indexed by aspect class name. |
Methods
Register an aspect with its class targeting 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 31
static void
setAround(string $aspect, array $classes, int|null $priority = null)
Register an aspect with its class targeting rules.
Boot-only. 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 51
static bool
hasAspects()
Determine if any aspects have been registered.
at line 62
static void
forgetAspect(string $aspect)
Remove a specific aspect from the registry.
Tests only. Mutates the worker-wide aspect registry; runtime use cannot retroactively update already-generated proxies.
at line 72
static array
getClassRules()
Get the class-targeting rules for every registered aspect.
at line 88
static array
getRule(string $aspect)
Get the rules for a specific aspect.
at line 96
static int
getPriority(string $aspect)
Get the priority for a specific aspect.
at line 106
static array
getRules()
Get all aspect rules.
at line 114
static void
flushState()
Flush all static state.