1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00

Add documentation for new issue

This commit is contained in:
Brown 2020-01-23 14:33:07 -05:00
parent da43b8188f
commit 0f659d996d
2 changed files with 15 additions and 0 deletions

View File

@ -179,6 +179,7 @@
<xs:element name="ImplementedParamTypeMismatch" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ImplementedReturnTypeMismatch" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ImplicitToStringCast" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ImpureByReferenceAssignment" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ImpureFunctionCall" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ImpureMethodCall" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ImpurePropertyAssignment" type="IssueHandlerType" minOccurs="0" />

View File

@ -332,6 +332,20 @@ function takesString(string $s) : void {}
takesString(new A);
```
### ImpureByReferenceAssignment
Emitted when assigning a passed-by-reference variable inside a function or method marked as mutation-free.
```php
/**
* @psalm-pure
*/
function foo(string &$a): string {
$a = "B";
return $a;
}
```
### ImpureFunctionCall
Emitted when calling an impure function from a function or method marked as pure.