Property | Type | Description | |
---|---|---|---|
$name | string | The name of this type such as 'int' or 'MyClass' | |
$namespace | string | The namespace of this type such as '\' or '\Phan\Language' | |
$template_parameter_type_list | UnionType[] | A possibly empty list of concrete types that act as parameters to this type if it is a templated type. | |
$template_parameter_type_list | A possibly empty list of concrete types that act as parameters to this type if it is a templated type. |
Method | Description | |
---|---|---|
__toString ( ) : string | ||
asExpandedTypes ( |
||
asExpandedTypes ( |
||
asFQSEN ( ) : Phan\Language\FQSEN | ||
asFQSENString ( ) : string | ||
asGenericArrayType ( ) : |
||
asUnionType ( ) : UnionType | ||
asUnionType ( ) : |
||
canCastToType ( |
||
fromFullyQualifiedString ( string $fully_qualified_string ) : |
||
fromInternalTypeName ( string $type_name ) : |
||
fromNamespaceAndName ( string $namespace, string $type_name ) : |
||
fromObject ( $object ) : |
||
fromStringInContext ( string $string, |
||
fromType ( |
||
fromType ( |
||
genericArrayElementType ( ) : |
||
getName ( ) : string | ||
getNamespace ( ) : string | ||
getTemplateParameterTypeList ( ) : UnionType[] | ||
getTemplateParameterTypeList ( ) : |
||
getTemplateParameterTypeMap ( |
||
hasNamespace ( ) : boolean | ||
hasTemplateParameterTypes ( ) : boolean | ||
isArrayLike ( ) : boolean | ||
isGenericArray ( ) : boolean | ||
isNativeType ( ) : boolean | ||
isScalar ( ) : boolean | ||
isSelfType ( ) : boolean | ||
isSelfTypeString ( string $type_string ) : boolean | ||
isStaticType ( ) : boolean | ||
isSubclassOf ( |
Method | Description | |
---|---|---|
__construct ( string $namespace, string $name, UnionType[] $template_parameter_type_list ) | ||
__construct ( string $namespace, string $name, |
||
make ( string $namespace, string $type_name, UnionType[] $template_parameter_type_list ) : |
||
make ( string $namespace, string $type_name, |
Method | Description | |
---|---|---|
canonicalNameFromName ( string $name ) : string | ||
isGenericArrayString ( string $type_name ) : boolean | ||
isNativeTypeString ( string $type_name ) : boolean | ||
typeStringComponents ( string $type_string ) : Tuple3 |
protected __construct ( string $namespace, string $name, UnionType[] $template_parameter_type_list ) | ||
$namespace | string | The (optional) namespace of the type such as '\' or '\Phan\Language'. |
$name | string | The name of the type such as 'int' or 'MyClass' |
$template_parameter_type_list | UnionType[] | A (possibly empty) list of template parameter types |
protected __construct ( string $namespace, string $name, |
||
$namespace | string | The (optional) namespace of the type such as '\' or '\Phan\Language'. |
$name | string | The name of the type such as 'int' or 'MyClass' |
$template_parameter_type_list | A (possibly empty) list of template parameter types |
public __toString ( ) : string | ||
return | string | A human readable representation of this type |
public asExpandedTypes ( |
||
$code_base | ||
$recursion_depth | integer | This thing has a tendency to run-away on me. This tracks how bad I messed up by seeing how far the expanded types go |
return | UnionType | Expands class types to all inherited classes returning a superset of this type. |
public asExpandedTypes ( |
||
$code_base | ||
$recursion_depth | integer | This thing has a tendency to run-away on me. This tracks how bad I messed up by seeing how far the expanded types go |
return | Expands class types to all inherited classes returning a superset of this type. |
public asFQSEN ( ) : Phan\Language\FQSEN | ||
return | Phan\Language\FQSEN | A fully-qualified structural element name derived from this type |
public asFQSENString ( ) : string | ||
return | string | A string representation of this type in FQSEN form. |
public asGenericArrayType ( ) : |
||
return | Get a new type which is the generic array version of this type. For instance, 'int' will produce 'int[]'. |
public asUnionType ( ) : UnionType | ||
return | UnionType | A UnionType representing this and only this type |
public asUnionType ( ) : |
||
return | A UnionType representing this and only this type |
public canCastToType ( |
||
$type | ||
return | boolean | True if this Type can be cast to the given Type cleanly |
public static fromFullyQualifiedString ( string $fully_qualified_string ) : |
||
$fully_qualified_string | string | A fully qualified type name |
return |
public static fromInternalTypeName ( string $type_name ) : |
||
$type_name | string | The name of the internal type such as 'int' |
return | Get a type for the given type name |
public static fromNamespaceAndName ( string $namespace, string $type_name ) : |
||
$namespace | string | A fully qualified namespace |
$type_name | string | The name of the type |
return | A type representing the given namespace and type name. |
public static fromObject ( $object ) : |
||
return | Get a type for the given object |
public static fromStringInContext ( string $string, |
||
$string | string | A string representing a type |
$context | The context in which the type string was found | |
return | Parse a type from the given string |
public static fromType ( |
||
$type | The base type of this generic type referencing a generic class | |
$template_parameter_type_list | UnionType[] | A map from a template type identifier to a concrete union type |
return |
public static fromType ( |
||
$type | The base type of this generic type referencing a generic class | |
$template_parameter_type_list | A map from a template type identifier to a concrete union type | |
return |
public genericArrayElementType ( ) : |
||
return | A variation of this type that is not generic. i.e. 'int[]' becomes 'int'. |
public getNamespace ( ) : string | ||
return | string | The namespace associated with this type |
public getTemplateParameterTypeList ( ) : UnionType[] | ||
return | UnionType[] | The set of types filling in template parameter types defined on the class specified by this type. |
public getTemplateParameterTypeList ( ) : |
||
return | The set of types filling in template parameter types defined on the class specified by this type. |
public getTemplateParameterTypeMap ( |
||
$code_base | The code base to look up classes against | |
return | A map from template type identifier to a concrete type |
public hasNamespace ( ) : boolean | ||
return | boolean | True if this namespace is defined |
public hasTemplateParameterTypes ( ) : boolean | ||
return | boolean | True if this type has any template parameter types |
public isArrayLike ( ) : boolean | ||
return | boolean | True if this type is array-like (is of type array, is a generic array, or implements ArrayAccess). |
public isGenericArray ( ) : boolean | ||
return | boolean | True if this is a generic type such as 'int[]' or 'string[]'. |
public isNativeType ( ) : boolean | ||
return | boolean | True if this is a native type (like int, string, etc.) |
public isSelfType ( ) : boolean | ||
return | boolean | True if this type is a type referencing the class context in which it exists such as 'static' or 'self'. |
public static isSelfTypeString ( string $type_string ) : boolean | ||
$type_string | string | A string defining a type such as 'self' or 'int'. |
return | boolean | True if the given type references the class context in which it exists such as 'static' or 'self'. |
public isStaticType ( ) : boolean | ||
return | boolean | True if this type is a type referencing the class context 'static'. |
public isSubclassOf ( |
||
$code_base | ||
$parent |
protected static make ( string $namespace, string $type_name, UnionType[] $template_parameter_type_list ) : |
||
$namespace | string | The (optional) namespace of the type such as '\' or '\Phan\Language'. |
$type_name | string | |
$template_parameter_type_list | UnionType[] | A (possibly empty) list of template parameter types |
return | A single canonical instance of the given type. |
protected static make ( string $namespace, string $type_name, |
||
$namespace | string | The (optional) namespace of the type such as '\' or '\Phan\Language'. |
$type_name | string | |
$template_parameter_type_list | A (possibly empty) list of template parameter types | |
return | A single canonical instance of the given type. |
protected string $name | ||
return | string |
protected string $namespace | ||
return | string |
protected UnionType[] $template_parameter_type_list | ||
return | UnionType[] |