Seems I was mistaken regarding the change to how the error is reported when providing a type hint for $this
. While error suppression could be used, it would hide genuine issues (e.g. trying to use $this
in an anonymous function, which has bitten me in the past).
If there is a way to suppress on each line, that is an option (though is exceptionally tedious).
Ideally PHP Tools would take the provided type annotation of $this
in file level scope as an indicator that usage is permitted.