承接 cambis/silverstripe-rector 相关项目开发

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

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

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

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-29