Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7440008
SuppressionCapability.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
SuppressionCapability.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Phan\PluginV3
;
use
Phan\CodeBase
;
use
Phan\Language\Context
;
use
Phan\Language\Element\TypedElement
;
use
Phan\Language\Element\UnaddressableTypedElement
;
use
Phan\Language\FQSEN
;
use
Phan\Language\Type
;
use
Phan\Language\UnionType
;
use
Phan\Suggestion
;
/**
* Plugins can implement this to suppress issues in additional ways.
*
* @see \Phan\Plugin\Internal\BuiltinSuppressionPlugin for an example of how to implement a plugin with this functionality
*/
interface
SuppressionCapability
{
/**
* This will be called if both of these conditions hold:
*
* 1. Phan's file and element-based suppressions did not suppress the issue
* 2. Earlier plugins didn't suppress the issue.
*
* To get the file's current contents, the recommended method is:
*
* $absolute_file_path = Config::projectPath($context->getFile());
* $file_contents = \Phan\Library\FileCache::getOrReadEntry($absolute_file_path)->getContents()
*
* @param CodeBase $code_base
*
* @param Context $context context near where the issue occurred
*
* @param string $issue_type
* The type of issue to emit such as Issue::ParentlessClass
*
* @param int $lineno
* The line number where the issue was found
*
* @param list<string|int|float|bool|Type|UnionType|FQSEN|TypedElement|UnaddressableTypedElement> $parameters
*
* @param ?Suggestion $suggestion Phan's suggestion for how to fix the issue, if any.
*
* @return bool true if the given issue instance should be suppressed, given the current file contents.
*/
public
function
shouldSuppressIssue
(
CodeBase
$code_base
,
Context
$context
,
string
$issue_type
,
int
$lineno
,
array
$parameters
,
?
Suggestion
$suggestion
):
bool
;
/**
* This method is used only by UnusedSuppressionPlugin.
* It's optional to return lines for issues that were already suppressed.
*
* To get the file's current contents, the recommended method is:
* $file_contents = \Phan\Library\FileCache::getOrReadEntry(Config::projectPath($file_path))->getContents()
*
* @param CodeBase $code_base
*
* @param string $file_path the file to check for suppressions of
*
* @return array<string,list<int>> Maps 0 or more issue types to a *map* of lines that this plugin is going to suppress.
* The keys of the map are the lines being suppressed, and the values are the lines *causing* the suppressions (if extracted from comments or nodes)
*
* An empty array can be returned if this is unknown.
*/
public
function
getIssueSuppressionList
(
CodeBase
$code_base
,
string
$file_path
):
array
;
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 15:21 (10 h, 19 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a6/f2/bee9e3be4b6a154b3c544f586ed3
Default Alt Text
SuppressionCapability.php (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment