classOperandMismatch
final class OperandMismatch
implements Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.An operand whose type the construct does not accept.
Source: https://www.postgresql.org/docs/17/functions-logical.html.
(new \SqlSemantics\Platform\PostgreSql\Statement\Expression\Problem\OperandMismatch('AND', 'boolean', 'integer'))->message() // => 'Argument of AND must be type boolean, not type integer.'Properties§
public string $constructpublic string $expectedpublic string $actualMethods§
public function __construct(
public string $construct,
public string $expected,
public string $actual,
)Parameters
$construct | string | The construct, such as 'AND' |
$expected | string | The type the construct needs |
$actual | string | The type of the operand |
public function message(): stringDescribes the problem.
Returns
stringTest cases 1
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 3
Relations§
Instantiated in 3
- new SqlSemantics\Platform\PostgreSql\Rules\Expression\OperandChecks::boolean() packages/sql-semantics-postgres/src/Rules/Expression/OperandChecks.php:50
- new SqlSemantics\Platform\PostgreSql\Rules\Expression\OperandChecks::accepted() packages/sql-semantics-postgres/src/Rules/Expression/OperandChecks.php:67
- new SqlSemantics\Platform\PostgreSql\Rules\Expression\Typing\Sublinks::elements() packages/sql-semantics-postgres/src/Rules/Expression/Typing/Sublinks.php:124