ostrolucky/rector-rules

Provides rector php rules for making the code more concise

dev-main 2024-11-01 15:30 UTC

README

Provides rector php rules for making the code more concise

Usage

Rules

This project provides the following rules for rector/rector:

RemoveUnnecessaryEmptyRector

function run(array $foos, array $bars): bool
{
-    if (!empty($foos)) {
+    if ($foos) {
      return $foos;
    }

-    return !empty($bars);
+    return (bool) $bars;
}

Installation

Install this package as a dependency using Composer.

composer require --dev ostrolucky/rector-rules

Contributing

Contributions are welcome! To contribute, please familiarize yourself with CONTRIBUTING.md.