classExpressionReader
final class ExpressionReader
Restricted visibility: declared "@visibility ZtdQuery\Platform\MySql". Code outside that scope must not name this declaration.
Expression Reader.
Methods§
public function parseOr(
string $sql,
string $tableName,
?string $incomingAlias,
list<SqlToken> $tokens,
int &$index,
): UpsertExpressionParameters
$sql | string | |
$tableName | string | |
$incomingAlias | ?string | |
$tokens | list<SqlToken> | |
$index | int |
Returns
Test cases 1
Called from 2
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parsePrimary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:190
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\MySqlUpsertExpressionParser::parse() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/MySqlUpsertExpressionParser.php:25
Calls 3
- method-call ExpressionReader::parseAnd() line 31
- static-call UpsertExpression::binary() line 34
- class-const UpsertExpressionKind::Or() line 35
public function parseAnd(
string $sql,
string $tableName,
?string $incomingAlias,
list<SqlToken> $tokens,
int &$index,
): UpsertExpressionParameters
$sql | string | |
$tableName | string | |
$incomingAlias | ?string | |
$tokens | list<SqlToken> | |
$index | int |
Returns
Test cases 1
Called from 2
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseOr() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:31
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseOr() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:37
Calls 3
- method-call ExpressionReader::parseComparison() line 54
- static-call UpsertExpression::binary() line 57
- class-const UpsertExpressionKind::And() line 58
public function parseComparison(
string $sql,
string $tableName,
?string $incomingAlias,
list<SqlToken> $tokens,
int &$index,
): UpsertExpressionParameters
$sql | string | |
$tableName | string | |
$incomingAlias | ?string | |
$tokens | list<SqlToken> | |
$index | int |
Returns
Test cases 1
Called from 2
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseAnd() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:54
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseAnd() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:60
Calls 3
- method-call ExpressionReader::parseAdditive() line 77
- method-call ExpressionReader::comparisonOperator() line 78
- static-call UpsertExpression::binary() line 83
public function parseAdditive(
string $sql,
string $tableName,
?string $incomingAlias,
list<SqlToken> $tokens,
int &$index,
): UpsertExpressionParameters
$sql | string | |
$tableName | string | |
$incomingAlias | ?string | |
$tokens | list<SqlToken> | |
$index | int |
Returns
Test cases 1
Called from 2
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseComparison() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:77
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseComparison() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:86
Calls 6
- method-call ExpressionReader::parseMultiplicative() line 100
- class-const SqlTokenKind::Symbol() line 101
- function-call
in_arrayline 101 - class-const UpsertExpressionKind::Add() line 104
- class-const UpsertExpressionKind::Subtract() line 104
- static-call UpsertExpression::binary() line 105
public function parseMultiplicative(
string $sql,
string $tableName,
?string $incomingAlias,
list<SqlToken> $tokens,
int &$index,
): UpsertExpressionParameters
$sql | string | |
$tableName | string | |
$incomingAlias | ?string | |
$tokens | list<SqlToken> | |
$index | int |
Returns
Called from 2
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseAdditive() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:100
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseAdditive() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:108
Calls 7
- method-call ExpressionReader::parseUnary() line 125
- class-const SqlTokenKind::Symbol() line 126
- function-call
in_arrayline 126 - class-const UpsertExpressionKind::Multiply() line 130
- class-const UpsertExpressionKind::Divide() line 131
- class-const UpsertExpressionKind::Modulo() line 131
- static-call UpsertExpression::binary() line 132
public function parseUnary(
string $sql,
string $tableName,
?string $incomingAlias,
list<SqlToken> $tokens,
int &$index,
): UpsertExpressionParameters
$sql | string | |
$tableName | string | |
$incomingAlias | ?string | |
$tokens | list<SqlToken> | |
$index | int |
Returns
Test cases 1
Called from 4
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseMultiplicative() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:125
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseMultiplicative() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:135
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseUnary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:158
- method-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseUnary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:166
Calls 8
- static-call UpsertExpression::unary() line 156
- class-const UpsertExpressionKind::Not() line 157
- method-call ExpressionReader::parseUnary() line 158
- class-const SqlTokenKind::Symbol() line 161
- function-call
in_arrayline 161 - class-const UpsertExpressionKind::UnaryPlus() line 165
- class-const UpsertExpressionKind::UnaryMinus() line 165
- method-call ExpressionReader::parsePrimary() line 170
public function parsePrimary(
string $sql,
string $tableName,
?string $incomingAlias,
list<SqlToken> $tokens,
int &$index,
): UpsertExpressionParameters
$sql | string | |
$tableName | string | |
$incomingAlias | ?string | |
$tokens | list<SqlToken> | |
$index | int |
Returns
Throws
Test cases 1
Called from 1
Calls 14
- new UnsupportedSqlException line 186
- class-const SqlTokenKind::Symbol() line 188
- function-call
in_arrayline 188 - method-call ExpressionReader::parseOr() line 190
- class-const SqlTokenKind::Number() line 198
- static-call UpsertExpression::literal() line 201
- method-call LiteralReader::number() line 201
- new LiteralReader line 201
- class-const SqlTokenKind::String() line 203
- method-call StringLiteral::string() line 206
- new StringLiteral line 206
- class-const SqlTokenKind::Word() line 218
- class-const SqlTokenKind::QuotedIdentifier() line 218
- method-call ExpressionReader::parseColumnReference() line 222
public function parseValuesReference(
string $sql,
list<SqlToken> $tokens,
int &$index,
): UpsertExpressionParameters
$sql | string | |
$tokens | list<SqlToken> | |
$index | int |
Returns
Throws
Test cases 1
Called from 1
Calls 9
- class-const SqlTokenKind::Word() line 234
- class-const SqlTokenKind::QuotedIdentifier() line 234
- new UnsupportedSqlException line 235
- class-const SqlTokenKind::Symbol() line 238
- function-call
in_arrayline 238 - static-call UpsertExpression::column() line 243
- class-const UpsertColumnSource::Incoming() line 243
- method-call LiteralReader::identifier() line 243
- new LiteralReader line 243
public function columnSource(
string $sql,
string $qualifier,
string $tableName,
?string $incomingAlias,
): UpsertColumnSourceColumn Source for the supplied MySQL input.
Parameters
$sql | string | |
$qualifier | string | |
$tableName | string | |
$incomingAlias | ?string |
Returns
Throws
Test cases 1
Called from 1
Calls 4
- function-call
strcasecmpline 256 - class-const UpsertColumnSource::Incoming() line 257
- class-const UpsertColumnSource::Existing() line 260
- new UnsupportedSqlException line 263
public function comparisonOperator(
string $sql,
list<SqlToken> $tokens,
int &$index,
): ?UpsertExpressionKindParameters
$sql | string | |
$tokens | list<SqlToken> | |
$index | int |
Returns
Throws
Test cases 1
Called from 1
Calls 9
- class-const SqlTokenKind::Symbol() line 273
- function-call
in_arrayline 273 - class-const UpsertExpressionKind::Equal() line 285
- class-const UpsertExpressionKind::NotEqual() line 286
- class-const UpsertExpressionKind::Less() line 287
- class-const UpsertExpressionKind::LessOrEqual() line 288
- class-const UpsertExpressionKind::Greater() line 289
- class-const UpsertExpressionKind::GreaterOrEqual() line 290
- new UnsupportedSqlException line 291
public function parseColumnReference(
string $sql,
string $tableName,
?string $incomingAlias,
list<SqlToken> $tokens,
int &$index,
): UpsertExpressionParameters
$sql | string | |
$tableName | string | |
$incomingAlias | ?string | |
$tokens | list<SqlToken> | |
$index | int |
Returns
Throws
Called from 1
Calls 12
- method-call LiteralReader::identifier() line 302
- new LiteralReader line 302
- function-call
strcasecmpline 304 - class-const SqlTokenKind::Symbol() line 305
- function-call
in_arrayline 305 - new UnsupportedSqlException line 306
- method-call ExpressionReader::parseValuesReference() line 309
- class-const SqlTokenKind::Word() line 314
- class-const SqlTokenKind::QuotedIdentifier() line 314
- static-call UpsertExpression::column() line 319
- method-call ExpressionReader::columnSource() line 320
- class-const UpsertColumnSource::Existing() line 325
Test cases 17§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 11
ExpressionReaderTest::testColumnSourceDistinguishesIncomingAliascallsExpressionReaderTest::testComparisonOperatorConsumesCompositeSymbolscallsExpressionReaderTest::testParseAdditiveEvaluatesTheConsumedExpressioncallsExpressionReaderTest::testParseAndEvaluatesTheConsumedExpressioncallsExpressionReaderTest::testParseColumnReferenceEvaluatesTheConsumedExpressioncallsExpressionReaderTest::testParseComparisonEvaluatesTheConsumedExpressioncallsExpressionReaderTest::testParseMultiplicativeEvaluatesTheConsumedExpressioncallsExpressionReaderTest::testParseOrEvaluatesTheConsumedExpressioncallsExpressionReaderTest::testParsePrimaryEvaluatesTheConsumedExpressioncallsExpressionReaderTest::testParseUnaryEvaluatesTheConsumedExpressioncallsExpressionReaderTest::testParseValuesReferenceReadsIncomingColumncalls
Other tests reaching this symbol 6
MySqlSessionFactoryTestcallsMySqlRewriterTestcallsStatementRewriterTestcallsRowMutationResolverTestcallsMySqlUpsertExpressionParserTestcallsMySqlMutationResolverTestcalls