classIntegerArgument
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.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE AGGREGATE total (int4) (sfunc = int4pl, stype = int4, sspace = 16)');
$operation->statement->definition[2]->value->value() // => 16new \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\InvalidConstructionProperties§
public SignedNumber $numberMethods§
public function __construct(public SignedNumber $number)Parameters
$number | SignedNumber | The integer as written |
Calls 3
- static-call Check::input() line 39
- method-call ArgumentText::integer() line 39
- new ArgumentText line 39
public function value(): intAnswers the integer.
Returns
intTest cases 1
Calls 2
- method-call ArgumentText::integer() line 47
- new ArgumentText line 47
public function fits(Reading $reading): boolTells whether the reading reads an integer.
Parameters
$reading | Reading |
Returns
boolTest cases 1
Calls 1
- class-const Reading::Integer() line 55
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives nothing: a number holds no expression.
Parameters
$derivation | Derivation | |
$environment | Environment |
Test cases 1
public function render(Output $out): voidTest cases 7§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.