Automattic / vip-go-compatibility-scanner

Scan for compatibility problems in repository code using PHPCS with any standard, report as GitHub issues.
5 stars 1 forks source link

Using @codingStandardsIgnoreFile in files causes warnings #16

Closed gudmdharalds closed 3 years ago

gudmdharalds commented 3 years ago

When @codingStandardsIgnoreFile are used in files warnings are printed:

Notice: Undefined index: /tmp/file.php in vip-go-compatibility-scanner/scan-files.php on line 183
Notice: Trying to access array offset on value of type null in vip-go-compatibility-scanner/scan-files.php on line 184
Warning: array_map(): Expected parameter 2 to be an array, null given in vip-go-compatibility-scanner/scan-files.php on line 184
Warning: array_merge(): Expected parameter 2 to be an array, null given in vip-go-compatibility-scanner/scan-files.php on line 216

Those warnings can be avoided by doing checks when the @codingStandardsIgnoreFile string is found in the file scanned.