We'd like to suppress the INFO-level issue PropertyNotSetInConstructor in a specific PHP class, but for some reason, @psalm-suppress PropertyNotSetInConstructor does not seem to do the job. We tried to apply the annotation on the constructor, the class, and the property level, without success.
The problem is that we're writing a class where the concrete type of a property is not known yet, it is defined at runtime (we only know the interface). Therefore, we can't initialize the property in the constructor.
Try to suppress it in psalm.xml - something like
<issueHandlers>
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<file name="path/to/your/file.php" />
</errorLevel>
</PropertyNotSetInConstructor>
</issueHandlers>
But it should also be suppressable at the class level, I'll fix that
Any progress on this @muglug?
Just fixed in dev-master
Awesome, thank you! I'll test it and report back as soon as it is released.
@muglug, would it be possible to suppress this on the property level as well? In our case, we would like to suppress the warning on properties which we do not yet the concrete type of, the other properties in the class shall raise the warning.
@muglug, do you plan to make this suppressable on the property level as well?