Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Sep 21, 2025

This sniff checks the whitespace around the ellipsis in a first class callable and can be used to address the following rule from PER-CS:

4.8 Function Callable References
A function or method may be referenced in a way that creates a closure out of it, by providing ... in place of arguments.

If so, the ... MUST NOT include any whitespace before or after. That is, the correct format is foo(...).

Ref: https://www.php-fig.org/per/coding-style/#48-function-callable-references

The desired "spacing" before/after the ellipsis is configurable and defaults to "no space".

Includes fixer.
Includes unit tests.
Includes documentation.

This sniff checks the whitespace around the ellipsis in a first class callable and can be used to address the following rule from PER-CS:

> **4.8 Function Callable References**
> A function or method may be referenced in a way that creates a closure out of it, by providing `...` in place of arguments.
>
> If so, the `...` MUST NOT include any whitespace before or after. That is, the correct format is `foo(...)`.

Ref: https://www.php-fig.org/per/coding-style/#48-function-callable-references

The desired "spacing" before/after the ellipsis is configurable and defaults to "no space".

Includes fixer.
Includes unit tests.
Includes documentation.
@jrfnl jrfnl force-pushed the feature/new-universal-firstclasscallablespacing-sniff branch from fed7ec9 to ecbd719 Compare September 21, 2025 00:40
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.

1 participant