final class ArrayItems
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

The bracketed items of an array constructor: [a, b], or the sub-arrays of a multidimensional array [[a], [b]].

Mirrors one level of PostgreSQL's A_ArrayExpr: an inner level is written without the ARRAY keyword. A level holds either values or sub-arrays, or nothing. Source: https://www.postgresql.org/docs/17/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS.

Reading the sub-arrays of a two-dimensional arraydoctest
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT ARRAY[[1, 2], [3, 4]]');
    [count($query->field(0)->expression->items->nested), $query->field(0)->type->descriptor->name()] // => [2, 'integer[]']

Properties§

public list<Scalar> $values
public list<ArrayItems> $nested

Methods§

public function __construct(list<Scalar> $values = [], list<ArrayItems> $nested = [])

Parameters

$valueslist<Scalar>The values in order
$nestedlist<ArrayItems>The sub-arrays in order
Calls 4
public function render(Output $out): void

Writes the values or the sub-arrays in brackets.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 8§

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

Dedicated tests 2
Other tests reaching this symbol 6

Relations§

Instantiated in 3
Type declarations 4