final class IntegerArgument
    implements AttributeArgument
    uses Snapshot
Public API: explicitly declared with @visibility public.

An attribute value read as a 32-bit integer, such as sspace of an aggregate.

defGetInt32 accepts only an integer node, which the grammar builds for an integer that fits in 32 bits; a larger integer or a number with a point or an exponent is a float node. Source: https://www.postgresql.org/docs/17/sql-createaggregate.html, defGetInt32 in src/backend/commands/define.c of PostgreSQL 17.

Reading the state size of an aggregatedoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE AGGREGATE total (int4) (sfunc = int4pl, stype = int4, sspace = 16)');
    $operation->statement->definition[2]->value->value() // => 16
Rejecting a number that is not a 32-bit integerdoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\IntegerArgument(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\SignedNumber(false, new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NumericConstant('2147483648'))) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public SignedNumber $number

Methods§

public function __construct(public SignedNumber $number)

Parameters

$numberSignedNumberThe integer as written
Calls 3
public function value(): int

Answers the integer.

Returns

int
Test cases 1
Calls 2
public function fits(Reading $reading): bool

Tells whether the reading reads an integer.

Parameters

$readingReading

Returns

bool
Test cases 1
Calls 1
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives nothing: a number holds no expression.

Parameters

$derivationDerivation
$environmentEnvironment
Test cases 1
public function render(Output $out): void

Writes the integer.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 7§

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 2

Relations§

Instantiated in 1
Type checks 1