Repository navigation
Warnings on simple static interface #7900
|
I have an interface for a static factory method, and am struggling to see how to stop Psalm showing warnings: https://psalm.dev/r/ed9e2857f7 In this case we have an interface that declares a public static returning Is there a way to make this structure work without Psalm complaining? |
Replies: 1 comment 1 reply
|
This is invalid because you could have |
This is invalid because you could have
Qux extends Bazand it would inherit the method returningself, so it would not returnstaticas required. You can either markBazas final to rule out this possibility, or use@psalm-consistent-constructorand have the method constructstaticinstead ofself.