Skip to content

[Feature Request]: Update dependencies to be compatible with PHP 8 #64

@antonioeatgoat

Description

@antonioeatgoat

Is your feature request related to a problem?

Right now the packages requires "wp-coding-standards/wpcs": "^2.3" and "automattic/vipwpcs": "^2.2", which are not compatible with PHP 8.

Version 3 of WordPress Coding Standard has been released and a new version of Vip Coding Standards is under development in this branch.

Keeping from the the release description of WordPress-Coding-Standards version 3, these are the PHP features for which support has been added or improved:

  • PHP 7.2
    • Keyed lists.
  • PHP 7.3
    • Flexible heredoc/nowdoc (providing the PHPCS scan is run on PHP 7.3 or higher).
    • Trailing commas in function calls.
  • PHP 7.4
    • Arrow functions.
    • Array unpacking in array expressions.
    • Numeric literals with underscores.
    • Typed properties.
    • Null coalesce equals operator.
  • PHP 8.0
    • Nullsafe object operators.
    • Match expressions.
    • Named arguments in function calls.
    • Attributes.
    • Union types // including supporting the false and null types.
    • Constructor property promotion.
    • $object::class
    • Throw as an expression.
  • PHP 8.1
    • Enumerations.
    • Explicit octal notation.
    • Final class constants
    • First class callables.
    • Intersection types.
  • PHP 8.2
    • Constants in traits.

It could be possible to ensure that their rules are in line with

Describe the desired solution

Since branch 3.0/updates-for-wpcs-3.0 looks quite stable and almost finished, it could be possible to use it until it is merged, it already requires "wp-coding-standards/wpcs": "^3.0" so we can just remove it from our dependencies.

Once the dependencies are updated, it is needed to replaces some Sniffs names as described in their documentation here.

Describe the alternatives that you have considered

An alternative of using 3.0/updates-for-wpcs-3.0 could be wait that it is merged and tagged in a stable version (and maybe work on some of the opened issues) but for now there is no ETA provided for it.

Additional context

No response

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions