From 21e4a4d84e2fc1f98cc438c77c3914706633082f Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Sun, 20 Oct 2024 23:29:51 +0200 Subject: [PATCH] fix psalm issues and run cs:fix Signed-off-by: Julien Veyssier --- composer.lock | 72 ++++++++++++------------- lib/Activity/CospendProvider.php | 14 ++--- lib/Controller/ApiController.php | 2 +- lib/Controller/OldApiController.php | 6 +-- lib/Controller/PageController.php | 16 +++--- lib/Controller/PublicApiController.php | 4 +- lib/Db/BillMapper.php | 2 +- lib/Db/Category.php | 2 +- lib/Db/Invitation.php | 2 +- lib/Db/PaymentMode.php | 2 +- lib/Search/CospendSearchProvider.php | 10 ++-- lib/Service/FederatedProjectService.php | 2 +- lib/Service/IProjectService.php | 2 +- lib/Service/LocalProjectService.php | 2 +- 14 files changed, 69 insertions(+), 69 deletions(-) diff --git a/composer.lock b/composer.lock index 4daa5018..a9e8e6b7 100644 --- a/composer.lock +++ b/composer.lock @@ -255,16 +255,16 @@ }, { "name": "nextcloud/coding-standard", - "version": "v1.3.1", + "version": "v1.3.2", "source": { "type": "git", "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "e88acb0df6217b808d1632286ddfec9267a102e4" + "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/e88acb0df6217b808d1632286ddfec9267a102e4", - "reference": "e88acb0df6217b808d1632286ddfec9267a102e4", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", + "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", "shasum": "" }, "require": { @@ -291,9 +291,9 @@ "description": "Nextcloud coding standards for the php cs fixer", "support": { "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.1" + "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.2" }, - "time": "2024-09-19T09:07:10+00:00" + "time": "2024-10-14T16:49:05+00:00" }, { "name": "nextcloud/ocp", @@ -301,12 +301,12 @@ "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "4f352c7125d27dc08f08a05a108bf9920536acaf" + "reference": "d97f2772e1a68957dce48ba857b80f4b17641bbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/4f352c7125d27dc08f08a05a108bf9920536acaf", - "reference": "4f352c7125d27dc08f08a05a108bf9920536acaf", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/d97f2772e1a68957dce48ba857b80f4b17641bbb", + "reference": "d97f2772e1a68957dce48ba857b80f4b17641bbb", "shasum": "" }, "require": { @@ -314,7 +314,7 @@ "psr/clock": "^1.0", "psr/container": "^2.0.2", "psr/event-dispatcher": "^1.0", - "psr/log": "^1.1.4" + "psr/log": "^3.0.2" }, "default-branch": true, "type": "library", @@ -338,7 +338,7 @@ "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/master" }, - "time": "2024-09-20T00:41:25+00:00" + "time": "2024-10-20T00:47:55+00:00" }, { "name": "nextcloud/openapi-extractor", @@ -346,12 +346,12 @@ "source": { "type": "git", "url": "https://github.com/nextcloud/openapi-extractor.git", - "reference": "08123750b840942afb17f9b901b047de9005bb0c" + "reference": "e36607030a8edf71b2324999003c1f5a04eb6053" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/openapi-extractor/zipball/08123750b840942afb17f9b901b047de9005bb0c", - "reference": "08123750b840942afb17f9b901b047de9005bb0c", + "url": "https://api.github.com/repos/nextcloud/openapi-extractor/zipball/e36607030a8edf71b2324999003c1f5a04eb6053", + "reference": "e36607030a8edf71b2324999003c1f5a04eb6053", "shasum": "" }, "require": { @@ -398,20 +398,20 @@ "source": "https://github.com/nextcloud/openapi-extractor/tree/main", "issues": "https://github.com/nextcloud/openapi-extractor/issues" }, - "time": "2024-09-15T14:47:07+00:00" + "time": "2024-10-19T05:55:38+00:00" }, { "name": "nikic/php-parser", - "version": "v5.2.0", + "version": "v5.3.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb" + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb", - "reference": "23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", "shasum": "" }, "require": { @@ -454,9 +454,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.2.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" }, - "time": "2024-09-15T16:40:33+00:00" + "time": "2024-10-08T18:51:32+00:00" }, { "name": "phar-io/manifest", @@ -630,16 +630,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.30.1", + "version": "1.33.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "51b95ec8670af41009e2b2b56873bad96682413e" + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/51b95ec8670af41009e2b2b56873bad96682413e", - "reference": "51b95ec8670af41009e2b2b56873bad96682413e", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", "shasum": "" }, "require": { @@ -671,9 +671,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.30.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" }, - "time": "2024-09-07T20:13:05+00:00" + "time": "2024-10-13T11:25:22+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1285,30 +1285,30 @@ }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1329,9 +1329,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { "name": "sebastian/cli-parser", diff --git a/lib/Activity/CospendProvider.php b/lib/Activity/CospendProvider.php index 6f8e8dd5..fece9004 100644 --- a/lib/Activity/CospendProvider.php +++ b/lib/Activity/CospendProvider.php @@ -41,14 +41,14 @@ class CospendProvider implements IProvider { private array $projectNames; public function __construct( - private IURLGenerator $urlGenerator, - private ActivityManager $activityManager, - private IUserManager $userManager, - private IGroupManager $groupManager, - private IAppManager $appManager, - private IL10N $l10n, + private IURLGenerator $urlGenerator, + private ActivityManager $activityManager, + private IUserManager $userManager, + private IGroupManager $groupManager, + private IAppManager $appManager, + private IL10N $l10n, private LocalProjectService $projectService, - private ?string $userId, + private ?string $userId, ) { $this->projectNames = []; if (!is_null($userId)) { diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index d3641667..1853888a 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -214,7 +214,7 @@ class ApiController extends OCSController { #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] #[SupportFederatedProject] public function editProject( - string $projectId, ?string $name = null, + string $projectId, ?string $name = null, ?string $autoExport = null, ?string $currencyName = null, ?bool $deletionDisabled = null, ?string $categorySort = null, ?string $paymentModeSort = null, ?int $archivedTs = null, ): DataResponse { diff --git a/lib/Controller/OldApiController.php b/lib/Controller/OldApiController.php index 88f466cd..25659c1d 100644 --- a/lib/Controller/OldApiController.php +++ b/lib/Controller/OldApiController.php @@ -311,7 +311,7 @@ class OldApiController extends ApiController { #[CospendPublicAuth(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] #[BruteForceProtection(action: 'CospendPublicAddMember')] public function apiAddMember(string $token, string $name, - float $weight = 1, int $active = 1, ?string $color = null): DataResponse { + float $weight = 1, int $active = 1, ?string $color = null): DataResponse { $publicShareInfo = $this->localProjectService->getLinkShareInfoFromShareToken($token); try { $member = $this->localProjectService->createMember( @@ -404,7 +404,7 @@ class OldApiController extends ApiController { #[CORS] #[NoCSRFRequired] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] - public function apiPrivAddBill(string $projectId, ?string $date = null, ?string $what = null, ?int $payer = null, + public function apiPrivAddBill(string $projectId, ?string $date = null, ?string $what = null, ?int $payer = null, ?string $payed_for = null, ?float $amount = null, string $repeat = 'n', ?string $paymentmode = null, ?int $paymentmodeid = null, ?int $categoryid = null, int $repeatallactive = 0, ?string $repeatuntil = null, ?int $timestamp = null, @@ -448,7 +448,7 @@ class OldApiController extends ApiController { #[CospendPublicAuth(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] #[BruteForceProtection(action: 'CospendPublicEditBill')] public function apiEditBill( - string $token, int $billid, ?string $date = null, ?string $what = null, + string $token, int $billid, ?string $date = null, ?string $what = null, ?int $payer = null, ?string $payed_for = null, ?float $amount = null, string $repeat = 'n', ?string $paymentmode = null, ?int $paymentmodeid = null, ?int $categoryid = null, ?int $repeatallactive = null, diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 3b7fb3e5..0769dc52 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -45,15 +45,15 @@ use OCP\PreConditionNotMetException; class PageController extends Controller { public function __construct( - string $appName, - IRequest $request, - private IL10N $trans, + string $appName, + IRequest $request, + private IL10N $trans, private LocalProjectService $projectService, - private IInitialState $initialStateService, - private IAppManager $appManager, - private IEventDispatcher $eventDispatcher, - private IConfig $config, - private ?string $userId, + private IInitialState $initialStateService, + private IAppManager $appManager, + private IEventDispatcher $eventDispatcher, + private IConfig $config, + private ?string $userId, ) { parent::__construct($appName, $request); } diff --git a/lib/Controller/PublicApiController.php b/lib/Controller/PublicApiController.php index 9a96e7a5..c0164861 100644 --- a/lib/Controller/PublicApiController.php +++ b/lib/Controller/PublicApiController.php @@ -257,7 +257,7 @@ class PublicApiController extends OCSController { #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Projects'])] public function publicGetProjectStatistics( string $token, ?int $tsMin = null, ?int $tsMax = null, - ?int $paymentModeId = null, ?int $categoryId = null, + ?int $paymentModeId = null, ?int $categoryId = null, ?float $amountMin = null, ?float $amountMax = null, string $showDisabled = '1', ?int $currencyId = null, ?int $payerId = null, ): DataResponse { @@ -894,7 +894,7 @@ class PublicApiController extends OCSController { #[BruteForceProtection(action: 'CospendPublicEditCat')] #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Categories'])] public function publicEditCategory( - string $token, int $categoryId, + string $token, int $categoryId, ?string $name = null, ?string $icon = null, ?string $color = null, ): DataResponse { try { diff --git a/lib/Db/BillMapper.php b/lib/Db/BillMapper.php index 66b09e57..7c87240f 100644 --- a/lib/Db/BillMapper.php +++ b/lib/Db/BillMapper.php @@ -316,7 +316,7 @@ class BillMapper extends QBMapper { * @throws \OCP\DB\Exception */ public function getBillsClassic( - string $projectId, ?int $tsMin = null, ?int $tsMax = null, + string $projectId, ?int $tsMin = null, ?int $tsMax = null, ?string $paymentMode = null, ?int $paymentModeId = null, ?int $category = null, ?float $amountMin = null, ?float $amountMax = null, ?int $lastchanged = null, ?int $limit = null, diff --git a/lib/Db/Category.php b/lib/Db/Category.php index 679321f3..99ba0c48 100644 --- a/lib/Db/Category.php +++ b/lib/Db/Category.php @@ -35,7 +35,7 @@ class Category extends Entity implements \JsonSerializable { $this->addType('name', 'string'); $this->addType('color', 'string'); $this->addType('encoded_icon', 'string'); - $this->addType('order', 'int'); + $this->addType('order', 'integer'); } public function jsonSerialize(): array { diff --git a/lib/Db/Invitation.php b/lib/Db/Invitation.php index 8e28b7f1..dc9a65c6 100644 --- a/lib/Db/Invitation.php +++ b/lib/Db/Invitation.php @@ -44,7 +44,7 @@ class Invitation extends Entity implements \JsonSerializable { public function __construct() { $this->addType('userId', 'string'); - $this->addType('state', 'int'); + $this->addType('state', 'integer'); $this->addType('accessToken', 'string'); $this->addType('remoteProjectId', 'string'); $this->addType('remoteProjectName', 'string'); diff --git a/lib/Db/PaymentMode.php b/lib/Db/PaymentMode.php index 2276f1b2..b940b1ad 100644 --- a/lib/Db/PaymentMode.php +++ b/lib/Db/PaymentMode.php @@ -38,7 +38,7 @@ class PaymentMode extends Entity implements \JsonSerializable { $this->addType('name', 'string'); $this->addType('color', 'string'); $this->addType('encoded_icon', 'string'); - $this->addType('order', 'int'); + $this->addType('order', 'integer'); $this->addType('old_id', 'string'); } diff --git a/lib/Search/CospendSearchProvider.php b/lib/Search/CospendSearchProvider.php index 87338f7c..0dd81994 100644 --- a/lib/Search/CospendSearchProvider.php +++ b/lib/Search/CospendSearchProvider.php @@ -42,12 +42,12 @@ use OCP\Search\SearchResultEntry; class CospendSearchProvider implements IProvider { public function __construct( - private IAppManager $appManager, - private IL10N $l10n, - private IURLGenerator $urlGenerator, - private IDateTimeFormatter $dateFormatter, + private IAppManager $appManager, + private IL10N $l10n, + private IURLGenerator $urlGenerator, + private IDateTimeFormatter $dateFormatter, private LocalProjectService $projectService, - private BillMapper $billMapper, + private BillMapper $billMapper, ) { } diff --git a/lib/Service/FederatedProjectService.php b/lib/Service/FederatedProjectService.php index 5cc180b8..96945021 100644 --- a/lib/Service/FederatedProjectService.php +++ b/lib/Service/FederatedProjectService.php @@ -294,7 +294,7 @@ class FederatedProjectService implements IProjectService { } public function editProject( - string $projectId, ?string $name = null, ?string $contact_email = null, + string $projectId, ?string $name = null, ?string $contact_email = null, ?string $autoExport = null, ?string $currencyName = null, ?bool $deletionDisabled = null, ?string $categorySort = null, ?string $paymentModeSort = null, ?int $archivedTs = null, ): void { diff --git a/lib/Service/IProjectService.php b/lib/Service/IProjectService.php index f55ba44a..d7122aca 100644 --- a/lib/Service/IProjectService.php +++ b/lib/Service/IProjectService.php @@ -110,7 +110,7 @@ interface IProjectService { * @return void */ public function editProject( - string $projectId, ?string $name = null, ?string $contact_email = null, + string $projectId, ?string $name = null, ?string $contact_email = null, ?string $autoExport = null, ?string $currencyName = null, ?bool $deletionDisabled = null, ?string $categorySort = null, ?string $paymentModeSort = null, ?int $archivedTs = null, ): void; diff --git a/lib/Service/LocalProjectService.php b/lib/Service/LocalProjectService.php index 9d123984..c7157fbe 100644 --- a/lib/Service/LocalProjectService.php +++ b/lib/Service/LocalProjectService.php @@ -1396,7 +1396,7 @@ class LocalProjectService implements IProjectService { } public function editProject( - string $projectId, ?string $name = null, ?string $contact_email = null, + string $projectId, ?string $name = null, ?string $contact_email = null, ?string $autoExport = null, ?string $currencyName = null, ?bool $deletionDisabled = null, ?string $categorySort = null, ?string $paymentModeSort = null, ?int $archivedTs = null, ): void {