squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.66k stars 1.48k forks source link

Suppress deprecation notices about return types #3851

Closed fredden closed 1 year ago

fredden commented 1 year ago

Description

While working on another pull request in this repository, I noticed that phpstan was complaining about an unrelated problem to the pull request at hand. I've investigated this further and found that #3400 solves the same problem as here for another class. This can be considered a follow-up to that pull request.

Types of changes

PR checklist

jrfnl commented 1 year ago

@fredden I was a bit surprised to see this PR as I use the --filter=GitModified (and GitStaged) options extensively and am running on PHP 8.2.

I just investigated to be sure, but this is a non-issue as the parent class Filter already declares the #[ReturnTypeWillChange] attribute on those methods and the child class ExactMatch inherits these.

See: https://3v4l.org/63Fss

I suggest reporting a bug to PHPStan instead.

fredden commented 1 year ago

I've not seen any deprecation warnings coming from PHP regarding this, only from PHPStan. Reporting this there makes sense. I'll open an issue there and then close this.

fredden commented 1 year ago

I've opened https://github.com/phpstan/phpstan/issues/9615 to replace this.