Skip to content

Commit 9bba942

Browse files
committed
chore: Add rector
For now only for the tests Signed-off-by: Carl Schwan <carlschwan@kde.org>
1 parent 21147c8 commit 9bba942

3 files changed

Lines changed: 648 additions & 0 deletions

File tree

rector.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
6+
* SPDX-License-Identifier: AGPL-3.0-or-later
7+
*/
8+
use Nextcloud\Rector\Set\NextcloudSets;
9+
use Rector\Config\RectorConfig;
10+
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
11+
12+
return RectorConfig::configure()
13+
->withPaths([
14+
#__DIR__ . '/lib',
15+
__DIR__ . '/tests/Unit',
16+
])
17+
->withSkip([
18+
__DIR__ . '/tests/stubs',
19+
])
20+
->withPreparedSets(
21+
deadCode: true,
22+
typeDeclarations: true,
23+
)->withSets([
24+
NextcloudSets::NEXTCLOUD_30,
25+
])->withPhpSets(
26+
php82: true,
27+
)->withConfiguredRule(ClassPropertyAssignToConstructorPromotionRector::class, [
28+
'inline_public' => true,
29+
'rename_property' => true,
30+
]);

vendor-bin/rector/composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"require-dev": {
3+
"rector/rector": "^2.0"
4+
},
5+
"require": {
6+
"nextcloud/rector": "^0.5.1"
7+
}
8+
}

0 commit comments

Comments
 (0)