diff options
author | provokateurin <kate@provokateurin.de> | 2024-10-18 12:04:22 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-10-21 12:37:59 +0200 |
commit | 381077028adf388a7081cf42026570c6be47b198 (patch) | |
tree | c0f8e9b6caea80d6b55d6fdcc9188ba57197fa0f /build | |
parent | 4d8d11d2f79da348644e0902e78a2f000498cd52 (diff) | |
download | nextcloud-server-381077028adf388a7081cf42026570c6be47b198.tar.gz nextcloud-server-381077028adf388a7081cf42026570c6be47b198.zip |
refactor(apps): Use constructor property promotion when possible
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'build')
-rw-r--r-- | build/psalm-baseline.xml | 18 | ||||
-rw-r--r-- | build/rector.php | 7 |
2 files changed, 7 insertions, 18 deletions
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index c83074709ce..da9e628dd4d 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -335,11 +335,6 @@ <code><![CDATA[$this->principalUri]]></code> </InvalidArgument> </file> - <file src="apps/dav/lib/CardDAV/Xml/Groups.php"> - <InvalidPropertyAssignmentValue> - <code><![CDATA[$groups]]></code> - </InvalidPropertyAssignmentValue> - </file> <file src="apps/dav/lib/Comments/CommentsPlugin.php"> <UndefinedFunction> <code><![CDATA[\Sabre\HTTP\toDate($value)]]></code> @@ -691,9 +686,7 @@ <LessSpecificReturnStatement> <code><![CDATA[$this->files->getMount($path)->getStorage()]]></code> </LessSpecificReturnStatement> - <MoreSpecificReturnType> - <code><![CDATA[\OC\Files\Storage\Storage|null]]></code> - </MoreSpecificReturnType> + <MoreSpecificReturnType/> </file> <file src="apps/federatedfilesharing/lib/Controller/RequestHandlerController.php"> <InvalidArgument> @@ -1247,15 +1240,6 @@ <code><![CDATA[bool]]></code> </InvalidReturnType> </file> - <file src="apps/workflowengine/lib/Service/RuleMatcher.php"> - <UndefinedInterfaceMethod> - <code><![CDATA[getAllConfiguredScopesForOperation]]></code> - <code><![CDATA[getChecks]]></code> - <code><![CDATA[getOperations]]></code> - <code><![CDATA[getOperations]]></code> - <code><![CDATA[isUserScopeEnabled]]></code> - </UndefinedInterfaceMethod> - </file> <file src="core/BackgroundJobs/CheckForUserCertificates.php"> <ParamNameMismatch> <code><![CDATA[$arguments]]></code> diff --git a/build/rector.php b/build/rector.php index db39fb4ce48..b6e46c1e53a 100644 --- a/build/rector.php +++ b/build/rector.php @@ -10,6 +10,7 @@ declare(strict_types=1); use PhpParser\Node; use Rector\CodingStyle\Contract\ClassNameImport\ClassNameImportSkipVoterInterface; use Rector\Config\RectorConfig; +use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector; use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType; use Rector\ValueObject\Application\File; @@ -67,7 +68,11 @@ $config = RectorConfig::configure() // uncomment to reach your current PHP version // ->withPhpSets() ->withImportNames(importShortClasses:false) - ->withTypeCoverageLevel(0); + ->withTypeCoverageLevel(0) + ->withConfiguredRule(ClassPropertyAssignToConstructorPromotionRector::class, [ + 'inline_public' => true, + 'rename_property' => true, + ]); $config->registerService(NextcloudNamespaceSkipVoter::class, tag:ClassNameImportSkipVoterInterface::class); |