• redsand

    (@redsand)


    Ran some tests on a few more fairly common plugins, and found that the CloudFlare plugin is getting a false positive.

    Here’s the clip from the report:

    
    FILE: /XXXXXX/wp-content/plugins/cloudflare/vendor/guzzle/guzzle/src/Guzzle/Service/Resource/AbstractResourceIteratorFactory.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)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: /XXXXXX/wp-content/plugins/cloudflare/vendor/guzzle/guzzle/src/Guzzle/Service/Resource/Model.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)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: /XXXXXX/wp-content/plugins/cloudflare/vendor/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorClassFactory.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)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: /XXXXXX/wp-content/plugins/cloudflare/vendor/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorApplyBatched.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)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: /XXXXXX/wp-content/plugins/cloudflare/vendor/guzzle/guzzle/src/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)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: /XXXXXX/wp-content/plugins/cloudflare/vendor/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorInterface.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)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: /XXXXXX/wp-content/plugins/cloudflare/vendor/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorFactoryInterface.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)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: /XXXXXX/wp-content/plugins/cloudflare/vendor/guzzle/guzzle/src/Guzzle/Service/Resource/MapResourceIteratorFactory.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)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: /XXXXXX/wp-content/plugins/cloudflare/vendor/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIterator.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)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    

    Please fix. Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is not a false positive. resource is a reserved keyword and should not be used as part of a namespace.

    The Cloudflare plugin uses a very outdated version of Guzzle (v3.9.3) which is not compatible with PHP 7.

    Plugin Contributor Jason

    (@jcross)

    The plugin relies completely on the PHPCompatibility project (https://github.com/wimg/PHPCompatibility) for error reporting. Any false positives and so forth should be posted as an issue there.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘FALSE POSITIVE: Showing CloudFlare as not PHP 7 Compatible’ is closed to new replies.