CollectionDescriptor

Implements \phpDocumentor\Descriptor\Interfaces\TypeInterface

Descriptor representing a collection or compound type of collection object.

This descriptor represents any type that is capable of containing other typed values. Examples of such types can be an array, DoctrineCollection or ArrayObject.

package

Default

Methods

Initializes this type collection with its base-type.

__construct(\phpDocumentor\Descriptor\Interfaces\TypeInterface $baseType) 

Returns a human-readable representation for this type.

__toString() : string

Response

string

Returns the base type for this Collection or null if there is no attached type.

getBaseType() : \phpDocumentor\Descriptor\Interfaces\TypeInterface|null

When the presented collection is governed by an object (such as a Collection object) then a reference to that object will be returned. If however the base type for this collection is a simple type such as an 'array' then we return null to indicate there is no object governing this type.

Response

\phpDocumentor\Descriptor\Interfaces\TypeInterface|null

Registers the type, or set of types, to which a *key* in this type of collection can belong.

getKeyTypes() : array<mixed,\phpDocumentor\Descriptor\Interfaces\TypeInterface>

Returns the name for this type.

getName() : \phpDocumentor\Descriptor\Interfaces\TypeInterface

Returns the type, or set of types, to which a value in this type of collection can belong.

getTypes() : array<mixed,\phpDocumentor\Descriptor\Interfaces\TypeInterface>

Registers the base type for this collection type.

setBaseType(string|\phpDocumentor\Descriptor\Interfaces\TypeInterface $baseType) : void

Registers the type, or set of types, to which a *key* in this type of collection can belong.

setKeyTypes(array<mixed,\phpDocumentor\Descriptor\Interfaces\TypeInterface> $types) : void

Register the type, or set of types, to which a value in this type of collection can belong.

setTypes(array<mixed,\phpDocumentor\Descriptor\Interfaces\TypeInterface> $types) : void

Properties

baseType

baseType : \phpDocumentor\Descriptor\Interfaces\TypeInterface|string

types

types : array<mixed,\phpDocumentor\Descriptor\Interfaces\TypeInterface>

keyTypes

keyTypes : array<mixed,\phpDocumentor\Descriptor\Interfaces\TypeInterface>