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

ActiveRector-extension

contao/contao-rector
====================

Rector upgrades rules for Contao CMS

415.9k↑288.5%6[4 PRs](https://github.com/contao/contao-rector/pulls)20PHP

Since Mar 24Pushed 5mo ago6 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (20)

Rector Rules for Contao Open Source CMS
=======================================

[](#rector-rules-for-contao-open-source-cms)

This project contains [Rector rules](https://github.com/rectorphp/rector)for [Contao Open Source CMS](https://contao/contao) upgrades.

**!! WARNING !! this is currently experimental, use at your own risk**

Install
-------

[](#install)

Install contao-rector via composer to your project:

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

Available sets
--------------

[](#available-sets)

SetsDescription`ContaoSetList::CONTAO_49`updates your code to compatibility with Contao 4.9`ContaoSetList::CONTAO_413`updates your code to compatibility with Contao 4.13`ContaoSetList::CONTAO_50`updates your code to compatibility with Contao 5.0`ContaoSetList::ANNOTATIONS_TO_ATTRIBUTES`converts Contao annotations (e.g. `@Hook("...")`) to attributes (e.g. `#[AsHook('...')]`)`ContaoSetList::FQCN`upgrades class namespaces from global (e.g. `\StringUtil`) to Contao (e.g. `\Contao\StringUtil`)Available level sets
--------------------

[](#available-level-sets)

Level sets combine multiple changes for a specific Contao version, including dependencies like PHP, Symfony and Doctrine.

As an example, the **ContaoLevelSetList::UP\_TO\_CONTAO\_413** will upgrade your code to PHP 7.4 and Symfony 5.4, since Contao 4.13 does not support any lower versions.

Available rules
---------------

[](#available-rules)

- [Explore the current Rector rules](/docs/rules_overview.md)

### Development

[](#development)

You can generate the rules with the following command:

```
vendor/bin/rule-doc-generator generate src/Rector --output-file docs/rules_overview.md
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance48

Moderate activity, may be stable

Popularity33

Limited adoption so far

Community32

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1073273?v=4)[Andreas Schempp](/maintainers/aschempp)[@aschempp](https://github.com/aschempp)

![](https://www.gravatar.com/avatar/3de3a0dd7c29df679eb280585220c17c1a7340b46c2792d5e8298be859acfbba?d=identicon)[leofeyer](/maintainers/leofeyer)

---

Top Contributors

[![aschempp](https://avatars.githubusercontent.com/u/1073273?v=4)](https://github.com/aschempp "aschempp (34 commits)")[![zoglo](https://avatars.githubusercontent.com/u/55794780?v=4)](https://github.com/zoglo "zoglo (15 commits)")[![dmolineus](https://avatars.githubusercontent.com/u/1186266?v=4)](https://github.com/dmolineus "dmolineus (1 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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