PHPackages                             rector/rector-symfony - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. rector/rector-symfony

ActiveRector-extension[Parsing &amp; Serialization](/categories/parsing)

rector/rector-symfony
=====================

Rector upgrades rules for Symfony Framework

1.1.0(2y ago)2401.9M↑68.9%113[2 PRs](https://github.com/rectorphp/rector-symfony/pulls)1MITPHPPHP &gt;=8.2CI passing

Since Mar 21Pushed 1w ago10 watchersCompare

[ Source](https://github.com/rectorphp/rector-symfony)[ Packagist](https://packagist.org/packages/rector/rector-symfony)[ RSS](/packages/rector-rector-symfony/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (20)Versions (88)Used By (1)

Rector Rules for Symfony
========================

[](#rector-rules-for-symfony)

See available [Symfony rules](https://getrector.com/find-rule?activeRectorSetGroup=symfony)

Install
-------

[](#install)

This package is already part of [rector/rector](http://github.com/rectorphp/rector) package, so it works out of the box.

All you need to do is install the main package, and you're good to go:

```
composer require rector/rector --dev
```

Use Sets
--------

[](#use-sets)

To add a set to your config, use `->withPreparedSets` method, and pick one :

```
use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withPreparedSets(symfonyCodeQuality: true)
    ->withComposerBased(symfony: true);
```

If you're on PHP 7.x, you can use withSets() instead, for `symfonyCodeQuality` set, so you can define:

```
use Rector\Config\RectorConfig;
use Rector\Symfony\Set\SymfonySetList;

return RectorConfig::configure()
    ->withSets([
        SymfonySetList::SYMFONY_CODE_QUALITY,
    ]);
```

See [documentation](https://getrector.com/documentation/config-configuration#content-symfony-integration) for more.

Configuration
-------------

[](#configuration)

### Provide Symfony XML Service List

[](#provide-symfony-xml-service-list)

Some rules like `StringFormTypeToClassRector` need access to your Symfony container dumped XML. It contains list of form types with their string names, so it can convert them to class references.

How to add it? Check your `var/cache/` directory and find the XML file for your test env. Then add it in `rector.php`:

```
use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withSymfonyContainerXml(__DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml');
```

That's it! Now you can run the `StringFormTypeToClassRector` and get your form classes converted safely.

Learn Rector Faster
-------------------

[](#learn-rector-faster)

Rector is a tool that [we develop](https://getrector.org/) and share for free, so anyone can save hundreds of hours on refactoring. But not everyone has time to understand Rector and AST complexity. You have 2 ways to speed this process up:

- read a book - [The Power of Automated Refactoring](https://leanpub.com/rector-the-power-of-automated-refactoring)
- hire our experienced team to [improve your code base](https://getrector.org/contact)

Both ways support us to and improve Rector in sustainable way by learning from practical projects.

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance64

Regular maintenance activity

Popularity60

Solid adoption and visibility

Community39

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 68.7% 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 ~91 days

Total

70

Last Release

786d ago

Major Versions

0.19.0 → 1.0.02024-02-09

PHP version history (4 changes)0.10.0PHP &gt;=7.3

0.11.2PHP &gt;=8.0

0.11.45PHP &gt;=8.1

0.16.2PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/924196?v=4)[Tomas Votruba](/maintainers/TomasVotruba)[@TomasVotruba](https://github.com/TomasVotruba)

---

Top Contributors

[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (731 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (190 commits)")[![JohJohan](https://avatars.githubusercontent.com/u/7591464?v=4)](https://github.com/JohJohan "JohJohan (36 commits)")[![stefantalen](https://avatars.githubusercontent.com/u/2243967?v=4)](https://github.com/stefantalen "stefantalen (22 commits)")[![MrYamous](https://avatars.githubusercontent.com/u/32437818?v=4)](https://github.com/MrYamous "MrYamous (11 commits)")[![malteschlueter](https://avatars.githubusercontent.com/u/13586874?v=4)](https://github.com/malteschlueter "malteschlueter (6 commits)")[![mttsch](https://avatars.githubusercontent.com/u/98848360?v=4)](https://github.com/mttsch "mttsch (6 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (6 commits)")[![gharlan](https://avatars.githubusercontent.com/u/330436?v=4)](https://github.com/gharlan "gharlan (5 commits)")[![carlos-granados](https://avatars.githubusercontent.com/u/1383106?v=4)](https://github.com/carlos-granados "carlos-granados (4 commits)")[![keulinho](https://avatars.githubusercontent.com/u/15930605?v=4)](https://github.com/keulinho "keulinho (4 commits)")[![bobvandevijver](https://avatars.githubusercontent.com/u/1835343?v=4)](https://github.com/bobvandevijver "bobvandevijver (3 commits)")[![mickverm](https://avatars.githubusercontent.com/u/1834265?v=4)](https://github.com/mickverm "mickverm (3 commits)")[![dsdeboer](https://avatars.githubusercontent.com/u/17773117?v=4)](https://github.com/dsdeboer "dsdeboer (3 commits)")[![alexander-schranz](https://avatars.githubusercontent.com/u/1698337?v=4)](https://github.com/alexander-schranz "alexander-schranz (2 commits)")[![guillaumesmo](https://avatars.githubusercontent.com/u/1309544?v=4)](https://github.com/guillaumesmo "guillaumesmo (2 commits)")[![Haehnchen](https://avatars.githubusercontent.com/u/1011712?v=4)](https://github.com/Haehnchen "Haehnchen (2 commits)")[![julienfastre](https://avatars.githubusercontent.com/u/345600?v=4)](https://github.com/julienfastre "julienfastre (2 commits)")[![Khartir](https://avatars.githubusercontent.com/u/5592420?v=4)](https://github.com/Khartir "Khartir (2 commits)")[![MikeAmelung](https://avatars.githubusercontent.com/u/371316?v=4)](https://github.com/MikeAmelung "MikeAmelung (2 commits)")

---

Tags

astinstant-upgradesphprectorsymfony

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[mwgg/airports

A JSON collection of ~29k entries with basic information about nearly every airport and landing strip in the world

7683.4k](/packages/mwgg-airports)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9845.4k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

46164.0k6](/packages/jstewmc-rtf)[glauberportella/cnab-layouts-parser

Parser de arquivos de configuração CNAB gerados no projeto https://github.com/glauberportella/cnab-layouts

2154.5k](/packages/glauberportella-cnab-layouts-parser)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.4k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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