mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 12:55:26 +01:00
19 lines
255 B
Markdown
19 lines
255 B
Markdown
|
# ImpureVariable
|
||
|
|
||
|
Emitted when referencing an impure or possibly-impure variable from a pure context.
|
||
|
|
||
|
```php
|
||
|
<?php
|
||
|
|
||
|
class A {
|
||
|
public int $a = 5;
|
||
|
|
||
|
/**
|
||
|
* @psalm-pure
|
||
|
*/
|
||
|
public function foo() : self {
|
||
|
return $this;
|
||
|
}
|
||
|
}
|
||
|
```
|