phpstan-extensions icon indicating copy to clipboard operation
phpstan-extensions copied to clipboard

False-positive 'variable is unused' for variables used in compact

Open b1rdex opened this issue 6 years ago • 1 comments

------ ----------------------------------------------------------------------------------------
  Line   someClassFile.php
 ------ ----------------------------------------------------------------------------------------
  45     [Line  47] Function makeNotificationFromFixture() has an unused variable $createdAt.
private static function makeNotificationFromFixture($fixtureData): array
{
    $createdAt = 'some value';
    // …
    return array_merge(
        ['foo'],
        compact('createdAt')
    );
}

b1rdex avatar Jul 17 '19 02:07 b1rdex

Nice catch, I'll try to handle this

Slamdunk avatar Jul 17 '19 03:07 Slamdunk

@b1rdex if you still around, maybe you can give #56 a try

mfn avatar Feb 27 '24 20:02 mfn