class WorkerStateRule implements Rule

Reports request and operation state kept in worker-shared objects, static properties, global variables and config, and request-keyed caches that grow for the worker's lifetime.

One rule serves the four switches, because PHPStan cannot register a rule when any of several parameters is on, and so one write gets one diagnostic: an unbounded cache before shared or static state. Lifetimes come from the booted application, so they are applied here rather than collected.

Constants

private STATE_LABELS

How diagnostics describe each kind of request or operation state.

private SHARED_TIP

private STATIC_TIP

private CACHE_TIP

private CONFIG_TIP

Methods

__construct(WorkerStateHelper $helper)

Create a new worker state rule instance.

string
getNodeType()

Get the node type the rule inspects.

array
processNode(Node $node, Scope $scope)

Report the collected writes and config changes that keep request state for the worker.

Details

at line 63
__construct(WorkerStateHelper $helper)

Create a new worker state rule instance.

Parameters

WorkerStateHelper $helper

at line 71
string getNodeType()

Get the node type the rule inspects.

Return Value

string

at line 84
array processNode(Node $node, Scope $scope)

Report the collected writes and config changes that keep request state for the worker.

Parameters

Node $node
Scope $scope

Return Value

array