diff --git a/UPGRADING.md b/UPGRADING.md
index a389e609676..070a7f54607 100644
--- a/UPGRADING.md
+++ b/UPGRADING.md
@@ -131,6 +131,7 @@
- [BC] Method `Psalm\Type\Union::isEmpty()` was removed
- [BC] Property `Psalm\Config::$allow_phpstorm_generics` was removed
- [BC] Property `Psalm\Config::$exit_functions` was removed
+ - [BC] Property `Psalm\Config::$forbid_echo` was removed
- [BC] Method `Psalm\Type::getEmpty()` was removed
- [BC] Legacy hook interfaces have been removed:
- `Psalm\Plugin\Hook\MethodReturnTypeProviderInterface`
diff --git a/config.xsd b/config.xsd
index d3b8089f237..42ad433c242 100644
--- a/config.xsd
+++ b/config.xsd
@@ -41,13 +41,6 @@
-
-
-
- Deprecated. Will be replaced by adding echo to forbiddenFunctions in Psalm 5.
-
-
-
@@ -233,7 +226,6 @@
-
diff --git a/docs/running_psalm/error_levels.md b/docs/running_psalm/error_levels.md
index 3babb92488a..8cd5942721f 100644
--- a/docs/running_psalm/error_levels.md
+++ b/docs/running_psalm/error_levels.md
@@ -284,7 +284,6 @@ These issues are treated as errors at level 7 and below.
## Feature-specific errors
- - [ForbiddenEcho](issues/ForbiddenEcho.md)
- [PossiblyUndefinedIntArrayOffset](issues/PossiblyUndefinedIntArrayOffset.md)
- [PossiblyUndefinedStringArrayOffset](issues/PossiblyUndefinedStringArrayOffset.md)
- [PossiblyUnusedMethod](issues/PossiblyUnusedMethod.md)
diff --git a/docs/running_psalm/issues.md b/docs/running_psalm/issues.md
index c471c86f4cb..b392b7fad64 100644
--- a/docs/running_psalm/issues.md
+++ b/docs/running_psalm/issues.md
@@ -32,7 +32,6 @@
- [FalsableReturnStatement](issues/FalsableReturnStatement.md)
- [FalseOperand](issues/FalseOperand.md)
- [ForbiddenCode](issues/ForbiddenCode.md)
- - [ForbiddenEcho](issues/ForbiddenEcho.md)
- [IfThisIsMismatch](issues/IfThisIsMismatch.md)
- [ImplementationRequirementViolation](issues/ImplementationRequirementViolation.md)
- [ImplementedParamTypeMismatch](issues/ImplementedParamTypeMismatch.md)
diff --git a/docs/running_psalm/issues/ForbiddenEcho.md b/docs/running_psalm/issues/ForbiddenEcho.md
deleted file mode 100644
index 4aedd3ee055..00000000000
--- a/docs/running_psalm/issues/ForbiddenEcho.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# ForbiddenEcho
-
-Emitted when Psalm encounters an echo statement and the `forbidEcho` flag in your config is set to `true`
-This issue is deprecated and will be removed in Psalm 5. Adding echo to forbiddenFunctions in config will result in ForbiddenCode issue instead
-```php
- 'add_param_default_to_docblock_type',
'checkForThrowsDocblock' => 'check_for_throws_docblock',
'checkForThrowsInGlobalScope' => 'check_for_throws_in_global_scope',
- 'forbidEcho' => 'forbid_echo',
'ignoreInternalFunctionFalseReturn' => 'ignore_internal_falsable_issues',
'ignoreInternalFunctionNullReturn' => 'ignore_internal_nullable_issues',
'includePhpVersionsInErrorBaseline' => 'include_php_versions_in_error_baseline',
diff --git a/src/Psalm/Internal/Analyzer/Statements/EchoAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/EchoAnalyzer.php
index 1cfea01d028..441f6a50d18 100644
--- a/src/Psalm/Internal/Analyzer/Statements/EchoAnalyzer.php
+++ b/src/Psalm/Internal/Analyzer/Statements/EchoAnalyzer.php
@@ -12,7 +12,6 @@
use Psalm\Internal\Codebase\TaintFlowGraph;
use Psalm\Internal\DataFlow\TaintSink;
use Psalm\Issue\ForbiddenCode;
-use Psalm\Issue\ForbiddenEcho;
use Psalm\Issue\ImpureFunctionCall;
use Psalm\IssueBuffer;
use Psalm\Storage\FunctionLikeParameter;
@@ -96,17 +95,7 @@ public static function analyze(
}
}
- if ($codebase->config->forbid_echo) {
- if (IssueBuffer::accepts(
- new ForbiddenEcho(
- 'Use of echo',
- new CodeLocation($statements_analyzer, $stmt)
- ),
- $statements_analyzer->getSource()->getSuppressedIssues()
- )) {
- return false;
- }
- } elseif (isset($codebase->config->forbidden_functions['echo'])) {
+ if (isset($codebase->config->forbidden_functions['echo'])) {
IssueBuffer::maybeAdd(
new ForbiddenCode(
'Use of echo',
diff --git a/src/Psalm/Issue/ForbiddenEcho.php b/src/Psalm/Issue/ForbiddenEcho.php
deleted file mode 100644
index 73a84fe7455..00000000000
--- a/src/Psalm/Issue/ForbiddenEcho.php
+++ /dev/null
@@ -1,9 +0,0 @@
-analyzeFile($file_path, new Context());
}
- public function testForbiddenEchoFunctionViaFunctions(): void
+ public function testForbiddenCodeFunctionViaFunctions(): void
{
$this->expectExceptionMessage('ForbiddenCode');
$this->expectException(CodeException::class);
@@ -124,29 +124,6 @@ public function testForbiddenEchoFunctionViaFunctions(): void
$this->analyzeFile($file_path, new Context());
}
- public function testForbiddenEchoFunctionViaFlag(): void
- {
- $this->expectExceptionMessage('ForbiddenEcho');
- $this->expectException(CodeException::class);
- $this->project_analyzer = $this->getProjectAnalyzerWithConfig(
- TestConfig::loadFromXML(
- dirname(__DIR__, 2),
- '
- '
- )
- );
-
- $file_path = getcwd() . '/src/somefile.php';
-
- $this->addFile(
- $file_path,
- 'analyzeFile($file_path, new Context());
- }
-
public function testAllowedPrintFunction(): void
{
$this->project_analyzer = $this->getProjectAnalyzerWithConfig(