ArrayShape
extends Array_
in package
implements
PseudoType
Represents an array type as described in the PSR-5, the PHPDoc Standard.
Tags
Table of Contents
Interfaces
Properties
- $defaultKeyType : Type
- $defaultValueType : Type
- $keyType : Type|null
- $valueType : Type|null
- $items : array<string|int, ArrayShapeItem>
Methods
- __construct() : mixed
- Initializes this representation of an array with the given Type.
- __toString() : string
- Returns a rendered output of the Type as it would be used in a DocBlock.
- getItems() : array<string|int, ArrayShapeItem>
- getKeyType() : Type
- Returns the type for the keys of this array.
- getOriginalKeyType() : Type|null
- getOriginalValueType() : Type|null
- getValueType() : Type
- Returns the type for the values of this array.
- underlyingType() : Type
Properties
$defaultKeyType
protected
Type
$defaultKeyType
$defaultValueType
protected
Type
$defaultValueType
$keyType
protected
Type|null
$keyType
$valueType
protected
Type|null
$valueType
$items
private
array<string|int, ArrayShapeItem>
$items
Methods
__construct()
Initializes this representation of an array with the given Type.
public
__construct(ArrayShapeItem ...$items) : mixed
Parameters
- $items : ArrayShapeItem
__toString()
Returns a rendered output of the Type as it would be used in a DocBlock.
public
__toString() : string
Return values
stringgetItems()
public
getItems() : array<string|int, ArrayShapeItem>
Return values
array<string|int, ArrayShapeItem>getKeyType()
Returns the type for the keys of this array.
public
getKeyType() : Type
Return values
TypegetOriginalKeyType()
public
getOriginalKeyType() : Type|null
Return values
Type|nullgetOriginalValueType()
public
getOriginalValueType() : Type|null
Return values
Type|nullgetValueType()
Returns the type for the values of this array.
public
getValueType() : Type
Return values
TypeunderlyingType()
public
underlyingType() : Type