ioigoume/rector-rules

Custom Rector rules (e.g., replace trailing \n with PHP_EOL).

v0.1 2025-09-25 08:53 UTC

This package is auto-updated.

Last update: 2025-09-25 09:02:25 UTC


README

Custom Rector rules by codii.

Installation

Add this repository as a package (VCS or path repository in your main composer.json) and require it, or include it directly if you're working in a monorepo.

Rules

ReplaceTrailingNewlineWithPhpEolRector

Replaces trailing \n in string literals with PHP_EOL.

Examples:

  • "Hello\n" becomes "Hello" . PHP_EOL
  • 'World\n' becomes 'World' . PHP_EOL
  • "\n" or '\n' becomes PHP_EOL

Usage

Register the rule in your project's rector.php: