cambis/silverstripe-rector
最新稳定版本:v2.1.7
Composer 安装命令:
composer require --dev cambis/silverstripe-rector
包简介
Rector rules for Silverstripe CMS.
关键字:
README 文档
README
This project contains Rector rules for Silverstripe CMS.
See the available Silverstripe rules.
Installation 👷♀️
Install via composer.
composer require --dev cambis/silverstripe-rector
Recommended 💡
Add PSR-4 autoload setup in your composer.json. This will help Rector to discover your classes and give it a performance boost.
{
"autoload": {
"classmap": [
"app/src/Page.php",
"app/src/PageController.php"
],
"psr-4": {
"MyProjectNamespace\\": "app/src"
}
},
"autoload-dev": {
"psr-4": {
"MyProjectNamespace\\Tests\\": "app/tests"
}
}
}
Verify everything is compliant.
composer dumpautoload -o
Configuration 🚧
If you do not have an existing rector.php file, run the following command and Rector will create one for you.
vendor/bin/rector
Then use the SilverstripeLevelSetList and SilverstripeSetList sets and pick one of the constants.
<?php declare(strict_types=1); use Cambis\SilverstripeRector\Set\ValueObject\SilverstripeLevelSetList; use Cambis\SilverstripeRector\Set\ValueObject\SilverstripeSetList; use Rector\Config\RectorConfig; return RectorConfig::configure() ->withPaths([ __DIR__ . '/app/_config.php', __DIR__ . '/app/src', __DIR__ . '/app/tests', ]) ->withSets([ SilverstripeLevelSetList::UP_TO_SILVERSTRIPE_52, SilverstripeSetList::CODE_QUALITY, ]);
Usage 🏃
Analyse your code with Rector and review the suggested changes.
vendor/bin/rector process --dry-run
Apply the suggested changes after they have been reviewed.
vendor/bin/rector process
For more information on usage, please refer to the official docs.
统计信息
- 总下载量: 5.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 33
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-29