classArrayTyping
final class ArrayTyping
Types an array constructor.
Rule: PG-ARRAY-TYPING-001. Every value of every level is derived in order. The element type is the common type of the values (PG-UNIFICATION-001), unknown-typed values giving text; when the values are themselves arrays, or the levels hold sub-arrays, the array is multidimensional and keeps the element type, since PostgreSQL arrays of any dimension share one type. A constructor without values has the element type unknown until a cast gives it one. Termination: the levels are walked with an explicit stack. Source: https://www.postgresql.org/docs/17/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS. Status: Implemented.
Methods§
public function items(
Derivation $derivation,
Environment $environment,
ArrayItems $items,
): TypeFactDerives the values of the items and answers the type of the array.
Parameters
$derivation | Derivation | |
$environment | Environment | |
$items | ArrayItems |
Returns
Test cases 1
Called from 1
Calls 10
- function-call
array_shiftline 42 - method-call Derivation::scalar() line 44
- function-call
array_pushline 46 - new Known line 49
- new ArrayOf line 49
- class-const Builtin::Unknown() line 49
- method-call Unification::resolve() line 51
- new Unification line 51
- function-call
in_arrayline 52 - method-call Derivation::report() line 53
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.