diff --git a/config.xsd b/config.xsd index c98038527..8645b237e 100644 --- a/config.xsd +++ b/config.xsd @@ -174,9 +174,9 @@ - + @@ -186,16 +186,15 @@ - - + + - + - @@ -204,8 +203,9 @@ - + + @@ -220,11 +220,10 @@ - - + @@ -232,6 +231,7 @@ + @@ -253,22 +253,23 @@ - + + - + @@ -281,17 +282,17 @@ + + - - - - + + @@ -304,8 +305,8 @@ - + @@ -338,10 +339,10 @@ - - - + + + @@ -356,11 +357,11 @@ - - + + @@ -369,6 +370,7 @@ + @@ -381,26 +383,25 @@ - + + - - + + - - - + diff --git a/docs/running_psalm/issues/ImpurePropertyAssignment.md b/docs/running_psalm/issues/ImpurePropertyAssignment.md index 2b4396848..f36a27bd5 100644 --- a/docs/running_psalm/issues/ImpurePropertyAssignment.md +++ b/docs/running_psalm/issues/ImpurePropertyAssignment.md @@ -10,13 +10,9 @@ class A { } /** @psalm-pure */ -function filterOdd(int $i, A $a) : ?int { - $a->a++; +function foo(int $i, A $a) : int { + $a->a = $i; - if ($i % 2 === 0 || $a->a === 2) { - return $i; - } - - return null; + return $i; } ``` diff --git a/docs/running_psalm/issues/ImpurePropertyFetch.md b/docs/running_psalm/issues/ImpurePropertyFetch.md new file mode 100644 index 000000000..7aca5b595 --- /dev/null +++ b/docs/running_psalm/issues/ImpurePropertyFetch.md @@ -0,0 +1,16 @@ +# ImpurePropertyFetch + +Emitted when fetching a property value inside a function or method marked as pure. + +```php +a; +} +```