Type Resolver

Collection extends AbstractList
in package

FinalYes

Represents a collection type as described in the PSR-5, the PHPDoc Standard.

A collection can be represented in two forms:

  1. ACollectionObject<aValueType>
  2. ACollectionObject<aValueType,aKeyType>
  • ACollectionObject can be 'array' or an object that can act as an array
  • aValueType and aKeyType can be any type expression
Tags
psalm-immutable

Table of Contents

Properties

$defaultKeyType  : Type
$keyType  : Type|null
$valueType  : Type
$fqsen  : Fqsen|null

Methods

__construct()  : mixed
Initializes this representation of an array with the given Type or Fqsen.
__toString()  : string
Returns a rendered output of the Type as it would be used in a DocBlock.
getFqsen()  : Fqsen|null
Returns the FQSEN associated with this object.
getKeyType()  : Type
Returns the type for the keys of this array.
getValueType()  : Type
Returns the type for the values of this array.

Properties

Methods

__construct()

Initializes this representation of an array with the given Type or Fqsen.

public __construct(Fqsen|null $fqsen, Type $valueType[, Type|null $keyType = null ]) : mixed
Parameters
$fqsen : Fqsen|null
$valueType : Type
$keyType : Type|null = null

__toString()

Returns a rendered output of the Type as it would be used in a DocBlock.

public __toString() : string
Return values
string

getFqsen()

Returns the FQSEN associated with this object.

public getFqsen() : Fqsen|null
Return values
Fqsen|null

getKeyType()

Returns the type for the keys of this array.

public getKeyType() : Type
Return values
Type

getValueType()

Returns the type for the values of this array.

public getValueType() : Type
Return values
Type

        
On this page

Search results