From 02e0f40f04ec002ab3a7b683e6777cf8b7e94fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 19 Sep 2024 09:29:45 +0200 Subject: [PATCH 1/2] feat: Make 26 set extend 25 and 27 extend 26 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- config/nextcloud-26/nextcloud-26-deprecations.php | 2 ++ config/nextcloud-27/nextcloud-27-deprecations.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/config/nextcloud-26/nextcloud-26-deprecations.php b/config/nextcloud-26/nextcloud-26-deprecations.php index 177cb8a..abe223e 100644 --- a/config/nextcloud-26/nextcloud-26-deprecations.php +++ b/config/nextcloud-26/nextcloud-26-deprecations.php @@ -3,12 +3,14 @@ declare(strict_types=1); use Nextcloud\Rector\Rector\RenameParameterRector; +use Nextcloud\Rector\Set\NextcloudSets; use Nextcloud\Rector\ValueObject\RenameParameter; use Rector\Config\RectorConfig; use Rector\Php80\Rector\Class_\AnnotationToAttributeRector; use Rector\Php80\ValueObject\AnnotationToAttribute; return static function (RectorConfig $rectorConfig): void { + $rectorConfig->sets([NextcloudSets::NEXTCLOUD_25]); $rectorConfig->ruleWithConfiguration( AnnotationToAttributeRector::class, [ diff --git a/config/nextcloud-27/nextcloud-27-deprecations.php b/config/nextcloud-27/nextcloud-27-deprecations.php index 5dcd8aa..43013dc 100644 --- a/config/nextcloud-27/nextcloud-27-deprecations.php +++ b/config/nextcloud-27/nextcloud-27-deprecations.php @@ -2,11 +2,13 @@ declare(strict_types=1); +use Nextcloud\Rector\Set\NextcloudSets; use Rector\Config\RectorConfig; use Rector\Php80\Rector\Class_\AnnotationToAttributeRector; use Rector\Php80\ValueObject\AnnotationToAttribute; return static function (RectorConfig $rectorConfig): void { + $rectorConfig->sets([NextcloudSets::NEXTCLOUD_26]); $rectorConfig->ruleWithConfiguration( AnnotationToAttributeRector::class, [ From 6725df484e7d6e9edd79c4f5676167eb43ca3329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 19 Sep 2024 09:31:20 +0200 Subject: [PATCH 2/2] chore: Remove ALL set, to force app developer to specify which version they support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- config/nextcloud-25/nextcloud-25-deprecations.php | 2 ++ config/nextcloud-all/nextcloud-all-deprecations.php | 12 ------------ src/Set/NextcloudSets.php | 1 - tests/Set/config/config.php | 3 +-- 4 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 config/nextcloud-all/nextcloud-all-deprecations.php diff --git a/config/nextcloud-25/nextcloud-25-deprecations.php b/config/nextcloud-25/nextcloud-25-deprecations.php index 4aa3b38..32266ca 100644 --- a/config/nextcloud-25/nextcloud-25-deprecations.php +++ b/config/nextcloud-25/nextcloud-25-deprecations.php @@ -4,12 +4,14 @@ use Nextcloud\Rector\Rector\LegacyGetterToOcpServerGetRector; use Nextcloud\Rector\Rector\OcServerToOcpServerRector; +use Nextcloud\Rector\Rector\OcpUtilAddScriptRector; use Nextcloud\Rector\ValueObject\LegacyGetterToOcpServerGet; use Rector\Config\RectorConfig; return static function (RectorConfig $rectorConfig): void { $rectorConfig->rules([ OcServerToOcpServerRector::class, + OcpUtilAddScriptRector::class, ]); $rectorConfig->ruleWithConfiguration( LegacyGetterToOcpServerGetRector::class, diff --git a/config/nextcloud-all/nextcloud-all-deprecations.php b/config/nextcloud-all/nextcloud-all-deprecations.php deleted file mode 100644 index 9db7787..0000000 --- a/config/nextcloud-all/nextcloud-all-deprecations.php +++ /dev/null @@ -1,12 +0,0 @@ -rules([ - OcpUtilAddScriptRector::class, - ]); -}; diff --git a/src/Set/NextcloudSets.php b/src/Set/NextcloudSets.php index 5f30a72..95718e4 100644 --- a/src/Set/NextcloudSets.php +++ b/src/Set/NextcloudSets.php @@ -11,7 +11,6 @@ */ final class NextcloudSets implements SetListInterface { - public const NEXTCLOUD_ALL = __DIR__ . '/../../config/nextcloud-all/nextcloud-all-deprecations.php'; public const NEXTCLOUD_25 = __DIR__ . '/../../config/nextcloud-25/nextcloud-25-deprecations.php'; public const NEXTCLOUD_26 = __DIR__ . '/../../config/nextcloud-26/nextcloud-26-deprecations.php'; public const NEXTCLOUD_27 = __DIR__ . '/../../config/nextcloud-27/nextcloud-27-deprecations.php'; diff --git a/tests/Set/config/config.php b/tests/Set/config/config.php index 70c9021..5a3df23 100644 --- a/tests/Set/config/config.php +++ b/tests/Set/config/config.php @@ -7,6 +7,5 @@ return RectorConfig::configure() ->withSets([ - NextcloudSets::NEXTCLOUD_ALL, - NextcloudSets::NEXTCLOUD_25, + NextcloudSets::NEXTCLOUD_26, ]);