Value Object representing a Compound Type.

A Compound Type is not so much a special keyword or object reference but is a series of Types that are separated using an OR operator (|). This combination of types signifies that whatever is associated with this compound type may contain a value with any of the given types.

CloneableFinalInstantiableIterable
ImplementsIteratorAggregate
Traversable
phpDocumentor\Reflection\Type
Methods
public __construct(array $types)
 
Initializes a compound type (i.e. `string|int`) and tests if the provided types all implement the Type interface.

  • throws InvalidArgumentException When types are not all instance of Type.
public __toString() : string
 
Returns a rendered output of the Type as it would be used in a DocBlock.

public get(int $index) : phpDocumentor\Reflection\Type
 
Returns the type at the given index.

public getIterator()
 


    public has(int $index) : bool
     
    Tests if this compound type has a type with the given index.

    Properties
    private $types
     


    • var Type[]
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only