-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Bug Description
WordPressVIPMinimum.Functions.RestrictedFunctions sniff catches instantiation of classes that have the same name as the restricted functions.
Minimal Code Snippet
$foo = new Link();This is reported (by the vip-go-ci bot) as:
Warning: File system operations only work on the /tmp/ and wp-content/uploads/ directories. To avoid unexpected results, please use helper functions like get_temp_dir() or wp_get_upload_dir() to get the proper directory path when using functions such as link(). For more details, please see: wpvip.com/documentation/vip-go/writing-files-on-vip-go
(WordPressVIPMinimum.Functions.RestrictedFunctions.file_ops_link).
...despite this not being a function call. I suspect that if classes matched other restricted function names, they too would get this false positive.
Environment
Use php -v and composer show to get versions.
| Question | Answer |
|---|---|
| PHP version | 7 |
| PHP_CodeSniffer version | 3.5 |
| VIPCS version | 2.0.0 |
Tested Against master branch?
- I have verified the issue still exists in the
masterbranch of VIPCS. - I have verified the issue still exists in the
developbranch of VIPCS.