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

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

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

Свойство Тип Описание
$cache PDepend\Util\Cache\CacheDriver The internal used cache instance.
$cached boolean Was this file instance restored from the cache?
$childNodes PDepend\Source\AST\AbstractASTArtifact[] List of classes, interfaces and functions that parsed from this file.
$comment string The comment for this type.
$endLine integer The files end line.
$fileName string The source file name/path.
$id string The unique identifier for this function.
$startLine integer The files start line. This property must always have the value 1.

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

Метод Описание
__construct ( string $fileName ) Constructs a new source file instance.
__sleep ( ) : array(string) The magic sleep method will be called by PHP's runtime environment right before it serializes an instance of this class. This method returns an array with those property names that should be serialized.
__toString ( ) : string Returns the string representation of this class.
__wakeup ( ) : void The magic wakeup method will is called by PHP's runtime environment when a serialized instance of this class was unserialized. This implementation of the wakeup method restores the references between all parsed entities in this source file and this file instance.
accept ( PDepend\Source\ASTVisitor\ASTVisitor $visitor ) : void ASTVisitor method for node tree traversal.
addChild ( PDepend\Source\AST\AbstractASTArtifact $artifact ) : void Adds a source item that was parsed from this source file.
free ( ) : void This method can be called by the PDepend runtime environment or a utilizing component to free up memory. This methods are required for PHP version < 5.3 where cyclic references can not be resolved automatically by PHP's garbage collector.
getEndLine ( ) : integer Returns the start line number for this source file. For an existing file this value must always be greater 0, while it can be 0 for a not existing dummy file.
getFileName ( ) : string Returns the physical file name for this object.
getId ( ) : string Returns a id for this code node.
getName ( ) : string Returns the physical file name for this object.
getSource ( ) : array(integer=>string) Returns normalized source code with stripped whitespaces.
getStartLine ( ) : integer Returns the start line number for this source file. For an existing file this value must always be 1, while it can be 0 for a not existing dummy file.
getTokens ( ) : array(array) Returns an array with all tokens within this file.
isCached ( ) : boolean This method will return true when this file instance was restored from the cache and not currently parsed. Otherwise this method will return false.
setCache ( PDepend\Util\Cache\CacheDriver $cache ) : ASTCompilationUnit Setter method for the used parser and token cache.
setId ( string $id ) : void Sets the unique identifier for this file instance.
setTokens ( array $tokens ) : void Sets the tokens for this file.

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

Метод Описание
readSource ( ) : void Reads the source file if required.

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

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

Constructs a new source file instance.
public __construct ( string $fileName )
$fileName string The source file name/path.

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

The magic sleep method will be called by PHP's runtime environment right before it serializes an instance of this class. This method returns an array with those property names that should be serialized.
С версии: 0.10.0
public __sleep ( ) : array(string)
Результат array(string)

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

Returns the string representation of this class.
public __toString ( ) : string
Результат string

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

The magic wakeup method will is called by PHP's runtime environment when a serialized instance of this class was unserialized. This implementation of the wakeup method restores the references between all parsed entities in this source file and this file instance.
См. также: PDepend\Source\AST\ASTCompilationUnit::$childNodes
С версии: 0.10.0
public __wakeup ( ) : void
Результат void

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

ASTVisitor method for node tree traversal.
public accept ( PDepend\Source\ASTVisitor\ASTVisitor $visitor ) : void
$visitor PDepend\Source\ASTVisitor\ASTVisitor
Результат void

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

Adds a source item that was parsed from this source file.
С версии: 0.10.0
public addChild ( PDepend\Source\AST\AbstractASTArtifact $artifact ) : void
$artifact PDepend\Source\AST\AbstractASTArtifact
Результат void

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

This method can be called by the PDepend runtime environment or a utilizing component to free up memory. This methods are required for PHP version < 5.3 where cyclic references can not be resolved automatically by PHP's garbage collector.
Устаревший: Since 0.10.0
С версии: 0.9.12
public free ( ) : void
Результат void

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

Returns the start line number for this source file. For an existing file this value must always be greater 0, while it can be 0 for a not existing dummy file.
С версии: 0.10.0
public getEndLine ( ) : integer
Результат integer

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

Returns the physical file name for this object.
public getFileName ( ) : string
Результат string

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

Returns a id for this code node.
public getId ( ) : string
Результат string

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

Returns the physical file name for this object.
public getName ( ) : string
Результат string

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

Returns normalized source code with stripped whitespaces.
public getSource ( ) : array(integer=>string)
Результат array(integer=>string)

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

Returns the start line number for this source file. For an existing file this value must always be 1, while it can be 0 for a not existing dummy file.
С версии: 0.10.0
public getStartLine ( ) : integer
Результат integer

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

Returns an array with all tokens within this file.
public getTokens ( ) : array(array)
Результат array(array)

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

This method will return true when this file instance was restored from the cache and not currently parsed. Otherwise this method will return false.
С версии: 0.10.0
public isCached ( ) : boolean
Результат boolean

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

Reads the source file if required.
protected readSource ( ) : void
Результат void

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

Setter method for the used parser and token cache.
С версии: 0.10.0
public setCache ( PDepend\Util\Cache\CacheDriver $cache ) : ASTCompilationUnit
$cache PDepend\Util\Cache\CacheDriver
Результат ASTCompilationUnit

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

Sets the unique identifier for this file instance.
С версии: 0.9.12
public setId ( string $id ) : void
$id string Identifier for this file.
Результат void

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

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

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

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

The internal used cache instance.
С версии: 0.10.0
protected CacheDriver,PDepend\Util\Cache $cache
Результат PDepend\Util\Cache\CacheDriver

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

Was this file instance restored from the cache?
С версии: 0.10.0
protected bool $cached
Результат boolean

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

List of classes, interfaces and functions that parsed from this file.
С версии: 0.10.0
protected AbstractASTArtifact[],PDepend\Source\AST $childNodes
Результат PDepend\Source\AST\AbstractASTArtifact[]

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

The comment for this type.
protected string $comment
Результат string

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

The files end line.
С версии: 0.10.0
protected int $endLine
Результат integer

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

The source file name/path.
protected string $fileName
Результат string

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

The unique identifier for this function.
protected string $id
Результат string

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

The files start line. This property must always have the value 1.
С версии: 0.10.0
protected int $startLine
Результат integer