PHPackages                             imiphp/annotation-migration - 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. imiphp/annotation-migration

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

imiphp/annotation-migration
===========================

工具：迁移 imi 注解为 PHP8 原生实现

v1.0.0(2y ago)121MulanPSL-2.0PHPPHP ^8.1

Since Nov 2Pushed 2y ago2 watchersCompare

[ Source](https://github.com/imiphp/annotation-migration-tool)[ Packagist](https://packagist.org/packages/imiphp/annotation-migration)[ RSS](/packages/imiphp-annotation-migration/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (2)Used By (0)

迁移`imi`注解语法为`PHP 8`原生实现
=======================

[](#迁移imi注解语法为php-8原生实现)

用法
==

[](#用法)

### 迁移注解语法

[](#迁移注解语法)

检查 src 目录下的 php 是否有传统注解并重写

```
./vendor/bin/imi-migration --dir="src"
```

### 迁移注解定义

[](#迁移注解定义)

检查 src 目录下的 php 是否有传统定义并转换[构造器属性提升](https://www.php.net/manual/zh/language.oop5.decon.php#language.oop5.decon.constructor.promotion)语法

```
./vendor/bin/imi-migration --dir="src" --annotation-rewrite
```

### 初始化配置文件（可选）

[](#初始化配置文件可选)

配置文件务必是输出在项目根目录，可对`imi`注解语法解析器进行配置，以解决注解读取的冲突问题。

```
./vendor/bin/imi-migration --init-config
```

默认配置文件例子

```
