diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/EmptyAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/EmptyAnalyzer.php index 1598a1d42..917ffa901 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/EmptyAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/EmptyAnalyzer.php @@ -17,6 +17,18 @@ class EmptyAnalyzer ) : void { IssetAnalyzer::analyzeIssetVar($statements_analyzer, $stmt->expr, $context); + if (isset($codebase->config->forbidden_functions['empty'])) { + if (IssueBuffer::accepts( + new ForbiddenCode( + 'You have forbidden the use of empty', + new CodeLocation($statements_analyzer->getSource(), $stmt) + ), + $statements_analyzer->getSuppressedIssues() + )) { + // continue + } + } + if (($stmt_expr_type = $statements_analyzer->node_data->getType($stmt->expr)) && $stmt_expr_type->hasBool() && $stmt_expr_type->isSingle()