PHPackages                             christophwurst/nextcloud-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. christophwurst/nextcloud-rector

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

christophwurst/nextcloud-rector
===============================

Rector upgrade rules for Nextcloud

v0.4.1(1y ago)3481[8 PRs](https://github.com/nextcloud-libraries/rector/pulls)AGPL-3.0-or-laterPHPPHP ^8.1CI passing

Since Sep 11Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/nextcloud-libraries/rector)[ Packagist](https://packagist.org/packages/christophwurst/nextcloud-rector)[ RSS](/packages/christophwurst-nextcloud-rector/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (19)Used By (0)

nextcloud/rector
================

[](#nextcloudrector)

Rector upgrade rules for Nextcloud

About
-----

[](#about)

This is a package containing rector rules and sets to use to upgrade your Nextcloud application to the latest API changes.

This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). By participating in this project and its community, you are expected to uphold this code.

Installation
------------

[](#installation)

Install this package as a dependency using [Composer](https://getcomposer.org). We recommend to do so in a vendor bin directory along with rector.

```
composer require --dev bamarni/composer-bin-plugin
composer bin rector require rector/rector --dev
composer bin rector require nextcloud/rector --dev
```

Usage
-----

[](#usage)

First generate a rector.php configuration by running `process` command a first time:

```
./vendor/bin/rector process
```

We recommend that you first run rector with an empty configuration, commit the result, and then add the sets from Nextcloud and PHP one by one and commit the rule along with its result each time. You should stop at the oldest version your application is supporting of both Nextcloud and PHP. Do not apply a newer set or you might lose compatibility. Each Nextcloud set includes the older ones so you only need one of them in your configuration. You could end up with a configuration like this one:

```
