WorkerStateAnalysis
class WorkerStateAnalysis
| internal |
The worker-state model of one analysis, shared by the rules that judge collected code by the request, job or operation it runs in: the booted lifetimes, with the collected route closures and parameter reassignments.
Lifetimes come from every analyzed file and the booted application, so the model is built once from the collected data rather than per file.
Properties
| WorkerLifetimes | $lifetimes | The worker lifetimes of the booted application and the collected roots. |
Methods
Build the model from the collected data and the booted container.
Declare that a rule's errors depend on the booted application and the classes the lifetimes were read from, after the rule's queries have read them.
Describe when code in the context runs.
Get the operation the function always handles: the route action it is, a booted handler method, a helper such a method or a job calls, or else its collected context.
Determine whether the function gives the parameter another value before the code at its position.
Determine whether the container injects the global configuration repository into the function's parameter, and the function still holds it: a controller action, a route closure or a job's handler.
Determine whether a readonly property the constructor promotes holds the global configuration repository in the method's instances: the container built them and injects that repository.
Determine whether a readonly property the constructor promotes holds the instance the container shares for the worker in the method's instances: the container built them and injects that instance.
Details
at line 63
__construct(CollectedDataNode $node, ReflectionProvider $reflectionProvider, Container $container, RuntimeInputs $runtimeInputs)
Build the model from the collected data and the booted container.
at line 132
void
track(Scope $scope)
Declare that a rule's errors depend on the booted application and the classes the lifetimes were read from, after the rule's queries have read them.
at line 149
static string
describeContext(string $context)
Describe when code in the context runs.
at line 167
string|null
getContext(array $function, string $file)
Get the operation the function always handles: the route action it is, a booted handler method, a helper such a method or a job calls, or else its collected context.
A registration is better evidence than the class alone: a queueable class's handle() registered as a passive observer runs synchronously during its event.
at line 185
bool
isReassigned(array $function, string $parameter, string $file)
Determine whether the function gives the parameter another value before the code at its position.
at line 198
bool
isInjectedConfig(array $function, string $parameter, string $file)
Determine whether the container injects the global configuration repository into the function's parameter, and the function still holds it: a controller action, a route closure or a job's handler.
at line 221
bool
isPromotedConfig(array $function, string $constructor, string $property)
Determine whether a readonly property the constructor promotes holds the global configuration repository in the method's instances: the container built them and injects that repository.
at line 235
bool
sharesPromotedProperty(array $function, string $constructor, string $property)
Determine whether a readonly property the constructor promotes holds the instance the container shares for the worker in the method's instances: the container built them and injects that instance.