承接 invenso/rector 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

invenso/rector

最新稳定版本:1.0.3

Composer 安装命令:

composer require invenso/rector

包简介

Invenso Rector Bundle to update API Platform Annotations to Attributes

README 文档

README

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

Requirement

  • Api Platform must be installed
  • Rector must be installed

Rector documentation

Installation

Install the bundle by using composer

composer require invenso/rector

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

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

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

PHPstan

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

Find deprecations

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

统计信息

  • 总下载量: 95.64k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固