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.8M↑17.6%64[2 PRs](https://github.com/rectorphp/rector-doctrine/pulls)1MITPHPPHP &gt;=8.1CI passing

Since Mar 22Pushed 2mo 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 1mo ago

READMEChangelogDependencies (17)Versions (63)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

55

—

FairBetter than 98% of packages

Maintenance56

Moderate activity, may be stable

Popularity56

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 71.5% 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

983d 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 (403 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (95 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

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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