PHPackages                             becklyn/rector - 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. becklyn/rector

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

becklyn/rector
==============

A collection of various refactoring rules for projects that use Rector and mainly Symfony

1.0.1(4y ago)05.7k↓63.7%MITPHPPHP &gt;=7.4

Since May 10Pushed 4y ago2 watchersCompare

[ Source](https://github.com/Becklyn/rector)[ Packagist](https://packagist.org/packages/becklyn/rector)[ RSS](/packages/becklyn-rector/feed)WikiDiscussions 1.x Synced 2d ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Becklyn Rector
==============

[](#becklyn-rector)

This package contains a list of [Rector](https://github.com/rectorphp/rector) rules that help you up-grading your Symfony-based code base and keeping it deprecation-free.

Installation
============

[](#installation)

Easily get this package via Composer: `composer require --dev becklyn/rector`

Usage
=====

[](#usage)

Add the rules that you want

This bundle uses a default AJAX protocol, that is used in the `AjaxResponseBuilder` and can be used for your project. The ajax call will always return an error 200, as it shouldn't flood the error tracking (with error 400 AJAX request).

The protocol looks like this:

```
// rector.php

use Becklyn\Rector\Symfony\ReplaceControllerThisGetWithThisContainerGet;
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
    // …

    $rectorConfig->rule(ReplaceControllerThisGetWithThisContainerGet::class);

    // …
};
```

Available rules
===============

[](#available-rules)

### `Becklyn\\Rector\\Symfony\\ReplaceControllerThisGetWithThisContainerGet`

[](#becklynrectorsymfonyreplacecontrollerthisgetwiththiscontainerget)

Controllers that were trying to access dependencies via `$this->get(…)` will be refactored to use `$this->container->get(…)`.

Before:

```
class ExtendingAbstractController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
{
    public function run()
    {
        $this->get(SomeClass::class);
    }

    public function runFaster()
    {
        $service = $this->get(SomeOtherClass::class);
    }

    public function runEvenFaster()
    {
        return $this->get(BestClass::class);
    }
}
```

After:

```
class ExtendingAbstractController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
{
    public function run()
    {
        $this->container->get(SomeClass::class);
    }

    public function runFaster()
    {
        $service = $this->container->get(SomeOtherClass::class);
    }

    public function runEvenFaster()
    {
        return $this->container->get(BestClass::class);
    }
}
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

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 ~10 days

Total

3

Last Release

1496d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1044355?v=4)[Becklyn Studios](/maintainers/becklyn)[@Becklyn](https://github.com/Becklyn)

---

Top Contributors

[![keichinger](https://avatars.githubusercontent.com/u/439899?v=4)](https://github.com/keichinger "keichinger (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/becklyn-rector/health.svg)

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

###  Alternatives

[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2603.2M436](/packages/ssch-typo3-rector)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[ergebnis/rector-rules

Provides rules for rector/rector.

10245.6k51](/packages/ergebnis-rector-rules)[worksome/coding-style

Worksomes coding style

49814.9k66](/packages/worksome-coding-style)[ticketswap/phpstan-error-formatter

A minimalistic error formatter for PHPStan

87718.9k56](/packages/ticketswap-phpstan-error-formatter)

PHPackages © 2026

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