classInformationItem
final class InformationItem
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One assignment of GET DIAGNOSTICS: a target and the information item it receives.
The target is a user variable, or the name of a parameter or local variable of the stored program that holds the statement. Source: https://dev.mysql.com/doc/refman/8.4/en/get-diagnostics.html.
$get = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('GET DIAGNOSTICS @n = NUMBER, @r = ROW_COUNT');
[$get->statement->information->items[1]->target->name->value, $get->statement->information->items[1]->item->value] // => ['r', 'ROW_COUNT']Properties§
public Name|UserVariable $targetpublic ConditionItemName|StatementItemName $itemMethods§
public function __construct(
public Name|UserVariable $target,
public ConditionItemName|StatementItemName $item,
)Parameters
$target | Name|UserVariable | The variable that receives the item: a user variable or the name of a parameter or local variable |
$item | ConditionItemName|StatementItemName | The information item read |
public function render(Output $out): voidWrites the target, the equals sign and the item.
Parameters
$out | Output |
Test cases 2
Calls 4
- method-call Output::name() line 45
- class-const NameUse::Identifier() line 45
- method-call Output::node() line 47
- method-call Output::symbol() line 49
Test cases 12§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 10
DiagnosticsRuleTest::testItemsLowersEveryConditionItemNamecallsDiagnosticsRuleTest::testItemsLowersLocalVariableTargetscallsDiagnosticsRuleTest::testStatementLowersConditionInformationcallsDiagnosticsRuleTest::testStatementLowersStatementInformationcallsConditionDiagnosticsTest::testRefusesAStatementInformationItemcallsConditionDiagnosticsTest::testRenderWritesTheAnalyzedInformationcallsConditionDiagnosticsTest::testRenderWritesTheNumberAndTheItemscallsStatementDiagnosticsTest::testRefusesAConditionInformationItemcallsStatementDiagnosticsTest::testRenderWritesTheAnalyzedInformationcallsStatementDiagnosticsTest::testRenderWritesTheItemscalls
Relations§
Instantiated in 1
Constant reads 2
- class-const SqlSemantics\Platform\MySql\Statement\Routine\Condition\Diagnostics\ConditionDiagnostics::__construct() packages/sql-semantics-mysql/src/Statement/Routine/Condition/Diagnostics/ConditionDiagnostics.php:39
- class-const SqlSemantics\Platform\MySql\Statement\Routine\Condition\Diagnostics\StatementDiagnostics::__construct() packages/sql-semantics-mysql/src/Statement/Routine/Condition/Diagnostics/StatementDiagnostics.php:36