PHPackages                             rector/rector-doctrine - 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. [Database &amp; ORM](/categories/database)
4. /
5. rector/rector-doctrine

ActiveRector-extension[Database &amp; ORM](/categories/database)

rector/rector-doctrine
======================

Rector upgrades rules for Doctrine

0.16.0(2y ago)791.9M↑64.2%64[1 PRs](https://github.com/rectorphp/rector-doctrine/pulls)1MITPHPPHP &gt;=8.1CI passing

Since Mar 22Pushed 1w ago4 watchersCompare

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

READMEChangelogDependencies (17)Versions (65)Used By (1)

Rector Rules for Doctrine
=========================

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

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

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 of constants:

```
use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withPreparedSets(doctrineCodeQuality: true)
    ->withComposerBased(doctrine: true);
```

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

```
use Rector\Config\RectorConfig;
use Rector\Doctrine\Set\DoctrineSetList;

return RectorConfig::configure()
    ->withSets([
        DoctrineSetList::DOCTRINE_CODE_QUALITY,
    ]);
```

See [documentation](https://getrector.com/documentation) for more.

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

[](#learn-rector-faster)

Rector is a tool that [we develop](https://getrector.com/) 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.com/contact)

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

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance64

Regular maintenance activity

Popularity57

Moderate usage in the ecosystem

Community35

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 71.3% 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 ~16 days

Recently: every ~96 days

Total

57

Last Release

1029d ago

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

0.11.1PHP &gt;=8.0

0.11.42PHP &gt;=8.1

### 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 (405 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (97 commits)")[![JohJohan](https://avatars.githubusercontent.com/u/7591464?v=4)](https://github.com/JohJohan "JohJohan (14 commits)")[![jszutkowski](https://avatars.githubusercontent.com/u/6891204?v=4)](https://github.com/jszutkowski "jszutkowski (5 commits)")[![julienfastre](https://avatars.githubusercontent.com/u/345600?v=4)](https://github.com/julienfastre "julienfastre (5 commits)")[![dritter](https://avatars.githubusercontent.com/u/1544760?v=4)](https://github.com/dritter "dritter (5 commits)")[![acrobat](https://avatars.githubusercontent.com/u/1374857?v=4)](https://github.com/acrobat "acrobat (4 commits)")[![uncaught](https://avatars.githubusercontent.com/u/10322643?v=4)](https://github.com/uncaught "uncaught (3 commits)")[![marcelthole](https://avatars.githubusercontent.com/u/850125?v=4)](https://github.com/marcelthole "marcelthole (3 commits)")[![carlos-granados](https://avatars.githubusercontent.com/u/1383106?v=4)](https://github.com/carlos-granados "carlos-granados (3 commits)")[![kick-the-bucket](https://avatars.githubusercontent.com/u/7068596?v=4)](https://github.com/kick-the-bucket "kick-the-bucket (2 commits)")[![wkania](https://avatars.githubusercontent.com/u/57155526?v=4)](https://github.com/wkania "wkania (2 commits)")[![alexander-schranz](https://avatars.githubusercontent.com/u/1698337?v=4)](https://github.com/alexander-schranz "alexander-schranz (2 commits)")[![aszenz](https://avatars.githubusercontent.com/u/25319264?v=4)](https://github.com/aszenz "aszenz (2 commits)")[![simonschaufi](https://avatars.githubusercontent.com/u/941794?v=4)](https://github.com/simonschaufi "simonschaufi (1 commits)")[![xthiago](https://avatars.githubusercontent.com/u/720151?v=4)](https://github.com/xthiago "xthiago (1 commits)")[![yguedidi](https://avatars.githubusercontent.com/u/1480128?v=4)](https://github.com/yguedidi "yguedidi (1 commits)")[![alexis-boyer](https://avatars.githubusercontent.com/u/56953765?v=4)](https://github.com/alexis-boyer "alexis-boyer (1 commits)")[![fezfez](https://avatars.githubusercontent.com/u/1162307?v=4)](https://github.com/fezfez "fezfez (1 commits)")[![franmomu](https://avatars.githubusercontent.com/u/720690?v=4)](https://github.com/franmomu "franmomu (1 commits)")

---

Tags

astdoctrineinstant-upgradesphprector

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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