Skip to content

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

@leoloso

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

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