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(4mo ago)4118.5k↓19.3%5[1 PRs](https://github.com/InvensoGroup/invenso-rector/pulls)proprietaryPHPPHP ^8

Since Nov 15Pushed 4mo 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 1mo 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

46

—

FairBetter than 93% of packages

Maintenance74

Regular maintenance activity

Popularity39

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity45

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

140d 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)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)

PHPackages © 2026

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