TypeComparators
in package
Table of Contents
- doTypesOverlap() : bool
- Provided two composite types, determine if they "overlap". Two composite types overlap when the Sets of possible concrete types for each intersect.
- isEqualType() : bool
- Provided two types, return true if the types are equal (invariant).
- isTypeSubTypeOf() : bool
- Provided a type and a super type, return true if the first type is either equal or a subset of the second super type (covariant).
Methods
doTypesOverlap()
Provided two composite types, determine if they "overlap". Two composite types overlap when the Sets of possible concrete types for each intersect.
public
static doTypesOverlap(Schema $schema, CompositeType $typeA, CompositeType $typeB) : bool
This is often used to determine if a fragment of a given type could possibly be visited in a context of another type.
This function is commutative.
Parameters
- $schema : Schema
- $typeA : CompositeType
- $typeB : CompositeType
Return values
bool —isEqualType()
Provided two types, return true if the types are equal (invariant).
public
static isEqualType(Type $typeA, Type $typeB) : bool
Parameters
Return values
bool —isTypeSubTypeOf()
Provided a type and a super type, return true if the first type is either equal or a subset of the second super type (covariant).
public
static isTypeSubTypeOf(Schema $schema, Type $maybeSubType, Type $superType) : bool