PHP Класс Phan\Analysis\AssignmentVisitor

Наследование: extends Phan\AST\Visitor\KindVisitorImplementation
Показать файл Открыть проект

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

Метод Описание
__construct ( CodeBase $code_base, Context $context, ast\Node $assignment_node, UnionType $right_type, boolean $is_dim_assignment = false )
visit ( ast\Node $node ) : Context Default visitor for node kinds that do not have an overriding method
visitArray ( ast\Node $node ) : Context This happens for code like the following list($a) = [1, 2, 3];
visitCall ( ast\Node $node ) : Context The following is an example of how this'd happen.
visitDim ( ast\Node $node ) : Context
visitList ( ast\Node $node ) : Context
visitMethodCall ( ast\Node $node ) : Context The following is an example of how this'd happen.
visitProp ( ast\Node $node ) : Context
visitStaticProp ( ast\Node $node ) : Context
visitVar ( ast\Node $node ) : Context

Приватные методы

Метод Описание
analyzeSuperglobalDim ( ast\Node $node, string $variable_name ) : Context Analyze an assignment where $variable_name is a superglobal, and return the new context.

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

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

public __construct ( CodeBase $code_base, Context $context, ast\Node $assignment_node, UnionType $right_type, boolean $is_dim_assignment = false )
$code_base Phan\CodeBase The global code base we're operating within
$context Phan\Language\Context The context of the parser at the node for which we'd like to determine a type
$assignment_node ast\Node The AST node containing the assignment
$right_type Phan\Language\UnionType The type of the element on the right side of the assignment
$is_dim_assignment boolean True if this assignment is to an array parameter such as in `$foo[3] = 42`. We need to know this in order to decide if we're replacing the union type or if we're adding a type to the union type.

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

Default visitor for node kinds that do not have an overriding method
public visit ( ast\Node $node ) : Context
$node ast\Node A node to parse
Результат Phan\Language\Context A new or an unchanged context resulting from parsing the node

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

This happens for code like the following list($a) = [1, 2, 3];
public visitArray ( ast\Node $node ) : Context
$node ast\Node A node to parse
Результат Phan\Language\Context A new or an unchanged context resulting from parsing the node

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

php function f() { return [ 24 ]; } f()[1] = 42;
public visitCall ( ast\Node $node ) : Context
$node ast\Node A node to parse
Результат Phan\Language\Context A new or an unchanged context resulting from parsing the node

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

public visitDim ( ast\Node $node ) : Context
$node ast\Node A node to parse
Результат Phan\Language\Context A new or an unchanged context resulting from parsing the node

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

public visitList ( ast\Node $node ) : Context
$node ast\Node A node to parse
Результат Phan\Language\Context A new or an unchanged context resulting from parsing the node

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

php class C { function f() { return [ 24 ]; } } (new C)->f()[1] = 42;
public visitMethodCall ( ast\Node $node ) : Context
$node ast\Node A node to parse
Результат Phan\Language\Context A new or an unchanged context resulting from parsing the node

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

public visitProp ( ast\Node $node ) : Context
$node ast\Node A node to parse
Результат Phan\Language\Context A new or an unchanged context resulting from parsing the node

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

public visitStaticProp ( ast\Node $node ) : Context
$node ast\Node A node to parse
Результат Phan\Language\Context A new or an unchanged context resulting from parsing the node

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

public visitVar ( ast\Node $node ) : Context
$node ast\Node A node to parse
Результат Phan\Language\Context A new or an unchanged context resulting from parsing the node