christophwurst / nextcloud-rector
Nextcloud 的 Rector 升级规则
v0.2.1
2024-09-11 08:09 UTC
Requires
- php: ^8.1
Requires (Dev)
- phpunit/phpunit: ^10.5
- ramsey/devtools: ^2.0
- rector/rector: ^1.2
- dev-main
- v0.2.1
- v0.2.0
- v0.1.2
- v0.1.1
- v0.1.0
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-bug/noid/fix-missing-assert-instance
- dev-feat/add-rule-for-job-execute
- dev-feat/make-sets-complement-each-other
- dev-feat/fill-readme
- dev-feat/add-legacy-getter-rector-to-set
- dev-feat/add-rule-for-oc-legacy-getters
- dev-enh/use-classes-instead-of-fqdn
- dev-chore/rebrand
- dev-dependabot/github_actions/ridedott/merge-me-action-2.10.103
- dev-feat/ilogger-level-psr-log-level
- dev-dependabot/github_actions/ridedott/merge-me-action-2.10.102
- dev-dependabot/github_actions/actions/checkout-4.1.7
- dev-dependabot/github_actions/shivammathur/setup-php-2.31.1
- dev-dependabot/github_actions/codecov/codecov-action-4.5.0
- dev-dependabot/github_actions/ramsey/composer-install-3.0.0
This package is auto-updated.
Last update: 2024-09-20 18:08:27 UTC
README
Nextcloud 的 Rector 升级规则
关于
这是一个包含用于升级 Nextcloud 应用程序到最新 API 变更的 rector 规则和集合的包。
此项目遵守行为准则。通过参与此项目和其社区,您应遵守此准则。
安装
使用 Composer 将此包安装为依赖项。我们建议在与 rector 一起的 vendor bin 目录中这样做。
composer require --dev bamarni/composer-bin-plugin composer bin rector require rector/rector --dev composer bin rector require nextcloud/rector --dev
使用方法
首先运行一次 process
命令以生成 rector.php 配置文件
./vendor/bin/rector process
我们建议您首先使用空配置运行 rector,提交结果,然后逐个添加来自 Nextcloud 和 PHP 的集合,并每次提交规则及其结果。您应该在 Nextcloud 和 PHP 支持的最旧版本处停止。不要应用更新的集合,否则可能会失去兼容性。每个 Nextcloud 集合都包括较旧的集合,因此您只需在配置中包含其中一个即可。您可能会得到这样的配置
<?php declare(strict_types=1); /** * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-only */ use Nextcloud\Rector\Set\NextcloudSets; use Rector\Config\RectorConfig; return RectorConfig::configure() ->withPaths([ __DIR__ . '/appinfo', __DIR__ . '/lib', __DIR__ . '/tests', ]) ->withPhpSets(php81: true) ->withTypeCoverageLevel(0) ->withSets([ NextcloudSets::NEXTCLOUD_30, ]);
请确保您已设置 nextcloud/coding-standard 并在 rector 后运行代码风格修复器以修复样式。
贡献
欢迎贡献!要贡献,请熟悉 CONTRIBUTING.md。
版权和许可证
nextcloud/rector 版权归 Christoph Wurst 所有,并根据自由软件基金会发布的 GNU Affero 通用公共许可证(AGPL-3.0-or-later)的条款使用。请参阅COPYING 和 NOTICE 了解更多信息。