Skip to content

CMB2 isn't fully PHP 7.0 compliant #719

@ryanshoover

Description

@ryanshoover

Expected Behavior:

  1. Run PHP_CodeSniffer with PHPCompatibility set to 7.0
    phpcs --standard=PHPCompatibility --runtime-set testVersion 7.0
    Or, run a report using the plugin php-compatibility-checker
  • Get a clean report with no notices, warnings, or errors

Actual Behavior:

  1. Run PHP_CodeSniffer with PHPCompatibility set to 7.0
    Or, run a report using the plugin php-compatibility-checker
  • Get the following output

Name: CMB2

FILE: ... /wp-content/plugins/cmb2/css/index.php
------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------
 1 | WARNING | No PHP code was found in this file and short open tags are not allowed by this install of PHP. This file may be using short open tags but PHP does not allow them.
------------------------------------


FILE: .../wp-content/plugins/cmb2/images/index.php
------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------
 1 | WARNING | No PHP code was found in this file and short open tags are not allowed by this install of PHP. This file may be using short open tags but PHP does not allow them.
------------------------------------


FILE: .../wp-content/plugins/cmb2/includes/CMB2_Field.php
----------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------
 1054 | ERROR | Function name, class name, namespace name or constant name can not be reserved keyword 'string' (since version 7.0)
----------------------------------------------------------


FILE: .../wp-content/plugins/cmb2/includes/CMB2_Types.php
-------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------
 133 | ERROR | 'string' is a reserved keyword introduced in PHP version 7.0 and cannot be invoked as a function (T_STRING)
-------------------------------------------------


FILE: .../wp-content/plugins/cmb2/includes/index.php
------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------
 1 | WARNING | No PHP code was found in this file and short open tags are not allowed by this install of PHP. This file may be using short open tags but PHP does not allow them.
------------------------------------


FILE: .../wp-content/plugins/cmb2/index.php
------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------
 1 | WARNING | No PHP code was found in this file and short open tags are not allowed by this install of PHP. This file may be using short open tags but PHP does not allow them.
------------------------------------


FILE .../wp-content/plugins/cmb2/js/index.php
------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------
 1 | WARNING | No PHP code was found in this file and short open tags are not allowed by this install of PHP. This file may be using short open tags but PHP does not allow them.
------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions