1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Add documentation for automatically removing UnusedVariable

This commit is contained in:
Matthew Brown 2019-08-09 11:40:46 -04:00 committed by GitHub
parent 5b2f54bbcb
commit 85c9b6bb44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -426,3 +426,28 @@ class A {
new A();
```
### UnusedVariable
This removes unused variables.
Running `vendor/bin/psalter --issues=UnusedVariable` on
```php
function foo() : void {
$a = 5;
$b = 6;
$c = $d = $a + $b;
echo "foo";
}
```
gives
```php
function foo() : void {
$a = 5;
$b = 6;
echo "foo";
}
```