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

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

invenso/rector
==============

Invenso Rector Bundle to update API Platform Annotations to Attributes

1.0.3(7mo ago)4151.0k↓52.8%5[1 issues](https://github.com/InvensoGroup/invenso-rector/issues)[1 PRs](https://github.com/InvensoGroup/invenso-rector/pulls)proprietaryPHPPHP ^8

Since Nov 15Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/InvensoGroup/invenso-rector)[ Packagist](https://packagist.org/packages/invenso/rector)[ Docs](https://www.invenso.nl)[ RSS](/packages/invenso-rector/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (7)Versions (5)Used By (0)

Invenso Rector
==============

[](#invenso-rector)

Invenso Rector can be used to convert Api Platform annotations to attributes

Since PHP version 8.0 annotations are replaced by using attributes

```
/**
 * @ApiResource
 */
class BookEntity
{
}
```

will be

```
#[ApiResource]
class BookEntity
{
}
```

Getting started
---------------

[](#getting-started)

### Requirement

[](#requirement)

- Api Platform must be installed
- Rector must be installed

[Rector documentation](https://getrector.com/documentation)

Installation
------------

[](#installation)

Install the bundle by using composer

```
composer require invenso/rector
```

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

[](#configuration)

The bundle can be configured by adding the configuration to the rector.php file

Add the following line to the rector file inside

```
$rectorConfig->sets([
    ApiPlatformSetList::ANNOTATIONS_TO_ATTRIBUTES,
]);
```

Best practice is to have all ANNOTATIONS\_TO\_ATTRIBUTES converters present

```
$rectorConfig->sets([
    DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
    DoctrineSetList::GEDMO_ANNOTATIONS_TO_ATTRIBUTES,
    ApiPlatformSetList::ANNOTATIONS_TO_ATTRIBUTES,
    SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
    SensiolabsSetList::ANNOTATIONS_TO_ATTRIBUTES,
]);
```

Execute Rector
--------------

[](#execute-rector)

Rector can be run by using the command

```
vendor/bin/rector process src
```

To make it a bit easier you can also add the rector command inside the composer.json file

```
{
  ...
  "scripts": {
    "rector": "vendor/bin/rector"
  }
}
```

Now you can run the following command to execute the rector script

```
composer rector process src
```

install with docker composer

```
docker run -ti -v ./:/app composer:latest composer install
```

### PHP CS Fix

[](#php-cs-fix)

```
docker run -ti -v ./:/app composer:latest composer php-cs-fix
```

### PHPstan

[](#phpstan)

```
docker run -ti -v ./:/app composer:latest composer phpstan
```

### Find deprecations

[](#find-deprecations)

```
docker run -ti -v ./:/app composer:latest composer outdated
```

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance57

Moderate activity, may be stable

Popularity40

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~387 days

Total

3

Last Release

231d ago

PHP version history (2 changes)1.0.1PHP ^8.0

1.0.3PHP ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f3d465d35a13bfe5c8e0daf5064a540404d815e9cd20e198b629343fb86ccb9?d=identicon)[InvensoGroup](/maintainers/InvensoGroup)

---

Top Contributors

[![InvensoGroup](https://avatars.githubusercontent.com/u/101555116?v=4)](https://github.com/InvensoGroup "InvensoGroup (8 commits)")[![fractalzombie](https://avatars.githubusercontent.com/u/5721336?v=4)](https://github.com/fractalzombie "fractalzombie (1 commits)")

###  Code Quality

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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