wpengine / phpcompat

WordPress Plugin: PHP Compatibility Checker
https://wordpress.org/plugins/php-compatibility-checker/
121 stars 38 forks source link

False Positive: Amazon Web Services plugin from Delicious Brains #122

Open tonydjukic opened 7 years ago

tonydjukic commented 7 years ago

Compatibility check throws multiple errors regarding the use of 'resource' in the AWS plugin's code and resource being a reserved keyword in PHP 7.

After reviewing the code for the AWS plugin it appears that 'resource' is only ever used in file paths to vendor assets and not for any executable code.

I suspect this is a false positive.

jrfnl commented 7 years ago

Could you show some example code ?

If you mean that resource is used as part of a namespace, see: http://php.net/manual/en/reserved.other-reserved-words.php

tonydjukic commented 7 years ago
FILE: /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/amazon-web-services/vendor/aws/Guzzle/Service/Resource/CompositeResourceIteratorFactory.php
FOUND 1 ERROR AFFECTING 1 LINE
 3 | ERROR | 'resource' is a reserved keyword as of PHP version 7.0 and cannot be used to name a class, interface or trait or as part of a namespace (T_NAMESPACE)

However, upon further examination, it appears that the plugin simply has a library of vendor assets and some of them are in directories with the name 'Resource' in the URL path.