classAttributeProblem
final class AttributeProblem
implements Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.A problem the defining command reports about the attributes of CREATE AGGREGATE, OPERATOR, TYPE, COLLATION or TEXT SEARCH.
Source: https://www.postgresql.org/docs/17/sql-createoperator.html, https://www.postgresql.org/docs/17/sql-createaggregate.html.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE OPERATOR === (rightarg = int4, function = int4eq, colour = red)');
[$operation->facts->diagnostics[0]->message(), $operation->facts->diagnostics[0]->warning()] // => ['operator attribute "colour" not recognized', true]Properties§
public list<string> $subjectspublic AttributeProblemKind $kindMethods§
public function __construct(public AttributeProblemKind $kind, list<string> $subjects = [])Parameters
$kind | AttributeProblemKind | What is wrong |
$subjects | list<string> | The names and texts the message mentions, in order |
Calls 4
- static-call Check::input() line 36
- function-call
substr_countline 36 - method-call AttributeProblemKind::format() line 36
- function-call
countline 36
public function message(): stringDescribes the problem as the server does.
Returns
stringTest cases 5
DefineChecksTest::testBaseTypeReportsTheMissingOutputFunctioncallsDefineChecksTest::testOperatorTellsAMissingRightArgumentFromMissingArgumentscallsDefineChecksTest::testProvidedReportsWhatOnlyIcuTakescallsDefineChecksTest::testSearchReportsAConfigurationWithParserAndCopycallsAttributeProblemTest::testMessageInsertsEverySubjectcalls
Calls 2
- function-call
vsprintfline 45 - method-call AttributeProblemKind::format() line 45
public function warning(): boolTells whether the server only warns and goes on.
Returns
boolTest cases 1
Calls 1
- method-call AttributeProblemKind::warning() line 53
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 5
DefineChecksTest::testBaseTypeReportsTheMissingOutputFunctioncallsDefineChecksTest::testOperatorTellsAMissingRightArgumentFromMissingArgumentscallsDefineChecksTest::testProvidedReportsWhatOnlyIcuTakescallsDefineChecksTest::testSearchReportsAConfigurationWithParserAndCopycallsDefineTest::testDeriveStatementReportsMissingAttributescalls
Relations§
Instantiated in 36
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::derive() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:88
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::unrecognized() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:103
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::value() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:118
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::value() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:119
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::value() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:120
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:134
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:137
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:142
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:143
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:144
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:145
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:146
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:147
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:148
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:149
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:150
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\ChangeChecks::problem() packages/sql-semantics-postgres/src/Rules/Routine/ChangeChecks.php:63
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\ChangeChecks::problem() packages/sql-semantics-postgres/src/Rules/Routine/ChangeChecks.php:66
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::range() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:88
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::operator() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:122
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::operator() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:125
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::aggregate() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:143
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::aggregate() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:151
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::aggregate() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:154
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::aggregate() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:159
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::aggregate() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:162
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::aggregate() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:165
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::baseType() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:182
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::baseType() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:185
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::baseType() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:188
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::collation() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:206
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::provided() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:230
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::provided() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:235
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::provided() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:238
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::search() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:256
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::search() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:267
Type checks 1
Type declarations 4
- type SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:99
- type SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:109
- type SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:128
- type SqlSemantics\Platform\PostgreSql\Rules\Routine\ChangeChecks packages/sql-semantics-postgres/src/Rules/Routine/ChangeChecks.php:58