mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Update plugin interface to add $suppressed_issues
This commit is contained in:
parent
b31ac4a862
commit
9f94add470
@ -442,7 +442,7 @@ class ExpressionChecker
|
||||
}
|
||||
|
||||
foreach (Config::getInstance()->getPlugins() as $plugin) {
|
||||
if ($plugin->checkExpression($stmt, $context, $statements_checker->getCheckedFileName()) === false) {
|
||||
if ($plugin->checkExpression($stmt, $context, $statements_checker->getCheckedFileName(), $statements_checker->getSuppressedIssues()) === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ class StatementsChecker
|
||||
|
||||
foreach ($stmts as $stmt) {
|
||||
foreach (Config::getInstance()->getPlugins() as $plugin) {
|
||||
if ($plugin->checkStatement($stmt, $context, $this->checked_file_name) === false) {
|
||||
if ($plugin->checkStatement($stmt, $context, $this->checked_file_name, $this->getSuppressedIssues()) === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -11,10 +11,11 @@ abstract class Plugin
|
||||
* @param PhpParser\Node\Expr $stmt
|
||||
* @param Context $context
|
||||
* @param string $file_name
|
||||
* @param array $suppressed_issues
|
||||
* @return null|false
|
||||
* @psalm-suppress InvalidReturnType
|
||||
*/
|
||||
public function checkExpression(PhpParser\Node\Expr $stmt, Context $context, $file_name)
|
||||
public function checkExpression(PhpParser\Node\Expr $stmt, Context $context, $file_name, array $suppressed_issues)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -24,10 +25,11 @@ abstract class Plugin
|
||||
* @param PhpParser\Node $stmt
|
||||
* @param Context $context
|
||||
* @param string $file_name
|
||||
* @param array $suppressed_issues
|
||||
* @return null|false
|
||||
* @psalm-suppress InvalidReturnType
|
||||
*/
|
||||
public function checkStatement(PhpParser\Node $stmt, Context $context, $file_name)
|
||||
public function checkStatement(PhpParser\Node $stmt, Context $context, $file_name, array $suppressed_issues)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user