1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-11 16:59:45 +01:00
psalm/docs/running_psalm/issues/ImpurePropertyAssignment.md
2020-03-20 19:13:56 -04:00

23 lines
323 B
Markdown

# ImpurePropertyAssignment
Emitted when updating a property value from a function or method marked as pure.
```php
<?php
class A {
public int $a = 5;
}
/** @psalm-pure */
function filterOdd(int $i, A $a) : ?int {
$a->a++;
if ($i % 2 === 0 || $a->a === 2) {
return $i;
}
return null;
}
```