PHP Класс PHPSA\Context

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$aliasManager AliasManager
$application Application
$currentBranch string | integer
$output Symfony\Component\Console\Output\OutputInterface
$scope PHPSA\Definition\ParentDefinition | null For FunctionDefinition it's null, use scopePointer
$scopePointer ScopePointer | null

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

Свойство Тип Описание
$eventManager Webiny\Component\EventManager\EventManager
$filepath string
$symbols Variable[]

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

Метод Описание
__construct ( Symfony\Component\Console\Output\OutputInterface $output, Application $application, EventManager $eventManager ) Construct our Context with all needed information
addSymbol ( string $name ) : Variable Creates a variable from a symbol and adds it to the context.
addVariable ( Variable $variable ) : boolean Adds a variable to the context.
clear ( ) Resets context to beginning stage.
clearSymbols ( ) Clears only all symbols.
debug ( $message, PhpParser\Node $expr = null ) Creates a debug message.
getCurrentBranch ( ) : integer
getEventManager ( ) : EventManager
getExpressionCompiler ( ) : Expression
getFilepath ( ) : string
getSymbol ( $name ) : Variable | null Returns a variable if it exists.
getSymbols ( ) : Variable[] Returns an array of all variables.
initGlobals ( ) Adds all global variables to the context.
modifyReferencedVariables ( Variable $variable, $type, $value ) Updates all references on the given variable.
notice ( string $type, string $message, NodeAbstract $expr, integer $status = Check::CHECK_SAFE ) : boolean Creates a notice message.
setCurrentBranch ( integer | string $currentBranch )
setFilepath ( string $filepath )
setScope ( AbstractDefinition $scope = null )
syntaxError ( Error $exception, string $filepath ) : boolean Creates a syntax error message.
warning ( string $type, string $message ) : boolean Creates a warning message.

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

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

Construct our Context with all needed information
public __construct ( Symfony\Component\Console\Output\OutputInterface $output, Application $application, EventManager $eventManager )
$output Symfony\Component\Console\Output\OutputInterface
$application Application
$eventManager Webiny\Component\EventManager\EventManager

addSymbol() публичный метод

Creates a variable from a symbol and adds it to the context.
public addSymbol ( string $name ) : Variable
$name string
Результат Variable

addVariable() публичный метод

Adds a variable to the context.
public addVariable ( Variable $variable ) : boolean
$variable Variable
Результат boolean

clear() публичный метод

Resets context to beginning stage.
public clear ( )

clearSymbols() публичный метод

Clears only all symbols.
public clearSymbols ( )

debug() публичный метод

Creates a debug message.
public debug ( $message, PhpParser\Node $expr = null )
$expr PhpParser\Node

getCurrentBranch() публичный метод

public getCurrentBranch ( ) : integer
Результат integer

getEventManager() публичный метод

public getEventManager ( ) : EventManager
Результат Webiny\Component\EventManager\EventManager

getExpressionCompiler() публичный метод

public getExpressionCompiler ( ) : Expression
Результат PHPSA\Compiler\Expression

getFilepath() публичный метод

public getFilepath ( ) : string
Результат string

getSymbol() публичный метод

Returns a variable if it exists.
public getSymbol ( $name ) : Variable | null
$name
Результат Variable | null

getSymbols() публичный метод

Returns an array of all variables.
public getSymbols ( ) : Variable[]
Результат Variable[]

initGlobals() публичный метод

Adds all global variables to the context.
public initGlobals ( )

modifyReferencedVariables() публичный метод

Updates all references on the given variable.
public modifyReferencedVariables ( Variable $variable, $type, $value )
$variable Variable
$type
$value

notice() публичный метод

Creates a notice message.
public notice ( string $type, string $message, NodeAbstract $expr, integer $status = Check::CHECK_SAFE ) : boolean
$type string
$message string
$expr PhpParser\NodeAbstract
$status integer
Результат boolean

setCurrentBranch() публичный метод

public setCurrentBranch ( integer | string $currentBranch )
$currentBranch integer | string

setFilepath() публичный метод

public setFilepath ( string $filepath )
$filepath string

setScope() публичный метод

public setScope ( AbstractDefinition $scope = null )
$scope PHPSA\Definition\AbstractDefinition

syntaxError() публичный метод

Creates a syntax error message.
public syntaxError ( Error $exception, string $filepath ) : boolean
$exception PhpParser\Error
$filepath string
Результат boolean

warning() публичный метод

Creates a warning message.
public warning ( string $type, string $message ) : boolean
$type string
$message string
Результат boolean

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

$aliasManager публичное свойство

public AliasManager,phpsa $aliasManager
Результат AliasManager

$application публичное свойство

public Application,phpsa $application
Результат Application

$currentBranch публичное свойство

public string|int $currentBranch
Результат string | integer

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

protected EventManager,Webiny\Component\EventManager $eventManager
Результат Webiny\Component\EventManager\EventManager

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

protected string $filepath
Результат string

$output публичное свойство

public OutputInterface,Symfony\Component\Console\Output $output
Результат Symfony\Component\Console\Output\OutputInterface

$scope публичное свойство

For FunctionDefinition it's null, use scopePointer
public ParentDefinition,PHPSA\Definition|null $scope
Результат PHPSA\Definition\ParentDefinition | null

$scopePointer публичное свойство

public ScopePointer,phpsa|null $scopePointer
Результат ScopePointer | null

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

protected Variable[],phpsa $symbols
Результат Variable[]