mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
parent
c0a0497d1a
commit
17ea7784dd
@ -1,6 +1,6 @@
|
|||||||
# MutableDependency
|
# 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
|
```php
|
||||||
<?php
|
<?php
|
||||||
|
@ -313,8 +313,8 @@ class ClassAnalyzer extends ClassLikeAnalyzer
|
|||||||
) {
|
) {
|
||||||
if (IssueBuffer::accepts(
|
if (IssueBuffer::accepts(
|
||||||
new MissingImmutableAnnotation(
|
new MissingImmutableAnnotation(
|
||||||
$parent_fq_class_name . ' is marked immutable, but '
|
$parent_fq_class_name . ' is marked @psalm-immutable, but '
|
||||||
. $fq_class_name . ' is not marked immutable',
|
. $fq_class_name . ' is not marked @psalm-immutable',
|
||||||
$code_location
|
$code_location
|
||||||
),
|
),
|
||||||
$storage->suppressed_issues + $this->getSuppressedIssues()
|
$storage->suppressed_issues + $this->getSuppressedIssues()
|
||||||
@ -328,7 +328,7 @@ class ClassAnalyzer extends ClassLikeAnalyzer
|
|||||||
) {
|
) {
|
||||||
if (IssueBuffer::accepts(
|
if (IssueBuffer::accepts(
|
||||||
new MutableDependency(
|
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
|
$code_location
|
||||||
),
|
),
|
||||||
$storage->suppressed_issues + $this->getSuppressedIssues()
|
$storage->suppressed_issues + $this->getSuppressedIssues()
|
||||||
@ -550,8 +550,8 @@ class ClassAnalyzer extends ClassLikeAnalyzer
|
|||||||
) {
|
) {
|
||||||
if (IssueBuffer::accepts(
|
if (IssueBuffer::accepts(
|
||||||
new MissingImmutableAnnotation(
|
new MissingImmutableAnnotation(
|
||||||
$interface_name . ' is marked immutable, but '
|
$interface_name . ' is marked @psalm-immutable, but '
|
||||||
. $fq_class_name . ' is not marked immutable',
|
. $fq_class_name . ' is not marked @psalm-immutable',
|
||||||
$code_location
|
$code_location
|
||||||
),
|
),
|
||||||
$storage->suppressed_issues + $this->getSuppressedIssues()
|
$storage->suppressed_issues + $this->getSuppressedIssues()
|
||||||
@ -1615,7 +1615,7 @@ class ClassAnalyzer extends ClassLikeAnalyzer
|
|||||||
if ($storage->mutation_free && !$trait_storage->mutation_free) {
|
if ($storage->mutation_free && !$trait_storage->mutation_free) {
|
||||||
if (IssueBuffer::accepts(
|
if (IssueBuffer::accepts(
|
||||||
new MutableDependency(
|
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)
|
new CodeLocation($previous_trait_analyzer ?: $this, $trait_name)
|
||||||
),
|
),
|
||||||
$storage->suppressed_issues + $this->getSuppressedIssues()
|
$storage->suppressed_issues + $this->getSuppressedIssues()
|
||||||
|
@ -281,10 +281,10 @@ class MethodComparator
|
|||||||
) {
|
) {
|
||||||
if (IssueBuffer::accepts(
|
if (IssueBuffer::accepts(
|
||||||
new MissingImmutableAnnotation(
|
new MissingImmutableAnnotation(
|
||||||
$cased_guide_method_id . ' is marked immutable, but '
|
$cased_guide_method_id . ' is marked @psalm-immutable, but '
|
||||||
. $implementer_classlike_storage->name . '::'
|
. $implementer_classlike_storage->name . '::'
|
||||||
. ($guide_method_storage->cased_name ?: '')
|
. ($guide_method_storage->cased_name ?: '')
|
||||||
. ' is not marked immutable',
|
. ' is not marked @psalm-immutable',
|
||||||
$code_location
|
$code_location
|
||||||
),
|
),
|
||||||
$suppressed_issues
|
$suppressed_issues
|
||||||
|
Loading…
Reference in New Issue
Block a user