From 8fb37245323613028e2fbff30457fc022ba0ca6b Mon Sep 17 00:00:00 2001 From: nextcloud-command Date: Sun, 7 Jun 2026 15:06:35 +0000 Subject: [PATCH] refactor: Apply rector changes Signed-off-by: GitHub --- composer.json | 1 - composer.lock | 362 +---------------------------- lib/Activity/ProviderParser.php | 2 +- lib/Model/Member.php | 2 +- lib/Model/ShareWrapper.php | 2 +- lib/Service/AvatarService.php | 17 +- lib/Service/MaintenanceService.php | 2 +- lib/Tools/Traits/TNCSignatory.php | 2 +- 8 files changed, 16 insertions(+), 374 deletions(-) diff --git a/composer.json b/composer.json index f3ddc847c..d3e2a4f0e 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,6 @@ "rector": "rector && composer cs:fix" }, "require-dev": { - "nextcloud/ocp": "dev-master", "bamarni/composer-bin-plugin": "^1.8" } } diff --git a/composer.lock b/composer.lock index 6c2ff3ca2..67e0ee264 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "54a97b04b656f443165418702171475b", + "content-hash": "026a84fb781f922de10a43c357a74ca6", "packages": [], "packages-dev": [ { @@ -63,369 +63,11 @@ "source": "https://github.com/bamarni/composer-bin-plugin/tree/1.9.1" }, "time": "2026-02-04T10:18:12+00:00" - }, - { - "name": "nextcloud/ocp", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "b01a80e20e17c3bf3c5d8a0246289ec465fd0b0f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/b01a80e20e17c3bf3c5d8a0246289ec465fd0b0f", - "reference": "b01a80e20e17c3bf3c5d8a0246289ec465fd0b0f", - "shasum": "" - }, - "require": { - "php": "~8.1 || ~8.2 || ~8.3 || ~8.4 || ~8.5", - "psr/clock": "^1.0", - "psr/container": "^2.0.2", - "psr/event-dispatcher": "^1.0", - "psr/http-client": "^1.0.3", - "psr/log": "^3.0.2" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "35.0.0-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "AGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Christoph Wurst", - "email": "christoph@winzerhof-wurst.at" - }, - { - "name": "Joas Schilling", - "email": "coding@schilljs.com" - } - ], - "description": "Composer package containing Nextcloud's public OCP API and the unstable NCU API", - "support": { - "issues": "https://github.com/nextcloud-deps/ocp/issues", - "source": "https://github.com/nextcloud-deps/ocp/tree/master" - }, - "time": "2026-06-04T02:37:15+00:00" - }, - { - "name": "psr/clock", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/clock.git", - "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", - "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Clock\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for reading the clock.", - "homepage": "https://github.com/php-fig/clock", - "keywords": [ - "clock", - "now", - "psr", - "psr-20", - "time" - ], - "support": { - "issues": "https://github.com/php-fig/clock/issues", - "source": "https://github.com/php-fig/clock/tree/1.0.0" - }, - "time": "2022-11-25T14:36:26+00:00" - }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" - }, - "time": "2019-01-08T18:20:26+00:00" - }, - { - "name": "psr/http-client", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "support": { - "source": "https://github.com/php-fig/http-client" - }, - "time": "2023-09-23T14:17:50+00:00" - }, - { - "name": "psr/http-message", - "version": "2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/2.0" - }, - "time": "2023-04-04T09:54:51+00:00" - }, - { - "name": "psr/log", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" - }, - "time": "2024-09-11T13:17:53+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "nextcloud/ocp": 20 - }, + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": {}, diff --git a/lib/Activity/ProviderParser.php b/lib/Activity/ProviderParser.php index 1a86369bf..a50e9df24 100644 --- a/lib/Activity/ProviderParser.php +++ b/lib/Activity/ProviderParser.php @@ -71,7 +71,7 @@ protected function setRichSubject( foreach ($ak as $k) { $subAk = array_keys($data[$k]); foreach ($subAk as $sK) { - if (str_starts_with($sK, '_')) { + if (str_starts_with((string)$sK, '_')) { unset($data[$k][$sK]); } } diff --git a/lib/Model/Member.php b/lib/Model/Member.php index 02e02b5d4..ec882bbb6 100644 --- a/lib/Model/Member.php +++ b/lib/Model/Member.php @@ -795,7 +795,7 @@ public function import(array $data): IDeserializable { /** @var Circle $circle */ $circle = $this->deserialize($this->getArray('circle', $data), Circle::class); $this->setCircle($circle); - } catch (InvalidItemException $e) { + } catch (InvalidItemException) { } try { diff --git a/lib/Model/ShareWrapper.php b/lib/Model/ShareWrapper.php index f6cabe930..77a489a50 100644 --- a/lib/Model/ShareWrapper.php +++ b/lib/Model/ShareWrapper.php @@ -534,7 +534,7 @@ public function import(array $data): IDeserializable { try { $fileCache = new FileCacheWrapper(); $this->setFileCache($fileCache->import($this->getArray('fileCache', $data))); - } catch (InvalidItemException $e) { + } catch (InvalidItemException) { } try { diff --git a/lib/Service/AvatarService.php b/lib/Service/AvatarService.php index 5f604b7a2..c5233ee5a 100644 --- a/lib/Service/AvatarService.php +++ b/lib/Service/AvatarService.php @@ -30,15 +30,16 @@ use OCP\Files\SimpleFS\ISimpleFile; use OCP\Files\SimpleFS\ISimpleFolder; use OCP\IL10N; +use OCP\Image; use OCP\Security\ISecureRandom; class AvatarService { public function __construct( - private IAppData $appData, - private IL10N $l, - private ISecureRandom $random, - private CircleService $circleService, - private FederatedEventService $federatedEventService, + private readonly IAppData $appData, + private readonly IL10N $l, + private readonly ISecureRandom $random, + private readonly CircleService $circleService, + private readonly FederatedEventService $federatedEventService, ) { } @@ -61,7 +62,7 @@ public function getAvatar(string $circleId): ?ISimpleFile { } } } - } catch (NotFoundException $e) { + } catch (NotFoundException) { } return null; @@ -142,7 +143,7 @@ private function setAvatar(string $circleId, ?array $file): string { $content = file_get_contents($file['tmp_name']); unlink($file['tmp_name']); - $image = new \OCP\Image(); + $image = new Image(); $image->loadFromData($content); $image->readExif($content); @@ -196,7 +197,7 @@ private function getAvatarFolder(string $circleId): ISimpleFolder { } try { $avatarFolder = $folder->getFolder($circleId); - } catch (NotFoundException $e) { + } catch (NotFoundException) { $avatarFolder = $folder->newFolder($circleId); } return $avatarFolder; diff --git a/lib/Service/MaintenanceService.php b/lib/Service/MaintenanceService.php index 663e3a221..0a960a993 100644 --- a/lib/Service/MaintenanceService.php +++ b/lib/Service/MaintenanceService.php @@ -222,7 +222,7 @@ private function runMaintenance5(bool $forceRefresh = false): void { try { $this->output('Update memberships'); $this->updateAllMemberships(); - } catch (Exception $e) { + } catch (Exception) { } try { diff --git a/lib/Tools/Traits/TNCSignatory.php b/lib/Tools/Traits/TNCSignatory.php index 8b81d262c..8655784e0 100644 --- a/lib/Tools/Traits/TNCSignatory.php +++ b/lib/Tools/Traits/TNCSignatory.php @@ -160,7 +160,7 @@ public function signString(string $clear, NCSignatory $signatory): string { openssl_sign($clear, $signed, $privateKey, $this->getOpenSSLAlgo($signatory)); - return base64_encode($signed); + return base64_encode((string)$signed); } /**