Skip to content

Squiz/FunctionDeclarationArgumentSpacing: use placeholders in error messages - #1452

Merged
jrfnl merged 1 commit into
PHPCSStandards:4.xfrom
ntdiary:issue-1240-squiz-function-declaration-argument-spacing
Aug 2, 2026
Merged

Squiz/FunctionDeclarationArgumentSpacing: use placeholders in error messages#1452
jrfnl merged 1 commit into
PHPCSStandards:4.xfrom
ntdiary:issue-1240-squiz-function-declaration-argument-spacing

Conversation

@ntdiary

@ntdiary ntdiary commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Replace string concatenation with placeholders to follow the best practice.

Suggested changelog entry

Changed

  • Squiz.Functions.FunctionDeclarationArgumentSpacingSniff: improvements to error messages
    • SpaceBeforeEquals error message now exposes 3 data values (previously 2).
    • SpaceAfterEquals error message now exposes 3 data values (previously 2).

Related issues/external references

related to #1240

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

PR checklist

  • I have checked there is no other PR open for the same change.
  • I have read the Contribution Guidelines.
  • I grant the project the right to include and distribute the code under the BSD-3-Clause license (and I have the right to grant these rights).
  • I have added tests to cover my changes.
  • I have verified that the code complies with the projects coding standards.
  • [Required for new sniffs] I have added XML documentation for the sniff.
  • I have opened a sister-PR in the documentation repository to update the Wiki.

Changes are already covered by Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.1.inc

…essages

Replace string concatenation with placeholders to follow the best practice.
- `SpaceBeforeEquals` error message now exposes 3 data values (previously 2).
- `SpaceAfterEquals` error message now exposes 3 data values (previously 2).

@jrfnl jrfnl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ntdiary Thanks for this PR! All good 👍🏻

Edit: for the record - I've checked and this sniff is not extended, so these changes do not affect any other sniffs.

@jrfnl jrfnl added this to the 4.0.2 milestone Aug 2, 2026
@jrfnl
jrfnl merged commit 4cb725b into PHPCSStandards:4.x Aug 2, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants