CoroutineRuleHelper
class CoroutineRuleHelper
Constants
| private NATIVE_WAITS |
The native channel, WaitGroup, Waiter and join methods, keyed by declaring class, that a try may call and still
keep an exact catch: each either doesn't wait or throws cancellation directly. |
Properties
| Node> | $found |
Methods
Determine whether the name is Swoole's cancellation exception.
Get whether the condition is a Coroutine::causedByCancellation() guard on the variable (true), the guard negated (false), or neither (null).
Determine whether the statements end by leaving their block through one of the given statement or expression types.
Determine whether the node writes the variable: =, =& or a compound assignment, including through destructuring, a foreach key or value, or a catch binding.
Get the targets the node writes, such as variables and properties: through =, =& or a compound assignment, including destructuring, a foreach key or value, or a catch binding.
Get the targets a write assigns, such as variables and properties, through destructuring.
Get the destructuring leaves the target binds by reference, such as $value in [&$value] = $items.
Get the plain variable a reference assignment binds to one of the given variables or an offset of it, and
that root: $alias =& $root['key'], or $root['key'] =& $alias. A plain variable assigned by reference is
only re-pointed, so it never passes its old binding on. A property isn't followed, since a property can
return other storage by reference than its object's.
Get the variable names the node unbinds from what they were bound to, such as a global or a caller's by-reference variable: unset(), a static declaration, or binding the variable itself by reference through =&, a by-reference foreach value or a by-reference destructuring item. Unsetting or binding an offset or property by reference writes through the binding instead.
No description
Details
at line 297
__construct(Closure $filter, string|null $variable)
No description
at line 95
bool
isCancellation(Name $name)
Determine whether the name is Swoole's cancellation exception.
at line 104
bool|null
guardPolarity(Expr $condition, string $variable)
Get whether the condition is a Coroutine::causedByCancellation() guard on the variable (true), the guard negated (false), or neither (null).
at line 137
bool
endsWith(array $statements, array $exits)
Determine whether the statements end by leaving their block through one of the given statement or expression types.
at line 155
bool
assigns(Node $node, string $variable)
Determine whether the node writes the variable: =, =& or a compound assignment, including through destructuring, a foreach key or value, or a catch binding.
at line 166
static array
getWriteTargets(Node $node)
Get the targets the node writes, such as variables and properties: through =, =& or a compound assignment, including destructuring, a foreach key or value, or a catch binding.
at line 181
static array
getTargetLeaves(Expr|null $target)
Get the targets a write assigns, such as variables and properties, through destructuring.
at line 205
static array
getReferenceLeaves(Expr|null $target)
Get the destructuring leaves the target binds by reference, such as $value in [&$value] = $items.
at line 232
static array|null
getStorageAlias(AssignRef $node, array $roots)
Get the plain variable a reference assignment binds to one of the given variables or an offset of it, and
that root: $alias =& $root['key'], or $root['key'] =& $alias. A plain variable assigned by reference is
only re-pointed, so it never passes its old binding on. A property isn't followed, since a property can
return other storage by reference than its object's.
at line 257
static array
getDetachedNames(Node $node)
Get the variable names the node unbinds from what they were bound to, such as a global or a caller's by-reference variable: unset(), a static declaration, or binding the variable itself by reference through =&, a by-reference foreach value or a by-reference destructuring item. Unsetting or binding an offset or property by reference writes through the binding instead.
at line 288
array
find(array $statements, Closure $filter, string|null $variable = null)
Find the matching nodes in the statements, skipping the bodies of nested functions and classes, and of nested catches that bind the given variable again, since it names another exception there.
at line 303
int|null
enterNode(Node $node)
No description