PHP Класс Zephir\CompilerFile

This class represents every file compiled in a project Every file may contain a class or an interface
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$_aliasManager zephir\AliasManager
$_classDefinition ClassDefinition
$_className
$_compiledFile
$_config zephir\Config
$_external
$_filePath
$_functionDefinitions zephir\FunctionDefinition[]
$_headerCBlocks array
$_ir Original internal representation (IR) of the file
$_logger zephir\Logger
$_namespace Namespace of the
$_originalNode

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

Метод Описание
__construct ( string $className, string $filePath, zephir\Config $config, zephir\Logger $logger ) CompilerFile constructor
addFunction ( Compiler $compiler, zephir\FunctionDefinition $func, array $statement = null ) Adds a function to the function definitions
applyClassHeaders ( zephir\CompilationContext $compilationContext )
checkDependencies ( Compiler $compiler ) Check dependencies
compile ( Compiler $compiler, zephir\StringsManager $stringsManager ) Compiles the file
compileClass ( zephir\CompilationContext $compilationContext, string $namespace, array $classStatement ) Compiles the class/interface contained in the file
compileComment ( zephir\CompilationContext $compilationContext, array $topStatement ) Compiles a comment as a top-level statement
compileFunction ( zephir\CompilationContext $compilationContext, zephir\FunctionDefinition $functionDefinition ) Compiles a function
genIR ( Compiler $compiler ) : array Compiles the file generating a JSON intermediate representation
getClassDefinition ( ) : ClassDefinition
getCompiledFile ( ) : string Returns the path to the compiled file
getFilePath ( ) : string Returns the path to the source file
getFunctionDefinitions ( )
isExternal ( ) : boolean
preCompile ( Compiler $compiler ) Pre-compiles a Zephir file. Generates the IR and perform basic validations
preCompileClass ( zephir\CompilationContext $compilationContext, string $namespace, array $topStatement, array $docblock ) Creates a definition for a class
preCompileInterface ( string $namespace, array $topStatement, array $docblock ) Creates a definition for an interface
setIsExternal ( boolean $external ) Sets if the class belongs to an external dependency or not

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

Метод Описание
_processShorcuts ( array $property, ClassDefinition $classDefinition ) Creates the property shortcuts
createReturnsType ( array $types ) : array | null
getFullName ( string $name ) : string Transform class/interface name to FQN format

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

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

CompilerFile constructor
public __construct ( string $className, string $filePath, zephir\Config $config, zephir\Logger $logger )
$className string
$filePath string
$config zephir\Config
$logger zephir\Logger

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

Creates the property shortcuts
protected _processShorcuts ( array $property, ClassDefinition $classDefinition )
$property array
$classDefinition ClassDefinition

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

Adds a function to the function definitions
public addFunction ( Compiler $compiler, zephir\FunctionDefinition $func, array $statement = null )
$compiler Compiler
$func zephir\FunctionDefinition
$statement array

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

public applyClassHeaders ( zephir\CompilationContext $compilationContext )
$compilationContext zephir\CompilationContext

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

Check dependencies
public checkDependencies ( Compiler $compiler )
$compiler Compiler

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

Compiles the file
public compile ( Compiler $compiler, zephir\StringsManager $stringsManager )
$compiler Compiler
$stringsManager zephir\StringsManager

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

Compiles the class/interface contained in the file
public compileClass ( zephir\CompilationContext $compilationContext, string $namespace, array $classStatement )
$compilationContext zephir\CompilationContext
$namespace string
$classStatement array

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

Compiles a comment as a top-level statement
public compileComment ( zephir\CompilationContext $compilationContext, array $topStatement )
$compilationContext zephir\CompilationContext
$topStatement array

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

Compiles a function
public compileFunction ( zephir\CompilationContext $compilationContext, zephir\FunctionDefinition $functionDefinition )
$compilationContext zephir\CompilationContext
$functionDefinition zephir\FunctionDefinition

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

protected createReturnsType ( array $types ) : array | null
$types array
Результат array | null

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

Compiles the file generating a JSON intermediate representation
public genIR ( Compiler $compiler ) : array
$compiler Compiler
Результат array

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

public getClassDefinition ( ) : ClassDefinition
Результат ClassDefinition

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

Returns the path to the compiled file
public getCompiledFile ( ) : string
Результат string

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

Returns the path to the source file
public getFilePath ( ) : string
Результат string

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

Transform class/interface name to FQN format
protected getFullName ( string $name ) : string
$name string
Результат string

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

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

public isExternal ( ) : boolean
Результат boolean

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

Pre-compiles a Zephir file. Generates the IR and perform basic validations
public preCompile ( Compiler $compiler )
$compiler Compiler

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

Creates a definition for a class
public preCompileClass ( zephir\CompilationContext $compilationContext, string $namespace, array $topStatement, array $docblock )
$compilationContext zephir\CompilationContext
$namespace string
$topStatement array
$docblock array

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

Creates a definition for an interface
public preCompileInterface ( string $namespace, array $topStatement, array $docblock )
$namespace string
$topStatement array
$docblock array

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

Sets if the class belongs to an external dependency or not
public setIsExternal ( boolean $external )
$external boolean

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

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

protected AliasManager,zephir $_aliasManager
Результат zephir\AliasManager

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

protected ClassDefinition,zephir $_classDefinition
Результат ClassDefinition

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

protected $_className

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

protected $_compiledFile

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

protected Config,zephir $_config
Результат zephir\Config

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

protected $_external

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

protected $_filePath

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

protected FunctionDefinition[],zephir $_functionDefinitions
Результат zephir\FunctionDefinition[]

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

protected array $_headerCBlocks
Результат array

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

Original internal representation (IR) of the file
protected $_ir

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

protected Logger,zephir $_logger
Результат zephir\Logger

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

Namespace of the
protected $_namespace

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

protected $_originalNode