final class Parameter
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A parameter marker: ?, or :name when the language profile reads named parameters.

Rule: MYSQL-PARAMETER-001. Facts: the type and the NULL fact depend on the value bound at execution, which no context holds; the fact names the marker as the missing input. Diagnostics: none. Source: https://dev.mysql.com/doc/refman/8.4/en/prepare.html. Status: Implemented.

Naming the unbound parameter a fact depends ondoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE a = ?');
    $query->facts->scalar($query->statement->where->right)->type->missing[0]->describe() // => 'the value bound to parameter ?'

Properties§

public string $marker = '?'

Methods§

public function __construct(public string $marker = '?')

Parameters

$markerstringThe marker as written: `?` or `:name`
Calls 2
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the dependence on the bound value.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 4
public function render(Output $out): void

Writes the marker.

Parameters

$outOutput
Calls 1

Test cases 10§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5
Other tests reaching this symbol 5

Relations§

Instantiated in 1
Type checks 5
Type declarations 1