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:
parent
5b2f54bbcb
commit
85c9b6bb44
@ -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";
|
||||
}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user