Open ShockedPlot7560 opened 11 months ago
A better option is likely to just turn Facing into an enum. The PHPStan annotations of that sort have caused a great deal of headaches in the past due to easily lost type information when doing almost anything with the values.
It may be useful to specify the expected return type of Facing functions with:
value-of<Facing::ALL>
.This can break many static analyses, because depending on the PHPstan levels, it will carry over if you pass a simple integer into a function accepting just a few values.
I think this option is worth considering, as it could prevent certain runtime errors in the event of an unaccepted value being supplied?