class ArrKeyExistenceRule implements Rule

Reports Arr::get() and Arr::pull() keys that never exist, through PHPStan's own offset check.

Upstream also reports calls that pass a default for the missing key.

Methods

string
getNodeType()

Get the node type the rule checks.

array
processNode(Node $node, Scope $scope)

Report the missing offset of an Arr::get() or Arr::pull() key that never exists.

Details

at line 34
string getNodeType()

Get the node type the rule checks.

Return Value

string

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

Report the missing offset of an Arr::get() or Arr::pull() key that never exists.

Parameters

Node $node
Scope $scope

Return Value

array