PHP Class Phan\Plugin

Plugins must extends this class and return an instance of themselves.
Show file Open project: etsy/phan Class Usage Examples

Public Methods

Method Description
analyzeClass ( CodeBase $code_base, Clazz $class ) : void
analyzeClass ( CodeBase $code_base, Clazz $class ) : void
analyzeFunction ( CodeBase $code_base, Func $function ) : void
analyzeFunction ( CodeBase $code_base, Func $function ) : void
analyzeMethod ( CodeBase $code_base, Method $method ) : void
analyzeMethod ( CodeBase $code_base, Method $method ) : void
analyzeNode ( CodeBase $code_base, Context $context, ast\Node $node, ast\Node $parent_node = null ) : void Analyze the given node in the given context after Phan has analyzed the node.
analyzeNode ( CodeBase $code_base, Context $context, ast\Node $node, ast\Node $parent_node = null ) : void
emitIssue ( CodeBase $code_base, Context $context, string $issue_type, string $issue_message, integer $severity = Issue::SEVERITY_NORMAL, integer $remediation_difficulty = Issue::REMEDIATION_B, integer $issue_type_id = Issue::TYPE_ID_UNKNOWN ) Emit an issue if it is not suppressed
emitIssue ( CodeBase $code_base, Context $context, string $issue_type, string $issue_message, integer $severity = Issue::SEVERITY_NORMAL, integer $remediation_difficulty = Issue::REMEDIATION_B, integer $issue_type_id = Issue::TYPE_ID_UNKNOWN ) Emit an issue if it is not suppressed
preAnalyzeNode ( CodeBase $code_base, Context $context, ast\Node $node ) : void Do a first-pass analysis of a node before Phan does its full analysis. This hook allows you to update types in the CodeBase before analysis happens.

Method Details

analyzeClass() abstract public method

abstract public analyzeClass ( CodeBase $code_base, Clazz $class ) : void
$code_base CodeBase The code base in which the class exists
$class Phan\Language\Element\Clazz A class being analyzed
return void

analyzeClass() abstract public method

abstract public analyzeClass ( CodeBase $code_base, Clazz $class ) : void
$code_base CodeBase The code base in which the class exists
$class Phan\Language\Element\Clazz A class being analyzed
return void

analyzeFunction() abstract public method

abstract public analyzeFunction ( CodeBase $code_base, Func $function ) : void
$code_base CodeBase The code base in which the function exists
$function Phan\Language\Element\Func A function being analyzed
return void

analyzeFunction() abstract public method

abstract public analyzeFunction ( CodeBase $code_base, Func $function ) : void
$code_base CodeBase The code base in which the function exists
$function Phan\Language\Element\Func A function being analyzed
return void

analyzeMethod() abstract public method

abstract public analyzeMethod ( CodeBase $code_base, Method $method ) : void
$code_base CodeBase The code base in which the method exists
$method Phan\Language\Element\Method A method being analyzed
return void

analyzeMethod() abstract public method

abstract public analyzeMethod ( CodeBase $code_base, Method $method ) : void
$code_base CodeBase The code base in which the method exists
$method Phan\Language\Element\Method A method being analyzed
return void

analyzeNode() abstract public method

Analyze the given node in the given context after Phan has analyzed the node.
abstract public analyzeNode ( CodeBase $code_base, Context $context, ast\Node $node, ast\Node $parent_node = null ) : void
$code_base CodeBase The code base in which the node exists
$context Phan\Language\Context The context in which the node exits. This is the context inside the given node rather than the context outside of the given node
$node ast\Node The php-ast Node being analyzed.
$parent_node ast\Node
return void

analyzeNode() abstract public method

abstract public analyzeNode ( CodeBase $code_base, Context $context, ast\Node $node, ast\Node $parent_node = null ) : void
$code_base CodeBase The code base in which the node exists
$context Phan\Language\Context The context in which the node exits. This is the context inside the given node rather than the context outside of the given node
$node ast\Node The php-ast Node being analyzed.
$parent_node ast\Node
return void

emitIssue() public method

Emit an issue if it is not suppressed
public emitIssue ( CodeBase $code_base, Context $context, string $issue_type, string $issue_message, integer $severity = Issue::SEVERITY_NORMAL, integer $remediation_difficulty = Issue::REMEDIATION_B, integer $issue_type_id = Issue::TYPE_ID_UNKNOWN )
$code_base CodeBase The code base in which the issue was found
$context Phan\Language\Context The context in which the issue was found
$issue_type string A name for the type of issue such as 'PhanPluginMyIssue'
$issue_message string The complete issue message to emit such as 'class with fqsen \NS\Name is broken in some fashion'.
$severity integer A value from the set {Issue::SEVERITY_LOW, Issue::SEVERITY_NORMAL, Issue::SEVERITY_HIGH}.
$remediation_difficulty integer A guess at how hard the issue will be to fix from the set {Issue:REMEDIATION_A, Issue:REMEDIATION_B, ... Issue::REMEDIATION_F} with F being the hardest.
$issue_type_id integer

emitIssue() public method

Emit an issue if it is not suppressed
public emitIssue ( CodeBase $code_base, Context $context, string $issue_type, string $issue_message, integer $severity = Issue::SEVERITY_NORMAL, integer $remediation_difficulty = Issue::REMEDIATION_B, integer $issue_type_id = Issue::TYPE_ID_UNKNOWN )
$code_base CodeBase The code base in which the issue was found
$context Phan\Language\Context The context in which the issue was found
$issue_type string A name for the type of issue such as 'PhanPluginMyIssue'
$issue_message string The complete issue message to emit such as 'class with fqsen \NS\Name is broken in some fashion'.
$severity integer A value from the set {Issue::SEVERITY_LOW, Issue::SEVERITY_NORMAL, Issue::SEVERITY_HIGH}.
$remediation_difficulty integer A guess at how hard the issue will be to fix from the set {Issue:REMEDIATION_A, Issue:REMEDIATION_B, ... Issue::REMEDIATION_F} with F being the hardest.
$issue_type_id integer

preAnalyzeNode() abstract public method

Do a first-pass analysis of a node before Phan does its full analysis. This hook allows you to update types in the CodeBase before analysis happens.
abstract public preAnalyzeNode ( CodeBase $code_base, Context $context, ast\Node $node ) : void
$code_base CodeBase The code base in which the node exists
$context Phan\Language\Context The context in which the node exits. This is the context inside the given node rather than the context outside of the given node
$node ast\Node The php-ast Node being analyzed. The parent node of the given node (if one exists).
return void