PHP 클래스 Phan\Language\Type

상속: use trait Phan\Memoize
파일 보기 프로젝트 열기: etsy/phan 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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 UnionType[] A possibly empty list of concrete types that act as parameters to this type if it is a templated type.

공개 메소드들

메소드 설명
__toString ( ) : string
asExpandedTypes ( CodeBase $code_base, integer $recursion_depth ) : UnionType
asExpandedTypes ( CodeBase $code_base, integer $recursion_depth ) : UnionType
asFQSEN ( ) : Phan\Language\FQSEN
asFQSENString ( ) : string
asGenericArrayType ( ) : Type
asUnionType ( ) : UnionType
asUnionType ( ) : UnionType
canCastToType ( Type $type ) : boolean
fromFullyQualifiedString ( string $fully_qualified_string ) : Type
fromInternalTypeName ( string $type_name ) : Type
fromNamespaceAndName ( string $namespace, string $type_name ) : Type
fromObject ( $object ) : Type
fromStringInContext ( string $string, Context $context ) : Type
fromType ( Type $type, UnionType[] $template_parameter_type_list ) : Type
fromType ( Type $type, UnionType[] $template_parameter_type_list ) : Type
genericArrayElementType ( ) : Type
getName ( ) : string
getNamespace ( ) : string
getTemplateParameterTypeList ( ) : UnionType[]
getTemplateParameterTypeList ( ) : UnionType[]
getTemplateParameterTypeMap ( CodeBase $code_base ) : Type[]
hasNamespace ( ) : boolean
hasTemplateParameterTypes ( ) : boolean
isArrayLike ( ) : boolean
isGenericArray ( ) : boolean
isNativeType ( ) : boolean
isScalar ( ) : boolean
isSelfType ( ) : boolean
isSelfTypeString ( string $type_string ) : boolean
isStaticType ( ) : boolean
isSubclassOf ( CodeBase $code_base, Type $parent )

보호된 메소드들

메소드 설명
__construct ( string $namespace, string $name, UnionType[] $template_parameter_type_list )
__construct ( string $namespace, string $name, UnionType[] $template_parameter_type_list )
make ( string $namespace, string $type_name, UnionType[] $template_parameter_type_list ) : Type
make ( string $namespace, string $type_name, UnionType[] $template_parameter_type_list ) : Type

비공개 메소드들

메소드 설명
canonicalNameFromName ( string $name ) : string
isGenericArrayString ( string $type_name ) : boolean
isNativeTypeString ( string $type_name ) : boolean
typeStringComponents ( string $type_string ) : Tuple3

메소드 상세

__construct() 보호된 메소드

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

__construct() 보호된 메소드

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

__toString() 공개 메소드

public __toString ( ) : string
리턴 string A human readable representation of this type

asExpandedTypes() 공개 메소드

public asExpandedTypes ( CodeBase $code_base, integer $recursion_depth ) : UnionType
$code_base Phan\CodeBase
$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
리턴 UnionType Expands class types to all inherited classes returning a superset of this type.

asExpandedTypes() 공개 메소드

public asExpandedTypes ( CodeBase $code_base, integer $recursion_depth ) : UnionType
$code_base Phan\CodeBase
$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
리턴 UnionType Expands class types to all inherited classes returning a superset of this type.

asFQSEN() 공개 메소드

public asFQSEN ( ) : Phan\Language\FQSEN
리턴 Phan\Language\FQSEN A fully-qualified structural element name derived from this type

asFQSENString() 공개 메소드

public asFQSENString ( ) : string
리턴 string A string representation of this type in FQSEN form.

asGenericArrayType() 공개 메소드

public asGenericArrayType ( ) : Type
리턴 Type Get a new type which is the generic array version of this type. For instance, 'int' will produce 'int[]'.

asUnionType() 공개 메소드

public asUnionType ( ) : UnionType
리턴 UnionType A UnionType representing this and only this type

asUnionType() 공개 메소드

public asUnionType ( ) : UnionType
리턴 UnionType A UnionType representing this and only this type

canCastToType() 공개 메소드

public canCastToType ( Type $type ) : boolean
$type Type
리턴 boolean True if this Type can be cast to the given Type cleanly

fromFullyQualifiedString() 공개 정적인 메소드

public static fromFullyQualifiedString ( string $fully_qualified_string ) : Type
$fully_qualified_string string A fully qualified type name
리턴 Type

fromInternalTypeName() 공개 정적인 메소드

public static fromInternalTypeName ( string $type_name ) : Type
$type_name string The name of the internal type such as 'int'
리턴 Type Get a type for the given type name

fromNamespaceAndName() 공개 정적인 메소드

public static fromNamespaceAndName ( string $namespace, string $type_name ) : Type
$namespace string A fully qualified namespace
$type_name string The name of the type
리턴 Type A type representing the given namespace and type name.

fromObject() 공개 정적인 메소드

public static fromObject ( $object ) : Type
리턴 Type Get a type for the given object

fromStringInContext() 공개 정적인 메소드

public static fromStringInContext ( string $string, Context $context ) : Type
$string string A string representing a type
$context Context The context in which the type string was found
리턴 Type Parse a type from the given string

fromType() 공개 정적인 메소드

public static fromType ( Type $type, UnionType[] $template_parameter_type_list ) : Type
$type 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
리턴 Type

fromType() 공개 정적인 메소드

public static fromType ( Type $type, UnionType[] $template_parameter_type_list ) : Type
$type 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
리턴 Type

genericArrayElementType() 공개 메소드

public genericArrayElementType ( ) : Type
리턴 Type A variation of this type that is not generic. i.e. 'int[]' becomes 'int'.

getName() 공개 메소드

public getName ( ) : string
리턴 string The name associated with this type

getNamespace() 공개 메소드

public getNamespace ( ) : string
리턴 string The namespace associated with this type

getTemplateParameterTypeList() 공개 메소드

public getTemplateParameterTypeList ( ) : UnionType[]
리턴 UnionType[] The set of types filling in template parameter types defined on the class specified by this type.

getTemplateParameterTypeList() 공개 메소드

public getTemplateParameterTypeList ( ) : UnionType[]
리턴 UnionType[] The set of types filling in template parameter types defined on the class specified by this type.

getTemplateParameterTypeMap() 공개 메소드

public getTemplateParameterTypeMap ( CodeBase $code_base ) : Type[]
$code_base Phan\CodeBase The code base to look up classes against
리턴 Type[] A map from template type identifier to a concrete type

hasNamespace() 공개 메소드

public hasNamespace ( ) : boolean
리턴 boolean True if this namespace is defined

hasTemplateParameterTypes() 공개 메소드

public hasTemplateParameterTypes ( ) : boolean
리턴 boolean True if this type has any template parameter types

isArrayLike() 공개 메소드

public isArrayLike ( ) : boolean
리턴 boolean True if this type is array-like (is of type array, is a generic array, or implements ArrayAccess).

isGenericArray() 공개 메소드

public isGenericArray ( ) : boolean
리턴 boolean True if this is a generic type such as 'int[]' or 'string[]'.

isNativeType() 공개 메소드

public isNativeType ( ) : boolean
리턴 boolean True if this is a native type (like int, string, etc.)

isScalar() 공개 메소드

또한 보기: Phan\Deprecated\Util::type_scalar Formerly `function type_scalar`
public isScalar ( ) : boolean
리턴 boolean True if all types in this union are scalars

isSelfType() 공개 메소드

public isSelfType ( ) : boolean
리턴 boolean True if this type is a type referencing the class context in which it exists such as 'static' or 'self'.

isSelfTypeString() 공개 정적인 메소드

public static isSelfTypeString ( string $type_string ) : boolean
$type_string string A string defining a type such as 'self' or 'int'.
리턴 boolean True if the given type references the class context in which it exists such as 'static' or 'self'.

isStaticType() 공개 메소드

public isStaticType ( ) : boolean
리턴 boolean True if this type is a type referencing the class context 'static'.

isSubclassOf() 공개 메소드

public isSubclassOf ( CodeBase $code_base, Type $parent )
$code_base Phan\CodeBase
$parent Type

make() 보호된 정적인 메소드

protected static make ( string $namespace, string $type_name, UnionType[] $template_parameter_type_list ) : Type
$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
리턴 Type A single canonical instance of the given type.

make() 보호된 정적인 메소드

protected static make ( string $namespace, string $type_name, UnionType[] $template_parameter_type_list ) : Type
$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
리턴 Type A single canonical instance of the given type.

프로퍼티 상세

$name 보호되어 있는 프로퍼티

The name of this type such as 'int' or 'MyClass'
protected string $name
리턴 string

$namespace 보호되어 있는 프로퍼티

The namespace of this type such as '\' or '\Phan\Language'
protected string $namespace
리턴 string

$template_parameter_type_list 보호되어 있는 프로퍼티

A possibly empty list of concrete types that act as parameters to this type if it is a templated type.
protected UnionType[] $template_parameter_type_list
리턴 UnionType[]

$template_parameter_type_list 보호되어 있는 프로퍼티

A possibly empty list of concrete types that act as parameters to this type if it is a templated type.
protected UnionType[],Phan\Language $template_parameter_type_list
리턴 UnionType[]