PHPackages                             cambis/silverstripe-rector - 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. cambis/silverstripe-rector

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

cambis/silverstripe-rector
==========================

Rector rules for Silverstripe CMS.

v2.1.8(5mo ago)57.2k↓26.9%20MITPHPPHP ^7.4 || ^8.0CI passing

Since May 7Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/Cambis/silverstripe-rector)[ Packagist](https://packagist.org/packages/cambis/silverstripe-rector)[ Docs](https://github.com/Cambis/silverstripe-rector)[ GitHub Sponsors](https://github.com/Cambis)[ RSS](/packages/cambis-silverstripe-rector/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (52)Used By (20)

Silverstripe Rector | Kaiako Ponga
==================================

[](#silverstripe-rector--kaiako-ponga)

This project contains [Rector rules](https://github.com/rectorphp/rector) for [Silverstripe CMS](https://github.com/silverstripe).

See the available [Silverstripe rules](docs/rector_rules_overview.md).

Installation 👷‍♀️
-----------------

[](#installation-‍️)

Install via composer.

```
composer require --dev cambis/silverstripe-rector
```

### Recommended 💡

[](#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 🚧
---------------

[](#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.

```
