Skip to content

Commit

Permalink
Upgrade_to_psalm_5
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-worman authored and marartner committed May 22, 2023
1 parent 89086f1 commit 028f64f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"vimeo/psalm": "^4.0",
"vimeo/psalm": "^5.0",
"ext-simplexml": "*"
},
"extra": {
Expand Down
10 changes: 5 additions & 5 deletions src/Hooks/UsedEmptyHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

use Marartner\PsalmNoEmpty\Issue\UsedEmptyConstruct;
use PhpParser\Node\Expr;
use Psalm\Codebase;
use Psalm\CodeLocation;
use Psalm\Context;
use Psalm\IssueBuffer;
use Psalm\Plugin\Hook\AfterExpressionAnalysisInterface;
use Psalm\StatementsSource;
use Psalm\Plugin\EventHandler\AfterExpressionAnalysisInterface;
use Psalm\Plugin\EventHandler\Event\AfterExpressionAnalysisEvent;

final class UsedEmptyHook implements AfterExpressionAnalysisInterface
{
public static function afterExpressionAnalysis(Expr $expr, Context $context, StatementsSource $statements_source, Codebase $codebase, array &$file_replacements = []): ?bool
public static function afterExpressionAnalysis(AfterExpressionAnalysisEvent $event): ?bool
{
$expr = $event->getExpr();
if ($expr instanceof Expr\Empty_) {
$statements_source = $event->getStatementsSource();
IssueBuffer::accepts(
new UsedEmptyConstruct(
'Do not use the empty() construct',
Expand Down

0 comments on commit 028f64f

Please sign in to comment.