PHP 클래스 Phan\Analysis\AssignmentVisitor

상속: extends Phan\AST\Visitor\KindVisitorImplementation
파일 보기 프로젝트 열기: etsy/phan

공개 메소드들

메소드 설명
__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