mxr576 / rector-drupal-configurator
配置Rector以理解Drupal 8+代码库。
0.2.0
2022-06-30 11:33 UTC
Requires
- php: ^7.4.0 || ~8.0.0 || ~8.1.0
- mglaman/drupal-static-autoloader: ~0.1.0
- rector/rector: ~0.13.7
- webflo/drupal-finder: ^1.2
README
提供配置Rector的工具,以理解Drupal 8+代码库。
用法
$ composer require mxr576/rector-drupal-configurator
$ ./vendor/bin/rector init
并调用
$drc = new \mxr576\RectorDrupalConfigurator\RectorDrupalConfigurator(); $drc->configure($rectorConfig);
在生成的函数rector.php
的开头。请参阅example.rector.php。
这个库与palantirnet/drupal-rector
之间的区别是什么?
palantirnet/drupal-rector不仅配置Rector以理解Drupal 8+代码库,还包含(仅)在它提供的rector.php
中包含的Drupal特定Rector规则。这个库将“Drupal配置”部分解耦,并(仅)提供一种独立的解决方案,可以在任何rector.php
中配置Rector以理解Drupal 8+代码库。你在那个rector.php中启用哪些其他Rector配置(例如:规则)取决于你。请参阅example.rector.php。此外,这个解决方案使用Matt Glaman的mglaman/drupal-static-autoloader的强大功能来自动加载所有必需的Drupal文件。
待办事项
- 添加测试覆盖率
- 添加代码质量检查和linters
致谢
- 感谢Pronovix赞助初始开发
- 感谢所有依赖这个小型库的开发者