1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
Thomas Landauer 2022-11-10 20:19:02 +01:00 committed by GitHub
parent 4d53d26f00
commit c51d3665eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ This fails since it's not guaranteed that subsequent calls to `$cat->getName()`
#### Possible Solutions
* Use a variable:
Use a variable:
```php
<?php
@ -34,7 +34,8 @@ This fails since it's not guaranteed that subsequent calls to `$cat->getName()`
}
unset($catName);
```
* Add [`@psalm-mutation-free`](../../annotating_code/supported_annotations.md#psalm-mutation-free) to the declaration of the function
Or add [`@psalm-mutation-free`](../../annotating_code/supported_annotations.md#psalm-mutation-free) to the declaration of the function
### Calling Another Function After `if`