RequestDependentBindingRule
class RequestDependentBindingRule implements Rule
| internal |
Reports a #[BindWhen] condition whose code, including its nested callbacks, contains a read of the current request or user.
A matched condition becomes a binding for the worker's lifetime, so the first request it matches selects the implementation for every later one. Conditions are read from source, never executed, so whether a nested callback actually runs isn't known.
Traits
Constants
| private AUTH_READS |
The lowercase auth methods that read the current user. |
| private REQUEST_CONTEXT_READS |
The lowercase RequestContext methods that read the current request or its values. |
Properties
| protected Container|null | $container | from HasContainer |
Methods
Create a new request-dependent binding rule instance.
Get the node type the rule checks.
Report each #[BindWhen] condition on the class that reads request or user state.
Details
in
HasContainer at line 19
void
setContainer(Container $container)
Set the container used for resolution.
in
HasContainer at line 27
Container
getContainer()
Return the current container.
in
HasContainer at line 35
mixed
resolve(string $abstract)
Resolve the given type from the container.
at line 89
__construct(ReflectionProvider $reflectionProvider, RuntimeInputs $runtimeInputs, WorkerStateHelper $workerStateHelper, ConstructorParser $constructorParser, CoroutineRuleHelper $coroutineRuleHelper, ScopeFactory $scopeFactory, Parser $parser)
Create a new request-dependent binding rule instance.
at line 104
string
getNodeType()
Get the node type the rule checks.
at line 117
array
processNode(Node $node, Scope $scope)
Report each #[BindWhen] condition on the class that reads request or user state.