Skip to content

Trailing comma => PHP Parse error on PHP 7.2 #265

Description

@leoloso

Describe the bug

When using PHP 7.2 and checking a plugin, an error happens:

PHP Parse error:  syntax error, unexpected ')' in /app/wordpress/wp-content/plugins/plugin-check/checks/plugin-updaters.php on line 12

The code is this one, with a trailing comma:

return new Error(
  'plugin_updater_detected',
  'Plugin Updater detected. Use of the Update URI header is not helpful in plugins hosted on WordPress.org.',
);

And trailing commas are supported from PHP 7.3

Steps to Reproduce

  1. Use PHP 7.2
  2. Check a plugin
  3. Error

Screenshots, screen recording, code snippet

No response

Environment information

  • PHP version: 7.2

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature is broken

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions