public static function collectionOf(IType $elementType, string $collectionClass = ITypedCollection::class) : CollectionType
    {
        $elementTypeString = $elementType->asTypeString();

        if (!isset(self::$collections[$collectionClass][$elementTypeString])) {
            self::$collections[$collectionClass][$elementTypeString] = new CollectionType($elementType, $collectionClass);
        }

        return self::$collections[$collectionClass][$elementTypeString];
    }
public static function collectionOf(IType $elementType, string $collectionClass = ITypedCollection::class) : CollectionType
    {
        $elementTypeString = $elementType->asTypeString();

        if (!isset(self::$collections[$collectionClass][$elementTypeString])) {
            self::$collections[$collectionClass][$elementTypeString] = new CollectionType($elementType, $collectionClass);
        }

        return self::$collections[$collectionClass][$elementTypeString];
    }
public static function collectionOf ( IType $ elementType , string $ collectionClass = ITypedCollection :: class ) : CollectionType { $ elementTypeString = $ elementType -> asTypeString ( ) ; if ( ! isset ( self :: $ collections [ $ collectionClass ] [ $ elementTypeString ] ) ) { self :: $ collections [ $ collectionClass ] [ $ elementTypeString ] = new CollectionType ( $ elementType , $ collectionClass ) ; } return self :: $ collections [ $ collectionClass ] [ $ elementTypeString ] ; }
The typed collection type. Contains only elements of the
supplied class.

@see ITypedCollection

@param IType  $elementType
@param string $collectionClass

@return CollectionType
The typed collection type . Contains only elements of the supplied class .