Skip to content

Commit

Permalink
Clean up unnecessary annotation
Browse files Browse the repository at this point in the history
Ref #2111
  • Loading branch information
muglug committed Sep 9, 2019
1 parent b49444b commit a1ea5c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Expand Up @@ -627,8 +627,8 @@ public static function analyze(
$method_pure_compatible = !empty($assign_var->var->inferredType->external_mutation_free) $method_pure_compatible = !empty($assign_var->var->inferredType->external_mutation_free)
|| isset($assign_var->var->pure); || isset($assign_var->var->pure);


if (($context->mutation_free if (($context->mutation_free || $context->external_mutation_free)
|| ($context->external_mutation_free && !$method_pure_compatible)) && !$method_pure_compatible
&& !$context->collect_mutations && !$context->collect_mutations
&& !$context->collect_initializations && !$context->collect_initializations
) { ) {
Expand Down
9 changes: 0 additions & 9 deletions tests/ImmutableAnnotationTest.php
Expand Up @@ -125,9 +125,6 @@ public function __construct(string $bar) {
$this->bar = $bar; $this->bar = $bar;
} }
/**
* @psalm-external-mutation-free
*/
public function withBar(string $bar): self { public function withBar(string $bar): self {
$new = new Foo("hello"); $new = new Foo("hello");
/** @psalm-suppress InaccessibleProperty */ /** @psalm-suppress InaccessibleProperty */
Expand All @@ -149,9 +146,6 @@ public function __construct(string $bar) {
$this->bar = $bar; $this->bar = $bar;
} }
/**
* @psalm-external-mutation-free
*/
public function withBar(string $bar): self { public function withBar(string $bar): self {
$new = clone $this; $new = clone $this;
/** @psalm-suppress InaccessibleProperty */ /** @psalm-suppress InaccessibleProperty */
Expand Down Expand Up @@ -280,9 +274,6 @@ public function __construct(string $bar) {
$this->bar = $bar; $this->bar = $bar;
} }
/**
* @psalm-external-mutation-free
*/
public function withBar(Bar $b): Bar { public function withBar(Bar $b): Bar {
$new = clone $b; $new = clone $b;
$b->a = $this->bar; $b->a = $this->bar;
Expand Down

0 comments on commit a1ea5c3

Please sign in to comment.