PHP Class Phan\Language\Element\Clazz

Inheritance: extends AddressableElement, use trait Phan\Memoize
Afficher le fichier Open project: etsy/phan Class Usage Examples

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
hydrateOnce ( CodeBase $code_base ) : void This method must be called before analysis begins.

Private Methods

Méthode Description
getClassListFromFQSENList ( CodeBase $code_base, array $fqsen_list ) : array

Method Details

__construct() public méthode

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 méthode

public __toString ( ) : string
Résultat string A string describing this class

addConstant() public méthode

Add a class constant
public addConstant ( CodeBase $code_base, ClassConstant $constant ) : null;
$code_base Phan\CodeBase
$constant ClassConstant
Résultat null;

addInterfaceClassFQSEN() public méthode

public addInterfaceClassFQSEN ( Phan\Language\FQSEN $fqsen ) : null
$fqsen Phan\Language\FQSEN Add the given FQSEN to the list of implemented interfaces for this class
Résultat null

addMethod() public méthode

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
Résultat null

addProperty() public méthode

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
Résultat void

addTraitFQSEN() public méthode

public addTraitFQSEN ( Phan\Language\FQSEN $fqsen ) : null
$fqsen Phan\Language\FQSEN
Résultat null

analyze() final public méthode

This method should be called after hydration
final public analyze ( CodeBase $code_base ) : void
$code_base Phan\CodeBase
Résultat void

fromClassName() public static méthode

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.
Résultat Clazz A Class structural element representing the given named builtin.

fromReflectionClass() public static méthode

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.
Résultat Clazz A Class structural element representing the given named builtin.

getAncestorClassList() public méthode

public getAncestorClassList ( CodeBase $code_base ) : Clazz[]
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat Clazz[]

getAncestorFQSENList() public méthode

public getAncestorFQSENList ( CodeBase $code_base ) : FullyQualifiedClassName[]
$code_base Phan\CodeBase
Résultat Phan\Language\FQSEN\FullyQualifiedClassName[]

getCallMethod() public méthode

public getCallMethod ( CodeBase $code_base ) : Method
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat Method The magic `__call` method

getCallStaticMethod() public méthode

public getCallStaticMethod ( CodeBase $code_base ) : Method
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat Method The magic `__callStatic` method

getConstantMap() public méthode

public getConstantMap ( CodeBase $code_base ) : array
$code_base Phan\CodeBase
Résultat array The constants associated with this class

getConstantWithName() public méthode

public getConstantWithName ( CodeBase $code_base, string $name ) : ClassConstant
$code_base Phan\CodeBase
$name string
Résultat ClassConstant The class constant with the given name.

getFQSEN() public méthode

public getFQSEN ( ) : FullyQualifiedClassName
Résultat Phan\Language\FQSEN\FullyQualifiedClassName

getHasDynamicProperties() public méthode

public getHasDynamicProperties ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase
Résultat boolean True if this class calls its parent constructor

getHierarchyDepth() public méthode

public getHierarchyDepth ( CodeBase $code_base ) : integer
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat integer This class's depth in the class hierarchy

getHierarchyRootFQSEN() public méthode

public getHierarchyRootFQSEN ( CodeBase $code_base ) : FullyQualifiedClassName
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat Phan\Language\FQSEN\FullyQualifiedClassName The FQSEN of the root class on this class's hiearchy

getInterfaceFQSENList() public méthode

public getInterfaceFQSENList ( ) : array
Résultat array Get the list of interfaces implemented by this class

getIsParentConstructorCalled() public méthode

public getIsParentConstructorCalled ( ) : boolean
Résultat boolean True if this class calls its parent constructor

getMethodByName() public méthode

public getMethodByName ( CodeBase $code_base, string $name ) : Method
$code_base Phan\CodeBase
$name string
Résultat Method The method with the given name

getMethodByNameInContext() public méthode

public getMethodByNameInContext ( CodeBase $code_base, string $name, Context $context ) : Method
$code_base Phan\CodeBase
$name string
$context Phan\Language\Context
Résultat Method The method with the given name

getMethodMap() public méthode

public getMethodMap ( CodeBase $code_base ) : array
$code_base Phan\CodeBase
Résultat array A list of methods on this class

getNonParentAncestorFQSENList() public méthode

public getNonParentAncestorFQSENList ( CodeBase $code_base ) : FullyQualifiedClassName[]
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat Phan\Language\FQSEN\FullyQualifiedClassName[]

getOverridableAncestorClassList() public méthode

public getOverridableAncestorClassList ( CodeBase $code_base ) : Clazz[]
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat Clazz[]

getOverridableAncestorFQSENList() public méthode

public getOverridableAncestorFQSENList ( CodeBase $code_base ) : FullyQualifiedClassName[]
$code_base Phan\CodeBase
Résultat 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 méthode

public getParentClass ( CodeBase $code_base ) : Clazz
$code_base Phan\CodeBase
Résultat Clazz The parent class of this class if defined

getParentClassFQSEN() public méthode

public getParentClassFQSEN ( ) : FullyQualifiedClassName
Résultat Phan\Language\FQSEN\FullyQualifiedClassName The parent class of this class if one exists

getParentTypeOption() public méthode

public getParentTypeOption ( ) : Option
Résultat Option

getPropertyByNameInContext() public méthode

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
Résultat Property A property with the given name

getPropertyList() public méthode

public getPropertyList ( CodeBase $code_base ) : Property[]
$code_base Phan\CodeBase
Résultat Property[] The list of properties defined on this class

getPropertyMap() public méthode

public getPropertyMap ( CodeBase $code_base ) : array
$code_base Phan\CodeBase
Résultat array The list of properties on this class

getReferenceCount() public méthode

public getReferenceCount ( CodeBase $code_base ) : integer
$code_base Phan\CodeBase
Résultat integer The number of references to this typed structural element

getTemplateTypeMap() public méthode

public getTemplateTypeMap ( ) : array
Résultat array The set of all template types parameterizing this generic class

getTraitFQSENList() public méthode

public getTraitFQSENList ( ) : array
Résultat array A list of FQSEN's for included traits

hasCallMethod() public méthode

public hasCallMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat boolean True if this class has a magic '__call' method

hasCallOrCallStaticMethod() public méthode

public hasCallOrCallStaticMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat boolean True if this class has a magic '__call' or '__callStatic' method

hasCallStaticMethod() public méthode

public hasCallStaticMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat boolean True if this class has a magic '__callStatic' method

hasConstantWithName() public méthode

public hasConstantWithName ( CodeBase $code_base, string $name ) : boolean
$code_base Phan\CodeBase
$name string
Résultat boolean True if a constant with the given name is defined on this class.

hasGetMethod() public méthode

public hasGetMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat boolean True if this class has a magic '__get' method

hasGetOrSetMethod() public méthode

public hasGetOrSetMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat boolean True if this class has a magic '__get' or '__set' method

hasMethodWithName() public méthode

public hasMethodWithName ( CodeBase $code_base, string $name ) : boolean
$code_base Phan\CodeBase
$name string
Résultat boolean True if this class has a method with the given name

hasParentType() public méthode

public hasParentType ( ) : boolean
Résultat boolean True if this class has a parent class

hasPropertyWithName() public méthode

public hasPropertyWithName ( CodeBase $code_base, string $name ) : boolean
$code_base Phan\CodeBase
$name string
Résultat boolean

hasSetMethod() public méthode

public hasSetMethod ( CodeBase $code_base ) : boolean
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat boolean True if this class has a magic '__set' method

hydrateOnce() protected méthode

This method must be called before analysis begins.
protected hydrateOnce ( CodeBase $code_base ) : void
$code_base Phan\CodeBase
Résultat void

importAncestorClass() public méthode

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
Résultat void

importAncestorClasses() public méthode

..) to this class
public importAncestorClasses ( CodeBase $code_base ) : null
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
Résultat null

importParentClass() public méthode

* 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 méthode

public isAbstract ( ) : boolean
Résultat boolean True if this is an abstract class

isFinal() public méthode

public isFinal ( ) : boolean
Résultat boolean True if this is a final class

isGeneric() public méthode

public isGeneric ( ) : boolean
Résultat boolean True if this class contains generic types

isInterface() public méthode

public isInterface ( ) : boolean
Résultat boolean True if this is an interface

isSubclassOf() public méthode

public isSubclassOf ( CodeBase $code_base, Clazz $other ) : boolean
$code_base Phan\CodeBase
$other Clazz
Résultat boolean

isTrait() public méthode

public isTrait ( ) : boolean
Résultat boolean True if this class is a trait

setHasDynamicProperties() public méthode

public setHasDynamicProperties ( boolean $has_dynamic_properties ) : void
$has_dynamic_properties boolean
Résultat void

setIsParentConstructorCalled() public méthode

public setIsParentConstructorCalled ( boolean $is_parent_constructor_called ) : void
$is_parent_constructor_called boolean
Résultat void

setParentType() public méthode

public setParentType ( Type $parent_type = null ) : void
$parent_type Phan\Language\Type The type of the parent (extended) class of this class.
Résultat void