-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Expand file tree
/
Copy pathrector-strict.php
More file actions
89 lines (85 loc) · 3.77 KB
/
Copy pathrector-strict.php
File metadata and controls
89 lines (85 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
use Rector\DeadCode\Rector\ClassMethod\RemoveDuplicatedReturnSelfDocblockRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveReturnTagIncompatibleWithNativeTypeRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\AddSeeTestAnnotationRector;
$nextcloudDir = dirname(__DIR__);
return (require __DIR__ . '/rector-shared.php')
->withPaths([
$nextcloudDir . '/build/rector-strict.php',
$nextcloudDir . '/core/BackgroundJobs/ExpirePreviewsJob.php',
$nextcloudDir . '/lib/public/IContainer.php',
$nextcloudDir . '/apps/appstore',
$nextcloudDir . '/apps/dav/lib/Connector/Sabre/Node.php',
$nextcloudDir . '/apps/files_versions/lib/Versions/IMetadataVersion.php',
$nextcloudDir . '/lib/private/Settings/AuthorizedGroup.php',
$nextcloudDir . '/lib/private/Settings/AuthorizedGroupMapper.php',
$nextcloudDir . '/apps/settings/lib/Service/AuthorizedGroupService.php',
$nextcloudDir . '/lib/private/Files/Storage/Storage.php',
$nextcloudDir . '/lib/private/Files/Cache/Storage.php',
$nextcloudDir . '/lib/private/Files/Cache/StorageGlobal.php',
$nextcloudDir . '/lib/private/Files/Storage/Wrapper/Wrapper.php',
$nextcloudDir . '/build/psalm/ITypedQueryBuilderTest.php',
$nextcloudDir . '/lib/private/DB/QueryBuilder/TypedQueryBuilder.php',
$nextcloudDir . '/lib/public/DB/QueryBuilder/ITypedQueryBuilder.php',
$nextcloudDir . '/lib/public/Interaction',
$nextcloudDir . '/tests/lib/Interaction',
$nextcloudDir . '/apps/files/lib/Listener/RestrictInteractionListener.php',
$nextcloudDir . '/apps/files/tests/Listener/RestrictInteractionListenerTest.php',
$nextcloudDir . '/apps/files_sharing/lib/Listener/RestrictInteractionListener.php',
$nextcloudDir . '/apps/files_sharing/tests/Listener/RestrictInteractionListenerTest.php',
$nextcloudDir . '/core/Listener/RestrictInteractionListener.php',
$nextcloudDir . '/tests/Core/Listener/RestrictInteractionListenerTest.php',
$nextcloudDir . '/lib/unstable/Sharing',
$nextcloudDir . '/lib/private/Sharing',
$nextcloudDir . '/tests/lib/Sharing',
$nextcloudDir . '/apps/sharing',
$nextcloudDir . '/core/Sharing',
$nextcloudDir . '/tests/Core/Sharing',
$nextcloudDir . '/apps/files/lib/Sharing',
$nextcloudDir . '/apps/files/tests/Sharing',
])
->withAutoloadPaths([
// ensure rector properly autoload the public interfaces
$nextcloudDir . '/lib/public',
])
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
typeDeclarationDocblocks: true,
privatization: true,
instanceOf: true,
earlyReturn: true,
rectorPreset: true,
phpunitCodeQuality: true,
doctrineCodeQuality: true,
symfonyCodeQuality: true,
symfonyConfigs: true,
)->withPhpSets(
php83: true,
)->withSkip([
AddSeeTestAnnotationRector::class,
ReadOnlyPropertyRector::class => [
$nextcloudDir . '/core/Listener/RestrictInteractionListener.php',
$nextcloudDir . '/apps/files_sharing/lib/Listener/RestrictInteractionListener.php',
],
ReadOnlyClassRector::class => [
$nextcloudDir . '/core/Listener/RestrictInteractionListener.php',
$nextcloudDir . '/apps/files_sharing/lib/Listener/RestrictInteractionListener.php',
],
RemoveReturnTagIncompatibleWithNativeTypeRector::class => [
$nextcloudDir . '/lib/unstable/Sharing/Property/ISharePropertyType.php',
$nextcloudDir . '/lib/unstable/Sharing/Property/ShareProperty.php',
],
// `@return $this` is more specific than the native `: self` on a
// non-final type; removing it breaks psalm's
// LessSpecificImplementedReturnType check (psalm-strict).
RemoveDuplicatedReturnSelfDocblockRector::class,
]);