class CancellationPrecedenceRule implements Rule

Reports caught exceptions kept with ??=, which loses a later failure's cancellation.

Constants

private EXITS

The statements that leave a guard's cancellation branch, so the statements after the guard see only ordinary failures.

Methods

__construct(CoroutineRuleHelper $coroutineRuleHelper, ExprPrinter $exprPrinter)

Create a new cancellation precedence rule instance.

string
getNodeType()

Get the node type the rule checks.

array
processNode(Node $node, Scope $scope)

Report ??= assignments that may keep an ordinary failure over a caught exception.

Details

at line 51
__construct(CoroutineRuleHelper $coroutineRuleHelper, ExprPrinter $exprPrinter)

Create a new cancellation precedence rule instance.

Parameters

CoroutineRuleHelper $coroutineRuleHelper
ExprPrinter $exprPrinter

at line 60
string getNodeType()

Get the node type the rule checks.

Return Value

string

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

Report ??= assignments that may keep an ordinary failure over a caught exception.

Parameters

Node $node
Scope $scope

Return Value

array