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(3y ago)05.3k↓50%MITPHPPHP &gt;=7.4

Since May 10Pushed 3y ago2 watchersCompare

[ Source](https://github.com/Becklyn/rector)[ Packagist](https://packagist.org/packages/becklyn/rector)[ RSS](/packages/becklyn-rector/feed)WikiDiscussions 1.x Synced 1mo 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 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

1449d 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

[ticketswap/phpstan-error-formatter

A minimalistic error formatter for PHPStan

87578.8k35](/packages/ticketswap-phpstan-error-formatter)[worksome/coding-style

Worksomes coding style

49771.7k57](/packages/worksome-coding-style)[codeigniter4/devkit

Development toolkit for CodeIgniter libraries and projects

68187.1k82](/packages/codeigniter4-devkit)[quartetcom/static-analysis-kit

Strict and modern kit to optimise the codebase defensively.

144.3k5](/packages/quartetcom-static-analysis-kit)

PHPackages © 2026

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