PHPackages                             epifrin/rector-custom-rules - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. epifrin/rector-custom-rules

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

epifrin/rector-custom-rules
===========================

These are three rector rules to convert private method name, to convert local variable name to camel case and to replace double quotes with single quotes in string literals.

0.5.1(2y ago)131.5k↓11.9%MITPHPPHP ^8.0

Since Aug 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/epifrin/rector-custom-rules)[ Packagist](https://packagist.org/packages/epifrin/rector-custom-rules)[ RSS](/packages/epifrin-rector-custom-rules/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (13)Used By (0)

Rector Custom Rules
===================

[](#rector-custom-rules)

These are three rector rules to convert private method name, to convert local variable name to camel case and to replace double quotes with single quotes in string literals.

[![Build status](https://github.com/epifrin/rector-custom-rules/actions/workflows/build.yml/badge.svg)](https://github.com/epifrin/rector-custom-rules/actions/workflows/build.yml)[![Latest Stable Version](https://camo.githubusercontent.com/17706526dbf50934cc2023d76ff6c4ca303d6d2c2896dc9df1cdd2508b24dfdf/687474703a2f2f706f7365722e707567782e6f72672f6570696672696e2f726563746f722d637573746f6d2d72756c65732f76)](https://packagist.org/packages/epifrin/rector-custom-rules)[![PHP Version Require](https://camo.githubusercontent.com/aa77d2935c27c1ed144c072949a6f68c959d4e73a5b63ef9b68aa374403b9bc6/687474703a2f2f706f7365722e707567782e6f72672f6570696672696e2f726563746f722d637573746f6d2d72756c65732f726571756972652f706870)](https://packagist.org/packages/epifrin/rector-custom-rules)[![Total Downloads](https://camo.githubusercontent.com/cb0a90f57b80b250a7cd7962a93ddc44d93e0bd7c53044c3dc776215712fc40f/687474703a2f2f706f7365722e707567782e6f72672f6570696672696e2f726563746f722d637573746f6d2d72756c65732f646f776e6c6f616473)](https://packagist.org/packages/epifrin/rector-custom-rules)[![License](https://camo.githubusercontent.com/a0bf98ffecad1a58fd7929c79cdd2f09eb1417dda776a910cc77e2f2a19068ef/687474703a2f2f706f7365722e707567782e6f72672f6570696672696e2f726563746f722d637573746f6d2d72756c65732f6c6963656e7365)](https://packagist.org/packages/epifrin/rector-custom-rules)

Installation
------------

[](#installation)

```
composer require --dev epifrin/rector-custom-rules
```

Usage
-----

[](#usage)

Add the following to your rector config:

```
$rectorConfig->rule(\Epifrin\RectorCustomRules\RectorRules\ConvertPrivateMethodsNameToCamelCaseRector::class);
$rectorConfig->rule(\Epifrin\RectorCustomRules\RectorRules\ConvertLocalVariablesNameToCamelCaseRector::class);
$rectorConfig->rule(\Epifrin\RectorCustomRules\RectorRules\ReplaceDoubleQuotesWithSingleRector::class);
```

Rector rules
------------

[](#rector-rules)

### Convert local variable names to camel case

[](#convert-local-variable-names-to-camel-case)

```
class SomeClass
{
    public function aMethod()
    {
-        $my_variable = 1;
+        $myVariable = 1;

-        return $my_variable;
+        return $myVariable;
    }
}
```

### Convert private method names to camel case

[](#convert-private-method-names-to-camel-case)

Why only private methods? Because it's safer to change private method names than public or protected method names.

```
class SomeClass
{
    public function publicMethod()
    {
-        $this->my_private_method();
+        $this->myPrivateMethod();

-        self::my_static_private_method();
+        self::myStaticPrivateMethod();
    }

-    private function my_private_method() {}
+    private function myPrivateMethod() {}

-    private static function my_static_private_method() {}
+    private static function myStaticPrivateMethod() {}
}
```

### Replace double quotes with single

[](#replace-double-quotes-with-single)

This rule replaces double quotes with single quotes in string literals. It does not replace double quotes if the string literal contains variables or substitutions.

Here is an example of how this rule works:

```
class SomeClass
{
    public function someMethod()
    {
-        $string = "This is a simple string";
+        $string = 'This is a simple string';

-        $stringWithVariable = "Hello, $name";
+        $stringWithVariable = "Hello, $name";

-        $stringWithSpecialChar = "String with special char: \n";
+        $stringWithSpecialChar = "String with special char: \n";
    }
}
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~11 days

Total

12

Last Release

830d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e3ef27ec1ecdfa0c277b5abb6d995fdaf55dd577b4708e306fe591e6a4deea66?d=identicon)[epifrin](/maintainers/epifrin)

---

Top Contributors

[![epifrin](https://avatars.githubusercontent.com/u/1763649?v=4)](https://github.com/epifrin "epifrin (18 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/epifrin-rector-custom-rules/health.svg)

```
[![Health](https://phpackages.com/badges/epifrin-rector-custom-rules/health.svg)](https://phpackages.com/packages/epifrin-rector-custom-rules)
```

###  Alternatives

[khill/fontawesomephp

PHP wrapper library for the fantastic Font Awesome icon set.

4676.3k4](/packages/khill-fontawesomephp)[wireui/breadcrumbs

Breadcrumbs component for Laravel, Livewire, TallStack

3817.0k](/packages/wireui-breadcrumbs)[smithfield-studio/acf-svg-icon-picker

Add ACF field for selecting SVG icons.

3710.8k](/packages/smithfield-studio-acf-svg-icon-picker)[geowrgetudor/laravel-balance

A credit system / balance for Laravel.

217.8k](/packages/geowrgetudor-laravel-balance)[imarc/opus

Multi-framework asset and module packaging for composer

1112.1k3](/packages/imarc-opus)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
