Skip to content

Squiz/MultiLineFunctionDeclaration: use placeholders in error messages - #1453

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

jrfnl merged 1 commit into
PHPCSStandards:4.xfrom
ntdiary:issue-1240-squiz-multi-line-function-declaration

Conversation

@ntdiary

@ntdiary ntdiary commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

Replace string concatenation with placeholders to follow the best practice.

Suggested changelog entry

Changed:

  • Squiz.Functions.MultiLineFunctionDeclarationSniff: improvements to error messages
    • FirstParamSpacing and UseFirstParamSpacing error messages now expose 1 data value (previously 0).
    • OneParamPerLine and UseOneParamPerLine error messages now expose 1 data value (previously 0).

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/MultiLineFunctionDeclarationUnitTest.inc

Replace string concatenation with placeholders to follow the best practice.
- `FirstParamSpacing` and `UseFirstParamSpacing` error messages now expose
  1 data value (previously 0).
- `OneParamPerLine` and `UseOneParamPerLine` error messages now expose
  1 data value (previously 0).
@ntdiary
ntdiary marked this pull request as ready for review July 5, 2026 03:47
@jrfnl jrfnl added this to the 4.0.2 milestone Aug 2, 2026

@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 👍🏻

For the record: these changes also affect overruled error messages for the PSR12.Classes.AnonClassDeclaration sniff and this should be mentioned in the changelog.

@jrfnl
jrfnl merged commit c0f9383 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