class NoCoroutinesInTransactionsRule implements Rule

Reports child coroutines started inside a database transaction callback.

A child coroutine borrows its own pooled connection, so its queries run outside the transaction the parent coroutine owns.

Constants

private SPAWNING_NAMES

The lowercase short names of the functions and methods below.

private SPAWNING_FUNCTIONS

The functions that start child coroutines.

private SPAWNING_METHODS

The lowercase methods that start child coroutines, by declaring class.

private TASK_PARAMETERS

The names of the task-list parameters that spawning functions and methods take.

Methods

__construct(ReflectionProvider $reflectionProvider, ConcurrencyDriverHelper $concurrencyDriverHelper, CoroutineRuleHelper $coroutineRuleHelper)

Create a new coroutines in transactions rule instance.

string
getNodeType()

Get the node type the rule checks.

array
processNode(Node $node, Scope $scope)

Report coroutine-starting calls that run inside a transaction callback.

Details

at line 106
__construct(ReflectionProvider $reflectionProvider, ConcurrencyDriverHelper $concurrencyDriverHelper, CoroutineRuleHelper $coroutineRuleHelper)

Create a new coroutines in transactions rule instance.

Parameters

ReflectionProvider $reflectionProvider
ConcurrencyDriverHelper $concurrencyDriverHelper
CoroutineRuleHelper $coroutineRuleHelper

at line 116
string getNodeType()

Get the node type the rule checks.

Return Value

string

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

Report coroutine-starting calls that run inside a transaction callback.

Parameters

Node $node
Scope $scope

Return Value

array