rectorphp / type-perfect

Next level type declaration check PHPStan rules
https://getrector.com/blog/introducing-type-perfect-for-extra-safety
MIT License
74 stars 4 forks source link

Enum cases reported #8

Closed janedbal closed 3 months ago

janedbal commented 3 months ago

When only single enum case is passed, it gets reported. That is obviously not possible to typehint:

Parameter 4 should use "ShipMonk\Warehouse\PickToLight\Enum\SkipPickReason::BarcodeIssue" type as the only type passed to this method 
samsonasik commented 3 months ago

@janedbal could you give more precise code when it shown the error? thank you.

janedbal commented 3 months ago

Method

    public function skipPick(
        SkipPickReason $skipPickReason,
    ): void

called only with SkipPickReason::BarcodeIssue of

enum SkipPickReason: string
{

    case BarcodeIssue = 'barcode_issue';
    case EmptyLocation = 'empty_location';

}
samsonasik commented 3 months ago

@janedbal I can't reproduce issue by this PR test

samsonasik commented 3 months ago

Closing as can't be reproduced, @janedbal feel free to create valid failing test case PR when you have time. thank you.

samsonasik commented 3 months ago

Re-open as reproduced at https://github.com/rectorphp/type-perfect/pull/19