PHP Класс PDepend\Source\AST\AbstractASTType

С версии: 1.0.0
Наследование: extends PDepend\Source\AST\AbstractASTArtifact
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$cache PDepend\Util\Cache\CacheDriver The internal used cache instance.
$constants array(string=>mixed) An array with all constants defined in this class or interface.
$context PDepend\Source\Builder\BuilderContext The currently used builder context.
$methods PDepend\Source\AST\ASTMethod[] Temporary property that only holds methods during the parsing process.
$modifiers integer The modifiers for this class instance.
$namespaceName string Name of the parent namespace for this class or interface instance. Or NULL when no namespace was specified.
$nodes PDepend\Source\AST\ASTNode[] List of all parsed child nodes.
$userDefined boolean The parser marks all classes and interfaces as user defined that have a source file and were part of parsing process.

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

Метод Описание
__sleep ( ) : array The magic sleep method is called by the PHP runtime environment before an instance of this class gets serialized. It returns an array with the names of all those properties that should be cached for this class or interface instance.
__wakeup ( ) : void The magic wakeup method is called by the PHP runtime environment when a serialized instance of this class gets unserialized and all properties are restored. This implementation of the __wakeup() method sets a flag that this object was restored from the cache and it restores the dependency between this class or interface and it's child methods.
addChild ( PDepend\Source\AST\ASTNode $node ) : void Adds a parsed child node to this node.
addMethod ( PDepend\Source\AST\ASTMethod $method ) : PDepend\Source\AST\ASTMethod Adds the given method to this type.
findChildrenOfType ( string $targetType, array &$results = [] ) : PDepend\Source\AST\ASTNode[] Will find all children for the given type.
getAllMethods ( ) : PDepend\Source\AST\ASTMethod[] Returns a list of all methods provided by this type or one of its parents.
getChild ( integer $index ) : PDepend\Source\AST\ASTNode Returns the child at the given index.
getChildren ( ) : PDepend\Source\AST\ASTNode[] Returns all child nodes of this class.
getFirstChildOfType ( string $targetType ) : PDepend\Source\AST\ASTNode This method will search recursive for the first child node that is an instance of the given $targetType. The returned value will be null if no child exists for that.
getMethods ( ) : PDepend\Source\AST\ASTMethod[] Returns all {@link \PDepend\Source\AST\ASTMethod} objects in this type.
getNamespace ( ) : PDepend\Source\AST\ASTNamespace Returns the parent namespace for this class.
getNamespaceName ( ) : string Returns the name of the parent namespace.
getTokens ( ) : PDepend\Source\Tokenizer\Token[] Returns an array with all tokens within this type.
isCached ( ) : boolean This method will return true when this class or interface instance was restored from the cache and not currently parsed. Otherwise this method will return false.
isSubtypeOf ( AbstractASTType $type ) : boolean Checks that this user type is a subtype of the given $type instance.
isUserDefined ( ) : boolean This method will return true when this type has a declaration in the analyzed source files.
setCache ( PDepend\Util\Cache\CacheDriver $cache ) : AbstractASTType Setter method for the currently used token cache, where this class or interface instance can store the associated tokens.
setContext ( PDepend\Source\Builder\BuilderContext $context ) : AbstractASTType Sets the currently active builder context.
setNamespace ( PDepend\Source\AST\ASTNamespace $namespace ) : void Sets the parent namespace for this type.
setTokens ( array $tokens ) : void Sets the tokens for this type.
setUserDefined ( ) : void This method can be used to mark a type as user defined. User defined means that the type has a valid declaration in the analyzed source files.
unsetNamespace ( ) : void Resets the associated namespace reference.

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

Метод Описание
getTraitMethods ( ) : PDepend\Source\AST\ASTMethod[] Returns an array with {@link \PDepend\Source\AST\ASTMethod} objects that are imported through traits.

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

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

The magic sleep method is called by the PHP runtime environment before an instance of this class gets serialized. It returns an array with the names of all those properties that should be cached for this class or interface instance.
public __sleep ( ) : array
Результат array

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

The magic wakeup method is called by the PHP runtime environment when a serialized instance of this class gets unserialized and all properties are restored. This implementation of the __wakeup() method sets a flag that this object was restored from the cache and it restores the dependency between this class or interface and it's child methods.
public __wakeup ( ) : void
Результат void

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

Adds a parsed child node to this node.
public addChild ( PDepend\Source\AST\ASTNode $node ) : void
$node PDepend\Source\AST\ASTNode
Результат void

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

Adds the given method to this type.
public addMethod ( PDepend\Source\AST\ASTMethod $method ) : PDepend\Source\AST\ASTMethod
$method PDepend\Source\AST\ASTMethod
Результат PDepend\Source\AST\ASTMethod

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

Will find all children for the given type.
public findChildrenOfType ( string $targetType, array &$results = [] ) : PDepend\Source\AST\ASTNode[]
$targetType string The target class or interface type.
$results array
Результат PDepend\Source\AST\ASTNode[]

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

Returns a list of all methods provided by this type or one of its parents.
abstract public getAllMethods ( ) : PDepend\Source\AST\ASTMethod[]
Результат PDepend\Source\AST\ASTMethod[]

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

Returns the child at the given index.
public getChild ( integer $index ) : PDepend\Source\AST\ASTNode
$index integer
Результат PDepend\Source\AST\ASTNode

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

Returns all child nodes of this class.
public getChildren ( ) : PDepend\Source\AST\ASTNode[]
Результат PDepend\Source\AST\ASTNode[]

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

This method will search recursive for the first child node that is an instance of the given $targetType. The returned value will be null if no child exists for that.
public getFirstChildOfType ( string $targetType ) : PDepend\Source\AST\ASTNode
$targetType string Searched class or interface type.
Результат PDepend\Source\AST\ASTNode

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

Returns all {@link \PDepend\Source\AST\ASTMethod} objects in this type.
public getMethods ( ) : PDepend\Source\AST\ASTMethod[]
Результат PDepend\Source\AST\ASTMethod[]

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

Returns the parent namespace for this class.
public getNamespace ( ) : PDepend\Source\AST\ASTNamespace
Результат PDepend\Source\AST\ASTNamespace

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

Returns the name of the parent namespace.
public getNamespaceName ( ) : string
Результат string

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

Returns an array with all tokens within this type.
public getTokens ( ) : PDepend\Source\Tokenizer\Token[]
Результат PDepend\Source\Tokenizer\Token[]

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

Returns an array with {@link \PDepend\Source\AST\ASTMethod} objects that are imported through traits.
С версии: 1.0.0
protected getTraitMethods ( ) : PDepend\Source\AST\ASTMethod[]
Результат PDepend\Source\AST\ASTMethod[]

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

This method will return true when this class or interface instance was restored from the cache and not currently parsed. Otherwise this method will return false.
public isCached ( ) : boolean
Результат boolean

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

Checks that this user type is a subtype of the given $type instance.
С версии: 1.0.6
abstract public isSubtypeOf ( AbstractASTType $type ) : boolean
$type AbstractASTType
Результат boolean

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

This method will return true when this type has a declaration in the analyzed source files.
public isUserDefined ( ) : boolean
Результат boolean

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

Setter method for the currently used token cache, where this class or interface instance can store the associated tokens.
public setCache ( PDepend\Util\Cache\CacheDriver $cache ) : AbstractASTType
$cache PDepend\Util\Cache\CacheDriver
Результат AbstractASTType

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

Sets the currently active builder context.
public setContext ( PDepend\Source\Builder\BuilderContext $context ) : AbstractASTType
$context PDepend\Source\Builder\BuilderContext
Результат AbstractASTType

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

Sets the parent namespace for this type.
public setNamespace ( PDepend\Source\AST\ASTNamespace $namespace ) : void
$namespace PDepend\Source\AST\ASTNamespace
Результат void

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

Sets the tokens for this type.
public setTokens ( array $tokens ) : void
$tokens array The generated tokens.
Результат void

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

This method can be used to mark a type as user defined. User defined means that the type has a valid declaration in the analyzed source files.
public setUserDefined ( ) : void
Результат void

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

Resets the associated namespace reference.
public unsetNamespace ( ) : void
Результат void

Описание свойств

$cache защищенное свойство

The internal used cache instance.
protected CacheDriver,PDepend\Util\Cache $cache
Результат PDepend\Util\Cache\CacheDriver

$constants защищенное свойство

An array with all constants defined in this class or interface.
protected array(string=>mixed) $constants
Результат array(string=>mixed)

$context защищенное свойство

The currently used builder context.
protected BuilderContext,PDepend\Source\Builder $context
Результат PDepend\Source\Builder\BuilderContext

$methods защищенное свойство

Temporary property that only holds methods during the parsing process.
С версии: 1.0.2
protected ASTMethod[],PDepend\Source\AST $methods
Результат PDepend\Source\AST\ASTMethod[]

$modifiers защищенное свойство

The modifiers for this class instance.
protected int $modifiers
Результат integer

$namespaceName защищенное свойство

Name of the parent namespace for this class or interface instance. Or NULL when no namespace was specified.
protected string $namespaceName
Результат string

$nodes защищенное свойство

List of all parsed child nodes.
protected ASTNode[],PDepend\Source\AST $nodes
Результат PDepend\Source\AST\ASTNode[]

$userDefined защищенное свойство

The parser marks all classes and interfaces as user defined that have a source file and were part of parsing process.
protected bool $userDefined
Результат boolean