mirror of
https://github.com/nextcloud/server.git
synced 2026-10-15 02:57:15 +02:00
106 lines
4.7 KiB
PHP
106 lines
4.7 KiB
PHP
<?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',
|
|
$nextcloudDir . '/lib/public/AppFramework/ORM',
|
|
$nextcloudDir . '/lib/private/AppFramework/ORM',
|
|
$nextcloudDir . '/apps/oauth2',
|
|
$nextcloudDir . '/apps/files/lib/Db/OpenLocalEditor.php',
|
|
$nextcloudDir . '/apps/files/lib/Db/OpenLocalEditorMapper.php',
|
|
$nextcloudDir . '/apps/files/lib/Controller/OpenLocalEditorController.php',
|
|
$nextcloudDir . '/apps/files/tests/Db/OpenLocalEditorMapperTest.php',
|
|
$nextcloudDir . '/apps/files/lib/Db/TransferOwnership.php',
|
|
$nextcloudDir . '/apps/files/lib/Db/TransferOwnershipMapper.php',
|
|
$nextcloudDir . '/apps/files/lib/Controller/TransferOwnershipController.php',
|
|
$nextcloudDir . '/apps/files/lib/BackgroundJob/TransferOwnership.php',
|
|
$nextcloudDir . '/apps/files/lib/Notification/Notifier.php',
|
|
$nextcloudDir . '/apps/files/tests/Db/TransferOwnershipMapperTest.php',
|
|
$nextcloudDir . '/lib/public/SystemReport',
|
|
$nextcloudDir . '/lib/private/SystemReport',
|
|
$nextcloudDir . '/tests/lib/SystemReport',
|
|
])
|
|
->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,
|
|
]);
|