Skip to content
Permalink
Browse files

Add more test cases for @psalm-external-mutation-free

  • Loading branch information...
muglug committed Sep 9, 2019
1 parent a1ea5c3 commit 3c7fd945037754d4daf81066da405e8d53f40440
Showing with 10 additions and 0 deletions.
  1. +10 −0 tests/PureAnnotationTest.php
@@ -90,12 +90,22 @@ public function __construct(int $count) {
public function increment() : void {
$this->count++;
}
public function incrementByTwo() : void {
$this->count = $this->count + 2;
}
public function incrementByFive() : void {
$this->count += 5;
}
}
/** @psalm-pure */
function makesACounter(int $i) : Counter {
$c = new Counter($i);
$c->increment();
$c->incrementByTwo();
$c->incrementByFive();
return $c;
}',
],

0 comments on commit 3c7fd94

Please sign in to comment.
You can’t perform that action at this time.