Skip to content

Review error message creation #1240

@jrfnl

Description

@jrfnl

While working on something else, I noticed a number of error messages in various sniffs using concatenation instead of passing variable parts of the error message to the add[Fixable]Error/Warning() methods via a $data array.

These are likely left-overs from long ago.

I believe it would be prudent to fix these up to follow the best practice of using %s placeholders and a $data array.

I seem to remember that even messages with placeholders can be changed from within a phpcs.xml[.dist] ruleset.
Before executing this action, it should be investigated whether updating the error messages would constitute a breaking change. And if so, it will need to be evaluated if this action needs to wait until the next major release of PHPCS or can be included in an earlier minor/patch version.

Action list

Action list based on what I came across (likely to be reasonably complete, though a critical look at all error messages in the sniffs involved is warranted):

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions