mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix docs example for impurity
This commit is contained in:
parent
955899ade0
commit
04c12a36fe
@ -337,9 +337,20 @@ takesString(new A);
|
||||
Emitted when calling an impure function from a function or method marked as pure.
|
||||
|
||||
```php
|
||||
function impure(array $a) : array {
|
||||
/** @var int */
|
||||
static $i = 0;
|
||||
|
||||
++$i;
|
||||
|
||||
$a[$i] = 1;
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
/** @psalm-pure */
|
||||
function filterOdd(array $a) : void {
|
||||
extract($a);
|
||||
impure($a);
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user