PHP Класс Phan\Language\Element\Clazz

Наследование: extends AddressableElement, use trait Phan\Memoize
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Context $context, string $name, UnionType $type, integer $flags, FullyQualifiedClassName $fqsen, Type $parent_type = null, array $interface_fqsen_list = [], array $trait_fqsen_list = [] )
__toString ( ) : string
addConstant ( CodeBase $code_base, ClassConstant $constant ) : null; Add a class constant
addInterfaceClassFQSEN ( Phan\Language\FQSEN $fqsen ) : null
addMethod ( CodeBase $code_base, Method $method, Option | Phan\Library\None $type_option ) : null Add a method to this class
addProperty ( CodeBase $code_base, Property $property, Option | Phan\Library\None $type_option ) : void Add a property to this class
addTraitFQSEN ( Phan\Language\FQSEN $fqsen ) : null
analyze ( CodeBase $code_base ) : void This method should be called after hydration
fromClassName ( CodeBase $code_base, string $class_name ) : Clazz
fromReflectionClass ( CodeBase $code_base, ReflectionClass $class ) : Clazz
getAncestorClassList ( CodeBase $code_base ) : Clazz[]
getAncestorFQSENList ( CodeBase $code_base ) : FullyQualifiedClassName[]
getCallMethod ( CodeBase $code_base ) : Method
getCallStaticMethod ( CodeBase $code_base ) : Method
getConstantMap ( CodeBase $code_base ) : array
getConstantWithName ( CodeBase $code_base, string $name ) : ClassConstant
getFQSEN ( ) : FullyQualifiedClassName
getHasDynamicProperties ( CodeBase $code_base ) : boolean
getHierarchyDepth ( CodeBase $code_base ) : integer
getHierarchyRootFQSEN ( CodeBase $code_base ) : FullyQualifiedClassName
getInterfaceFQSENList ( ) : array
getIsParentConstructorCalled ( ) : boolean
getMethodByName ( CodeBase $code_base, string $name ) : Method
getMethodByNameInContext ( CodeBase $code_base, string $name, Context $context ) : Method
getMethodMap ( CodeBase $code_base ) : array
getNonParentAncestorFQSENList ( CodeBase $code_base ) : FullyQualifiedClassName[]
getOverridableAncestorClassList ( CodeBase $code_base ) : Clazz[]
getOverridableAncestorFQSENList ( CodeBase $code_base ) : FullyQualifiedClassName[]
getParentClass ( CodeBase $code_base ) : Clazz
getParentClassFQSEN ( ) : FullyQualifiedClassName
getParentTypeOption ( ) : Option
getPropertyByNameInContext ( CodeBase $code_base, string $name, Context $context ) : Property
getPropertyList ( CodeBase $code_base ) : Property[]
getPropertyMap ( CodeBase $code_base ) : array
getReferenceCount ( CodeBase $code_base ) : integer
getTemplateTypeMap ( ) : array
getTraitFQSENList ( ) : array
hasCallMethod ( CodeBase $code_base ) : boolean
hasCallOrCallStaticMethod ( CodeBase $code_base ) : boolean
hasCallStaticMethod ( CodeBase $code_base ) : boolean
hasConstantWithName ( CodeBase $code_base, string $name ) : boolean
hasGetMethod ( CodeBase $code_base ) : boolean
hasGetOrSetMethod ( CodeBase $code_base ) : boolean
hasMethodWithName ( CodeBase $code_base, string $name ) : boolean
hasParentType ( ) : boolean
hasPropertyWithName ( CodeBase $code_base, string $name ) : boolean
hasSetMethod ( CodeBase $code_base ) : boolean
importAncestorClass ( CodeBase $code_base, Clazz $class, Option | Phan\Library\None $type_option ) : void Add properties, constants and methods from the given class to this.
importAncestorClasses ( CodeBase $code_base ) : null Add properties, constants and methods from all ancestors (parents, traits, .
importParentClass ( CodeBase $code_base ) * Add properties, constants and methods from the parent of this class
isAbstract ( ) : boolean
isFinal ( ) : boolean
isGeneric ( ) : boolean
isInterface ( ) : boolean
isSubclassOf ( CodeBase $code_base, Clazz $other ) : boolean
isTrait ( ) : boolean
setHasDynamicProperties ( boolean $has_dynamic_properties ) : void
setIsParentConstructorCalled ( boolean $is_parent_constructor_called ) : void
setParentType ( Type $parent_type = null ) : void

Защищенные методы

Метод Описание
hydrateOnce ( CodeBase $code_base ) : void This method must be called before analysis begins.

Приватные методы

Метод Описание
getClassListFromFQSENList ( CodeBase $code_base, array $fqsen_list ) : array

Описание методов

__construct() публичный Метод

public __construct ( Context $context, string $name, UnionType $type, integer $flags, FullyQualifiedClassName $fqsen, Type $parent_type = null, array $interface_fqsen_list = [], array $trait_fqsen_list = [] )
$context Phan\Language\Context The context in which the structural element lives
$name string
$type Phan\Language\UnionType
$flags integer
$fqsen Phan\Language\FQSEN\FullyQualifiedClassName A fully qualified name for this class
$parent_type Phan\Language\Type
$interface_fqsen_list array
$trait_fqsen_list array

__toString() публичный Метод

public __toString ( ) : string
Результат string A string describing this class

addConstant() публичный Метод

Add a class constant
public addConstant ( CodeBase $code_base, ClassConstant $constant ) : null;
$code_base Phan\CodeBase
$constant ClassConstant
Результат null;

addInterfaceClassFQSEN() публичный Метод

public addInterfaceClassFQSEN ( Phan\Language\FQSEN $fqsen ) : null
$fqsen Phan\Language\FQSEN Add the given FQSEN to the list of implemented interfaces for this class
Результат null

addMethod() публичный Метод

Add a method to this class
public addMethod ( CodeBase $code_base, Method $method, Option | Phan\Library\None $type_option ) : null
$code_base Phan\CodeBase A reference to the code base in which the ancestor exists
$method Method The method to copy onto this class
$type_option Option | Phan\Library\None
Результат null

addProperty() публичный Метод

Add a property to this class
public addProperty ( CodeBase $code_base, Property $property, Option | Phan\Library\None $type_option ) : void
$code_base Phan\CodeBase A reference to the code base in which the ancestor exists
$property Property The property to copy onto this class
$type_option Option | Phan\Library\None
Результат void

addTraitFQSEN() публичный Метод

public addTraitFQSEN ( Phan\Language\FQSEN $fqsen ) : null
$fqsen Phan\Language\FQSEN
Результат null

analyze() закрытый публичный Метод

This method should be called after hydration
final public analyze ( CodeBase $code_base ) : void
$code_base Phan\CodeBase
Результат void

fromClassName() публичный статический Метод

public static fromClassName ( CodeBase $code_base, string $class_name ) : Clazz
$code_base Phan\CodeBase A reference to the entire code base in which this context exists
$class_name string The name of a builtin class to build a new Class structural element from.
Результат Clazz A Class structural element representing the given named builtin.

fromReflectionClass() публичный статический Метод

public static fromReflectionClass ( CodeBase $code_base, ReflectionClass $class ) : Clazz
$code_base Phan\CodeBase A reference to the entire code base in which this context exists
$class ReflectionClass A reflection class representing a builtin class.
Результат Clazz A Class structural element representing the given named builtin.

getAncestorClassList() публичный Метод

public getAncestorClassList ( CodeBase $code_base ) : Clazz[]
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат Clazz[]

getAncestorFQSENList() публичный Метод

public getAncestorFQSENList ( CodeBase $code_base ) : FullyQualifiedClassName[]
$code_base Phan\CodeBase
Результат Phan\Language\FQSEN\FullyQualifiedClassName[]

getCallMethod() публичный Метод

public getCallMethod ( CodeBase $code_base ) : Method
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат Method The magic `__call` method

getCallStaticMethod() публичный Метод

public getCallStaticMethod ( CodeBase $code_base ) : Method
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат Method The magic `__callStatic` method

getConstantMap() публичный Метод

public getConstantMap ( CodeBase $code_base ) : array
$code_base Phan\CodeBase
Результат array The constants associated with this class

getConstantWithName() публичный Метод

public getConstantWithName ( CodeBase $code_base, string $name ) : ClassConstant
$code_base Phan\CodeBase
$name string
Результат ClassConstant The class constant with the given name.

getFQSEN() публичный Метод

public getFQSEN ( ) : FullyQualifiedClassName
Результат Phan\Language\FQSEN\FullyQualifiedClassName

getHasDynamicProperties() публичный Метод

public getHasDynamicProperties ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase
Результат boolean True if this class calls its parent constructor

getHierarchyDepth() публичный Метод

public getHierarchyDepth ( CodeBase $code_base ) : integer
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат integer This class's depth in the class hierarchy

getHierarchyRootFQSEN() публичный Метод

public getHierarchyRootFQSEN ( CodeBase $code_base ) : FullyQualifiedClassName
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат Phan\Language\FQSEN\FullyQualifiedClassName The FQSEN of the root class on this class's hiearchy

getInterfaceFQSENList() публичный Метод

public getInterfaceFQSENList ( ) : array
Результат array Get the list of interfaces implemented by this class

getIsParentConstructorCalled() публичный Метод

public getIsParentConstructorCalled ( ) : boolean
Результат boolean True if this class calls its parent constructor

getMethodByName() публичный Метод

public getMethodByName ( CodeBase $code_base, string $name ) : Method
$code_base Phan\CodeBase
$name string
Результат Method The method with the given name

getMethodByNameInContext() публичный Метод

public getMethodByNameInContext ( CodeBase $code_base, string $name, Context $context ) : Method
$code_base Phan\CodeBase
$name string
$context Phan\Language\Context
Результат Method The method with the given name

getMethodMap() публичный Метод

public getMethodMap ( CodeBase $code_base ) : array
$code_base Phan\CodeBase
Результат array A list of methods on this class

getNonParentAncestorFQSENList() публичный Метод

public getNonParentAncestorFQSENList ( CodeBase $code_base ) : FullyQualifiedClassName[]
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат Phan\Language\FQSEN\FullyQualifiedClassName[]

getOverridableAncestorClassList() публичный Метод

public getOverridableAncestorClassList ( CodeBase $code_base ) : Clazz[]
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат Clazz[]

getOverridableAncestorFQSENList() публичный Метод

public getOverridableAncestorFQSENList ( CodeBase $code_base ) : FullyQualifiedClassName[]
$code_base Phan\CodeBase
Результат Phan\Language\FQSEN\FullyQualifiedClassName[] The set of FQSENs representing extended classes and traits for which this class could have overriding methods and properties.

getParentClass() публичный Метод

public getParentClass ( CodeBase $code_base ) : Clazz
$code_base Phan\CodeBase
Результат Clazz The parent class of this class if defined

getParentClassFQSEN() публичный Метод

public getParentClassFQSEN ( ) : FullyQualifiedClassName
Результат Phan\Language\FQSEN\FullyQualifiedClassName The parent class of this class if one exists

getParentTypeOption() публичный Метод

public getParentTypeOption ( ) : Option
Результат Option

getPropertyByNameInContext() публичный Метод

public getPropertyByNameInContext ( CodeBase $code_base, string $name, Context $context ) : Property
$code_base Phan\CodeBase
$name string The name of the property
$context Phan\Language\Context The context of the caller requesting the property
Результат Property A property with the given name

getPropertyList() публичный Метод

public getPropertyList ( CodeBase $code_base ) : Property[]
$code_base Phan\CodeBase
Результат Property[] The list of properties defined on this class

getPropertyMap() публичный Метод

public getPropertyMap ( CodeBase $code_base ) : array
$code_base Phan\CodeBase
Результат array The list of properties on this class

getReferenceCount() публичный Метод

public getReferenceCount ( CodeBase $code_base ) : integer
$code_base Phan\CodeBase
Результат integer The number of references to this typed structural element

getTemplateTypeMap() публичный Метод

public getTemplateTypeMap ( ) : array
Результат array The set of all template types parameterizing this generic class

getTraitFQSENList() публичный Метод

public getTraitFQSENList ( ) : array
Результат array A list of FQSEN's for included traits

hasCallMethod() публичный Метод

public hasCallMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат boolean True if this class has a magic '__call' method

hasCallOrCallStaticMethod() публичный Метод

public hasCallOrCallStaticMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат boolean True if this class has a magic '__call' or '__callStatic' method

hasCallStaticMethod() публичный Метод

public hasCallStaticMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат boolean True if this class has a magic '__callStatic' method

hasConstantWithName() публичный Метод

public hasConstantWithName ( CodeBase $code_base, string $name ) : boolean
$code_base Phan\CodeBase
$name string
Результат boolean True if a constant with the given name is defined on this class.

hasGetMethod() публичный Метод

public hasGetMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат boolean True if this class has a magic '__get' method

hasGetOrSetMethod() публичный Метод

public hasGetOrSetMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат boolean True if this class has a magic '__get' or '__set' method

hasMethodWithName() публичный Метод

public hasMethodWithName ( CodeBase $code_base, string $name ) : boolean
$code_base Phan\CodeBase
$name string
Результат boolean True if this class has a method with the given name

hasParentType() публичный Метод

public hasParentType ( ) : boolean
Результат boolean True if this class has a parent class

hasPropertyWithName() публичный Метод

public hasPropertyWithName ( CodeBase $code_base, string $name ) : boolean
$code_base Phan\CodeBase
$name string
Результат boolean

hasSetMethod() публичный Метод

public hasSetMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат boolean True if this class has a magic '__set' method

hydrateOnce() защищенный Метод

This method must be called before analysis begins.
protected hydrateOnce ( CodeBase $code_base ) : void
$code_base Phan\CodeBase
Результат void

importAncestorClass() публичный Метод

Add properties, constants and methods from the given class to this.
public importAncestorClass ( CodeBase $code_base, Clazz $class, Option | Phan\Library\None $type_option ) : void
$code_base Phan\CodeBase A reference to the code base in which the ancestor exists
$class Clazz A class to import from
$type_option Option | Phan\Library\None
Результат void

importAncestorClasses() публичный Метод

..) to this class
public importAncestorClasses ( CodeBase $code_base ) : null
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Результат null

importParentClass() публичный Метод

* Add properties, constants and methods from the parent of this class
public importParentClass ( CodeBase $code_base )
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details

isAbstract() публичный Метод

public isAbstract ( ) : boolean
Результат boolean True if this is an abstract class

isFinal() публичный Метод

public isFinal ( ) : boolean
Результат boolean True if this is a final class

isGeneric() публичный Метод

public isGeneric ( ) : boolean
Результат boolean True if this class contains generic types

isInterface() публичный Метод

public isInterface ( ) : boolean
Результат boolean True if this is an interface

isSubclassOf() публичный Метод

public isSubclassOf ( CodeBase $code_base, Clazz $other ) : boolean
$code_base Phan\CodeBase
$other Clazz
Результат boolean

isTrait() публичный Метод

public isTrait ( ) : boolean
Результат boolean True if this class is a trait

setHasDynamicProperties() публичный Метод

public setHasDynamicProperties ( boolean $has_dynamic_properties ) : void
$has_dynamic_properties boolean
Результат void

setIsParentConstructorCalled() публичный Метод

public setIsParentConstructorCalled ( boolean $is_parent_constructor_called ) : void
$is_parent_constructor_called boolean
Результат void

setParentType() публичный Метод

public setParentType ( Type $parent_type = null ) : void
$parent_type Phan\Language\Type The type of the parent (extended) class of this class.
Результат void