mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 12:55:26 +01:00
Get rid of var_dumps
This commit is contained in:
parent
7d6ac4719f
commit
721e0d01e2
@ -18,6 +18,7 @@ use Psalm\Issue\ForbiddenCode;
|
||||
use Psalm\Issue\InvalidStaticVariable;
|
||||
use Psalm\Issue\PossiblyUndefinedVariable;
|
||||
use Psalm\Issue\UndefinedVariable;
|
||||
use Psalm\Issue\UnrecognizedExpression;
|
||||
use Psalm\IssueBuffer;
|
||||
use Psalm\Type;
|
||||
|
||||
@ -366,8 +367,16 @@ class ExpressionChecker
|
||||
} elseif ($stmt instanceof PhpParser\Node\Expr\YieldFrom) {
|
||||
self::checkYieldFrom($statements_checker, $stmt, $context);
|
||||
} else {
|
||||
var_dump('Unrecognised expression in ' . $statements_checker->getCheckedFileName());
|
||||
var_dump($stmt);
|
||||
if (IssueBuffer::accepts(
|
||||
new UnrecognizedExpression(
|
||||
'Psalm does not understand ' . get_class($stmt),
|
||||
$statements_checker->getCheckedFileName(),
|
||||
$stmt->getLine()
|
||||
),
|
||||
$statements_checker->getSuppressedIssues()
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Config::getInstance()->getPlugins() as $plugin) {
|
||||
|
@ -15,6 +15,7 @@ use Psalm\Context;
|
||||
use Psalm\Issue\ContinueOutsideLoop;
|
||||
use Psalm\Issue\InvalidGlobal;
|
||||
use Psalm\Issue\InvalidNamespace;
|
||||
use Psalm\Issue\UnrecognizedStatement;
|
||||
use Psalm\IssueBuffer;
|
||||
use Psalm\StatementsSource;
|
||||
use Psalm\Type;
|
||||
@ -318,8 +319,16 @@ class StatementsChecker
|
||||
$namespace_checker = new NamespaceChecker($stmt, $this->source);
|
||||
$namespace_checker->check(true);
|
||||
} else {
|
||||
var_dump('Unrecognised statement in ' . $this->checked_file_name);
|
||||
var_dump($stmt);
|
||||
if (IssueBuffer::accepts(
|
||||
new UnrecognizedStatement(
|
||||
'Psalm does not understand ' . get_class($stmt),
|
||||
$this->getCheckedFileName(),
|
||||
$stmt->getLine()
|
||||
),
|
||||
$this->getSuppressedIssues()
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
6
src/Psalm/Issue/UnrecognizedExpression.php
Normal file
6
src/Psalm/Issue/UnrecognizedExpression.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace Psalm\Issue;
|
||||
|
||||
class UnrecognizedExpression extends CodeError
|
||||
{
|
||||
}
|
6
src/Psalm/Issue/UnrecognizedStatement.php
Normal file
6
src/Psalm/Issue/UnrecognizedStatement.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace Psalm\Issue;
|
||||
|
||||
class UnrecognizedStatement extends CodeError
|
||||
{
|
||||
}
|
Loading…
Reference in New Issue
Block a user