From 17ea7784dd97acc08e3f01beb3a55766d4e8b5e4 Mon Sep 17 00:00:00 2001 From: orklah Date: Sat, 28 Nov 2020 15:03:03 +0100 Subject: [PATCH] fix #3282 (#4724) --- docs/running_psalm/issues/MutableDependency.md | 2 +- src/Psalm/Internal/Analyzer/ClassAnalyzer.php | 12 ++++++------ src/Psalm/Internal/Analyzer/MethodComparator.php | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/running_psalm/issues/MutableDependency.md b/docs/running_psalm/issues/MutableDependency.md index fb855305a..47ccee3ae 100644 --- a/docs/running_psalm/issues/MutableDependency.md +++ b/docs/running_psalm/issues/MutableDependency.md @@ -1,6 +1,6 @@ # MutableDependency -Emitted when an immutable class inherits from a class or trait not marked immutable +Emitted when an immutable class inherits from a class or trait not marked @psalm-immutable ```php suppressed_issues + $this->getSuppressedIssues() @@ -328,7 +328,7 @@ class ClassAnalyzer extends ClassLikeAnalyzer ) { if (IssueBuffer::accepts( new MutableDependency( - $fq_class_name . ' is marked immutable but ' . $parent_fq_class_name . ' is not', + $fq_class_name . ' is marked @psalm-immutable but ' . $parent_fq_class_name . ' is not', $code_location ), $storage->suppressed_issues + $this->getSuppressedIssues() @@ -550,8 +550,8 @@ class ClassAnalyzer extends ClassLikeAnalyzer ) { if (IssueBuffer::accepts( new MissingImmutableAnnotation( - $interface_name . ' is marked immutable, but ' - . $fq_class_name . ' is not marked immutable', + $interface_name . ' is marked @psalm-immutable, but ' + . $fq_class_name . ' is not marked @psalm-immutable', $code_location ), $storage->suppressed_issues + $this->getSuppressedIssues() @@ -1615,7 +1615,7 @@ class ClassAnalyzer extends ClassLikeAnalyzer if ($storage->mutation_free && !$trait_storage->mutation_free) { if (IssueBuffer::accepts( new MutableDependency( - $storage->name . ' is marked immutable but ' . $fq_trait_name . ' is not', + $storage->name . ' is marked @psalm-immutable but ' . $fq_trait_name . ' is not', new CodeLocation($previous_trait_analyzer ?: $this, $trait_name) ), $storage->suppressed_issues + $this->getSuppressedIssues() diff --git a/src/Psalm/Internal/Analyzer/MethodComparator.php b/src/Psalm/Internal/Analyzer/MethodComparator.php index a50d77692..11a4ff8ef 100644 --- a/src/Psalm/Internal/Analyzer/MethodComparator.php +++ b/src/Psalm/Internal/Analyzer/MethodComparator.php @@ -281,10 +281,10 @@ class MethodComparator ) { if (IssueBuffer::accepts( new MissingImmutableAnnotation( - $cased_guide_method_id . ' is marked immutable, but ' + $cased_guide_method_id . ' is marked @psalm-immutable, but ' . $implementer_classlike_storage->name . '::' . ($guide_method_storage->cased_name ?: '') - . ' is not marked immutable', + . ' is not marked @psalm-immutable', $code_location ), $suppressed_issues