wpengine / phpcompat

WordPress Plugin: PHP Compatibility Checker

Home Page:https://wordpress.org/plugins/php-compatibility-checker/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

False positive on unused vendor file

moorscode opened this issue · comments

commented

Hi!

We received an issue from a user who ran the plugin over the latest released version of Yoast SEO (9.2.1).

In this version we have included some additional packages which run when the plugin is not installed with composer (most cases of course).
In one of these packages there is a file that uses the deprecated sqlite extension, this is only used conditionally, and we do not intent to use that condition.

How can we resolve this problem?
Is there a way to add an exclusion for this specific case?

Related issue: Yoast/wordpress-seo#11798

@moorscode Not sure, but would be worth checking if the phpcompat plugin will respect // phpcs:ignore PHPCompatibility.Cat.Sniff annotations and if so, it might be worth it to see if such an annotation can be added to that package.

I think that we could use filter phpcompat_whitelist. It's probably the fastest way and maybe I could create PR for Yoast SEO.
Other way is adding // @codingStandardsIgnoreLine (I think that php-compatibility-checker uses older code sniffer) in Ruckusing.

commented

@stodorovic that would be great.

I rather not do any changes in the package itself if it can be avoided, so adding the filter sounds like the desired approach.