Skip to content

Conversation

@dereuromark
Copy link
Contributor

Summary

  • Adds support for PHP 8.5 pipe operator (|>)
  • Implements PipeOperatorSpacingSniff to enforce consistent spacing
  • All violations are auto-fixable

Changes

  • Created PhpCollective\Sniffs\WhiteSpace\PipeOperatorSpacingSniff
  • Added comprehensive test coverage
  • Sniff enforces:
    • No space between | and >
    • Exactly one space before the pipe operator
    • Exactly one space after the pipe operator

Example

Before

$result = $input|>trim(...)|>strtolower(...);
$result = $input  |>  trim(...);

After

$result = $input |> trim(...) |> strtolower(...);
$result = $input |> trim(...);

Test Plan

  • Unit tests pass (10 errors detected and fixed)
  • Code style checks pass
  • Full test suite passes (84 tests)
  • Tested against PHP 8.5 pipe operator syntax

🤖 Generated with Claude Code

This adds support for the PHP 8.5 pipe operator (|>) by implementing
a sniff that enforces consistent spacing around it.

The sniff ensures:
- No space between | and >
- Exactly one space before the pipe operator
- Exactly one space after the pipe operator

All violations are auto-fixable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants