PHP Class Phan\Issue

Show file Open project: etsy/phan Class Usage Examples

Public Methods

Method Description
__construct ( string $type, integer $category, integer $severity, string $template, integer $remediation_difficulty, integer $type_id )
__invoke ( string $file, integer $line, array $template_parameters = [] ) : phan\IssueInstance
emit ( string $type, string $file, integer $line, variadic $template_parameters ) : void
emitInstance ( phan\IssueInstance $issue_instance ) : void
emitWithParameters ( string $type, string $file, integer $line, array $template_parameters ) : void
fromType ( string $type ) : Issue return Issue
getCategory ( ) : integer
getNameForCategory ( integer $category ) : string
getRemediationDifficulty ( ) : integer
getSeverity ( ) : integer
getSeverityName ( ) : string
getTemplate ( ) : string
getType ( ) : string
getTypeId ( ) : integer
issueMap ( ) : Issue[]
maybeEmit ( CodeBase $code_base, Context $context, string $issue_type, integer $lineno, $parameters ) : void
maybeEmit ( CodeBase $code_base, Context $context, string $issue_type, integer $lineno, $parameters ) : void
maybeEmitInstance ( CodeBase $code_base, Context $context, phan\IssueInstance $issue_instance ) : void
maybeEmitInstance ( CodeBase $code_base, Context $context, phan\IssueInstance $issue_instance ) : void
maybeEmitWithParameters ( CodeBase $code_base, Context $context, string $issue_type, integer $lineno, array $parameters ) : void
maybeEmitWithParameters ( CodeBase $code_base, Context $context, string $issue_type, integer $lineno, array $parameters ) : void

Method Details

__construct() public method

public __construct ( string $type, integer $category, integer $severity, string $template, integer $remediation_difficulty, integer $type_id )
$type string
$category integer
$severity integer
$template string
$remediation_difficulty integer
$type_id integer (unique integer id for $type)

__invoke() public method

public __invoke ( string $file, integer $line, array $template_parameters = [] ) : phan\IssueInstance
$file string
$line integer
$template_parameters array
return phan\IssueInstance

emit() public static method

public static emit ( string $type, string $file, integer $line, variadic $template_parameters ) : void
$type string The type of the issue
$file string The name of the file where the issue was found
$line integer The line number (start) where the issue was found
$template_parameters variadic Any template parameters required for the issue message
return void

emitInstance() public static method

public static emitInstance ( phan\IssueInstance $issue_instance ) : void
$issue_instance phan\IssueInstance An issue instance to emit
return void

emitWithParameters() public static method

public static emitWithParameters ( string $type, string $file, integer $line, array $template_parameters ) : void
$type string The type of the issue
$file string The name of the file where the issue was found
$line integer The line number (start) where the issue was found
$template_parameters array Any template parameters required for the issue message
return void

fromType() public static method

return Issue
public static fromType ( string $type ) : Issue
$type string
return Issue

getCategory() public method

public getCategory ( ) : integer
return integer

getNameForCategory() public static method

public static getNameForCategory ( integer $category ) : string
$category integer
return string The name of the category

getRemediationDifficulty() public method

getSeverity() public method

public getSeverity ( ) : integer
return integer

getSeverityName() public method

public getSeverityName ( ) : string
return string A descriptive name of the severity of hte issue

getTemplate() public method

public getTemplate ( ) : string
return string

getType() public method

public getType ( ) : string
return string

getTypeId() public method

public getTypeId ( ) : integer
return integer (Unique integer code corresponding to getType())

issueMap() public static method

public static issueMap ( ) : Issue[]
return Issue[]

maybeEmit() public static method

public static maybeEmit ( CodeBase $code_base, Context $context, string $issue_type, integer $lineno, $parameters ) : void
$code_base CodeBase The code base within which we're operating
$context Phan\Language\Context The context in which the node we're going to be looking at exits.
$issue_type string The type of issue to emit such as Issue::ParentlessClass
$lineno integer The line number where the issue was found
return void

maybeEmit() public static method

public static maybeEmit ( CodeBase $code_base, Context $context, string $issue_type, integer $lineno, $parameters ) : void
$code_base CodeBase The code base within which we're operating
$context Phan\Language\Context The context in which the node we're going to be looking at exits.
$issue_type string The type of issue to emit such as Issue::ParentlessClass
$lineno integer The line number where the issue was found
return void

maybeEmitInstance() public static method

public static maybeEmitInstance ( CodeBase $code_base, Context $context, phan\IssueInstance $issue_instance ) : void
$code_base CodeBase The code base within which we're operating
$context Phan\Language\Context The context in which the instance was found
$issue_instance phan\IssueInstance An issue instance to emit
return void

maybeEmitInstance() public static method

public static maybeEmitInstance ( CodeBase $code_base, Context $context, phan\IssueInstance $issue_instance ) : void
$code_base CodeBase The code base within which we're operating
$context Phan\Language\Context The context in which the instance was found
$issue_instance phan\IssueInstance An issue instance to emit
return void

maybeEmitWithParameters() public static method

public static maybeEmitWithParameters ( CodeBase $code_base, Context $context, string $issue_type, integer $lineno, array $parameters ) : void
$code_base CodeBase The code base within which we're operating
$context Phan\Language\Context The context in which the node we're going to be looking at exits.
$issue_type string The type of issue to emit such as Issue::ParentlessClass
$lineno integer The line number where the issue was found
$parameters array
return void

maybeEmitWithParameters() public static method

public static maybeEmitWithParameters ( CodeBase $code_base, Context $context, string $issue_type, integer $lineno, array $parameters ) : void
$code_base CodeBase The code base within which we're operating
$context Phan\Language\Context The context in which the node we're going to be looking at exits.
$issue_type string The type of issue to emit such as Issue::ParentlessClass
$lineno integer The line number where the issue was found
$parameters array
return void