Menu

## ArrayKey extends AggregatedType
in package
implements PseudoType

ArrayKey.php : 26

Value Object representing a array-key Type.

A array-key Type is the supertype (but not a union) of int and string.

##### Tags

psalm-immutable

### Interfaces, Classes and Traits

PseudoType

### Table of Contents

$token : string
$types : array<int, Type>
__construct() : mixed
__toString() : string
  Returns a rendered output of the Type as it would be used in a DocBlock.
contains() : bool
  Tests if this compound type contains the given type.
get() : Type|null
  Returns the type at the given index.
getIterator() : ArrayIterator<int, Type>
has() : bool
  Tests if this compound type has a type with the given index.
underlyingType() : Type
add() : void

### Properties

#### $token

AggregatedType.php : 40
`private string $token`

#### $types

AggregatedType.php : 37
`private array<int, Type> $types = []`

##### Tags

psalm-allow-private-mutation

### Methods

#### __construct()

ArrayKey.php : 28
`public __construct() : mixed`

##### Return values

mixed —

#### __toString()

ArrayKey.php : 38

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

`public __toString() : string`

##### Return values

string —

#### contains()

AggregatedType.php : 77

Tests if this compound type contains the given type.

`public contains(Type $type) : bool`

##### Parameters

$type : Type

##### Return values

bool —

#### get()

AggregatedType.php : 57

Returns the type at the given index.

`public get(int $index) : Type|null`

##### Parameters

$index : int

##### Return values

Type|null —

#### getIterator()

AggregatedType.php : 100
`public getIterator() : ArrayIterator<int, Type>`

##### Return values

ArrayIterator<int, Type> —

#### has()

AggregatedType.php : 69

Tests if this compound type has a type with the given index.

`public has(int $index) : bool`

##### Parameters

$index : int

##### Return values

bool —

#### underlyingType()

ArrayKey.php : 33
`public underlyingType() : Type`

##### Return values

Type —

#### add()

AggregatedType.php : 108
`private add(Type $type) : void`

##### Parameters

$type : Type

##### Tags

psalm-suppress

  ImpureMethodCall

##### Return values

void —

## Search results