PHP Class PHPSA\Context

Afficher le fichier Open project: ovr/phpsa Class Usage Examples

Méthodes publiques

Свойство Type Description
$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 Properties

Свойство Type Description
$eventManager Webiny\Component\EventManager\EventManager
$filepath string
$symbols Variable[]

Méthodes publiques

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

Method Details

__construct() public méthode

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() public méthode

Creates a variable from a symbol and adds it to the context.
public addSymbol ( string $name ) : Variable
$name string
Résultat Variable

addVariable() public méthode

Adds a variable to the context.
public addVariable ( Variable $variable ) : boolean
$variable Variable
Résultat boolean

clear() public méthode

Resets context to beginning stage.
public clear ( )

clearSymbols() public méthode

Clears only all symbols.
public clearSymbols ( )

debug() public méthode

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

getCurrentBranch() public méthode

public getCurrentBranch ( ) : integer
Résultat integer

getEventManager() public méthode

public getEventManager ( ) : EventManager
Résultat Webiny\Component\EventManager\EventManager

getExpressionCompiler() public méthode

public getExpressionCompiler ( ) : Expression
Résultat PHPSA\Compiler\Expression

getFilepath() public méthode

public getFilepath ( ) : string
Résultat string

getSymbol() public méthode

Returns a variable if it exists.
public getSymbol ( $name ) : Variable | null
$name
Résultat Variable | null

getSymbols() public méthode

Returns an array of all variables.
public getSymbols ( ) : Variable[]
Résultat Variable[]

initGlobals() public méthode

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

modifyReferencedVariables() public méthode

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

notice() public méthode

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

setCurrentBranch() public méthode

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

setFilepath() public méthode

public setFilepath ( string $filepath )
$filepath string

setScope() public méthode

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

syntaxError() public méthode

Creates a syntax error message.
public syntaxError ( Error $exception, string $filepath ) : boolean
$exception PhpParser\Error
$filepath string
Résultat boolean

warning() public méthode

Creates a warning message.
public warning ( string $type, string $message ) : boolean
$type string
$message string
Résultat boolean

Property Details

$aliasManager public_oe property

public AliasManager,phpsa $aliasManager
Résultat AliasManager

$application public_oe property

public Application,phpsa $application
Résultat Application

$currentBranch public_oe property

public string|int $currentBranch
Résultat string | integer

$eventManager protected_oe property

protected EventManager,Webiny\Component\EventManager $eventManager
Résultat Webiny\Component\EventManager\EventManager

$filepath protected_oe property

protected string $filepath
Résultat string

$output public_oe property

public OutputInterface,Symfony\Component\Console\Output $output
Résultat Symfony\Component\Console\Output\OutputInterface

$scope public_oe property

For FunctionDefinition it's null, use scopePointer
public ParentDefinition,PHPSA\Definition|null $scope
Résultat PHPSA\Definition\ParentDefinition | null

$scopePointer public_oe property

public ScopePointer,phpsa|null $scopePointer
Résultat ScopePointer | null

$symbols protected_oe property

protected Variable[],phpsa $symbols
Résultat Variable[]