PHP Class Phan\Analysis

Show file Open project: etsy/phan Class Usage Examples

Public Methods

Method Description
analyzeClasses ( $code_base ) : void Take a pass over all classes/traits/interfaces verifying various states.
analyzeDeadCode ( CodeBase $code_base ) : void Take a look at all globally accessible elements and see if we can find any dead code that is never referenced
analyzeDeadCode ( CodeBase $code_base ) : void Take a look at all globally accessible elements and see if we can find any dead code that is never referenced
analyzeFile ( CodeBase $code_base, string $file_path ) : Context Once we know what the universe looks like we can scan for more complicated issues.
analyzeFile ( CodeBase $code_base, string $file_path ) : Context Once we know what the universe looks like we can scan for more complicated issues.
analyzeFunctions ( CodeBase $code_base ) : null Take a pass over all functions verifying various states.
analyzeFunctions ( CodeBase $code_base ) : null Take a pass over all functions verifying various states.
parseFile ( CodeBase $code_base, string $file_path ) : Context This first pass parses code and looks for the subset of issues that can be found without having to have an understanding of the entire code base.
parseFile ( CodeBase $code_base, string $file_path ) : Context This first pass parses code and looks for the subset of issues that can be found without having to have an understanding of the entire code base.
parseNodeInContext ( CodeBase $code_base, Context $context, ast\Node $node ) : Context Parse the given node in the given context populating the code base within the context as a side effect. The returned context is the new context from within the given node.
parseNodeInContext ( CodeBase $code_base, Context $context, ast\Node $node ) : Context Parse the given node in the given context populating the code base within the context as a side effect. The returned context is the new context from within the given node.
shouldVisit ( ast\Node $node ) : boolean Possible Premature Optimization. We can trim a bunch of calls to nodes that we'll never analyze during parsing, pre-order analysis or post-order analysis.

Method Details

analyzeClasses() public static method

Take a pass over all classes/traits/interfaces verifying various states.
public static analyzeClasses ( $code_base ) : void
return void

analyzeDeadCode() public static method

Take a look at all globally accessible elements and see if we can find any dead code that is never referenced
public static analyzeDeadCode ( CodeBase $code_base ) : void
$code_base CodeBase
return void

analyzeDeadCode() public static method

Take a look at all globally accessible elements and see if we can find any dead code that is never referenced
public static analyzeDeadCode ( CodeBase $code_base ) : void
$code_base CodeBase
return void

analyzeFile() public static method

Once we know what the universe looks like we can scan for more complicated issues.
public static analyzeFile ( CodeBase $code_base, string $file_path ) : Context
$code_base CodeBase The global code base holding all state
$file_path string A list of files to scan
return Phan\Language\Context

analyzeFile() public static method

Once we know what the universe looks like we can scan for more complicated issues.
public static analyzeFile ( CodeBase $code_base, string $file_path ) : Context
$code_base CodeBase The global code base holding all state
$file_path string A list of files to scan
return Phan\Language\Context

analyzeFunctions() public static method

Take a pass over all functions verifying various states.
public static analyzeFunctions ( CodeBase $code_base ) : null
$code_base CodeBase
return null

analyzeFunctions() public static method

Take a pass over all functions verifying various states.
public static analyzeFunctions ( CodeBase $code_base ) : null
$code_base CodeBase
return null

parseFile() public static method

This first pass parses code and looks for the subset of issues that can be found without having to have an understanding of the entire code base.
public static parseFile ( CodeBase $code_base, string $file_path ) : Context
$code_base CodeBase The CodeBase represents state across the entire code base. This is a mutable object which is populated as we parse files
$file_path string The full path to a file we'd like to parse
return Phan\Language\Context

parseFile() public static method

This first pass parses code and looks for the subset of issues that can be found without having to have an understanding of the entire code base.
public static parseFile ( CodeBase $code_base, string $file_path ) : Context
$code_base CodeBase The CodeBase represents state across the entire code base. This is a mutable object which is populated as we parse files
$file_path string The full path to a file we'd like to parse
return Phan\Language\Context

parseNodeInContext() public static method

Parse the given node in the given context populating the code base within the context as a side effect. The returned context is the new context from within the given node.
public static parseNodeInContext ( CodeBase $code_base, Context $context, ast\Node $node ) : Context
$code_base CodeBase The global code base in which we store all state
$context Phan\Language\Context The context in which this node exists
$node ast\Node A node to parse and scan for errors
return Phan\Language\Context The context from within the node is returned

parseNodeInContext() public static method

Parse the given node in the given context populating the code base within the context as a side effect. The returned context is the new context from within the given node.
public static parseNodeInContext ( CodeBase $code_base, Context $context, ast\Node $node ) : Context
$code_base CodeBase The global code base in which we store all state
$context Phan\Language\Context The context in which this node exists
$node ast\Node A node to parse and scan for errors
return Phan\Language\Context The context from within the node is returned

shouldVisit() public static method

Possible Premature Optimization. We can trim a bunch of calls to nodes that we'll never analyze during parsing, pre-order analysis or post-order analysis.
public static shouldVisit ( ast\Node $node ) : boolean
$node ast\Node A node we'd like to determine if we should visit
return boolean True if the given node should be visited or false if it should be skipped entirely