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 1e60ae41a..4c3d5b376 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/AppInfo/Application.php b/lib/AppInfo/Application.php index 5d7cc24c6..962df7aca 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -175,15 +175,13 @@ public function registerNavigation( return; } - $navigationManager->add(static function () use ($urlGenerator, $l10nFactory) { - return [ - 'id' => Application::APP_ID, - 'order' => 80, - 'href' => $urlGenerator->linkToRoute('circles.Page.index'), - 'icon' => $urlGenerator->imagePath(Application::APP_ID, 'circles.svg'), - 'name' => $l10nFactory->get(Application::APP_ID)->t('Teams'), - ]; - }); + $navigationManager->add(static fn () => [ + 'id' => Application::APP_ID, + 'order' => 80, + 'href' => $urlGenerator->linkToRoute('circles.Page.index'), + 'icon' => $urlGenerator->imagePath(Application::APP_ID, 'circles.svg'), + 'name' => $l10nFactory->get(Application::APP_ID)->t('Teams'), + ]); } public function registerMountProvider(ContainerInterface $container): void { diff --git a/lib/Command/CirclesCheck.php b/lib/Command/CirclesCheck.php index 4779c9c7a..9b7b69d1f 100644 --- a/lib/Command/CirclesCheck.php +++ b/lib/Command/CirclesCheck.php @@ -10,7 +10,6 @@ use Exception; use OC\Core\Command\Base; -use OC\Memcache\APCu; use OCA\Circles\AppInfo\Application; use OCA\Circles\AppInfo\Capabilities; use OCA\Circles\Exceptions\FederatedEventException; diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 8f30d297e..bf6ebf202 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -26,7 +26,7 @@ class PageController extends Controller { public function __construct( IRequest $request, - private ConfigService $configService, + private readonly ConfigService $configService, ) { parent::__construct(Application::APP_ID, $request); } diff --git a/lib/Controller/TeamFolderController.php b/lib/Controller/TeamFolderController.php index 682d2d5a6..4f47e7221 100644 --- a/lib/Controller/TeamFolderController.php +++ b/lib/Controller/TeamFolderController.php @@ -12,6 +12,7 @@ use OCA\Circles\Db\CircleRequest; use OCA\Circles\Exceptions\CircleNotFoundException; use OCA\Circles\Exceptions\InsufficientPermissionException; +use OCA\Circles\Model\Circle; use OCA\Circles\Service\PermissionService; use OCA\Circles\Service\TeamFolderPolicy; use OCP\AppFramework\Http; @@ -23,6 +24,7 @@ use OCP\IRequest; use OCP\IUser; use OCP\IUserSession; +use OCP\Teams\ITeamFolderProvider; use OCP\Teams\ITeamManager; use OCP\Teams\Team; @@ -86,7 +88,7 @@ public function unlinkTeamFolder(string $circleId, bool $deleteFolder = false): return new DataResponse(['success' => true]); } - private function getProvider(): \OCP\Teams\ITeamFolderProvider { + private function getProvider(): ITeamFolderProvider { $provider = $this->teamManager->getTeamFolderProvider(); if ($provider === null) { throw new OCSNotFoundException('No team folder provider is enabled'); @@ -95,7 +97,7 @@ private function getProvider(): \OCP\Teams\ITeamFolderProvider { return $provider; } - private function getCircle(string $circleId): \OCA\Circles\Model\Circle { + private function getCircle(string $circleId): Circle { try { return $this->circleRequest->getCircle($circleId); } catch (CircleNotFoundException) { diff --git a/lib/Db/CoreQueryBuilder.php b/lib/Db/CoreQueryBuilder.php index 9630b4324..4f2cd877f 100644 --- a/lib/Db/CoreQueryBuilder.php +++ b/lib/Db/CoreQueryBuilder.php @@ -847,7 +847,7 @@ public function leftJoinCircleInvitation(string $alias, string $field = 'unique_ try { $aliasInvitation = $this->generateAlias($alias, self::INVITATION, $options); - } catch (RequestBuilderException $e) { + } catch (RequestBuilderException) { return; } @@ -1407,7 +1407,7 @@ public function filterInvitationCode(string $alias, string $invitationCode): voi try { $aliasInvitation = $this->generateAlias($alias, self::INVITATION, $options); - } catch (RequestBuilderException $e) { + } catch (RequestBuilderException) { return; } diff --git a/lib/Db/MemberRequest.php b/lib/Db/MemberRequest.php index dd94c7f21..98fb07496 100644 --- a/lib/Db/MemberRequest.php +++ b/lib/Db/MemberRequest.php @@ -30,7 +30,7 @@ class MemberRequest extends MemberRequestBuilder { public function __construct( - private IDBConnection $db, + private readonly IDBConnection $db, TimezoneService $timezoneService, ConfigService $configService, ) { diff --git a/lib/Listeners/CircleMemberRemoved.php b/lib/Listeners/CircleMemberRemoved.php index 48f03c91d..9fde0abe7 100644 --- a/lib/Listeners/CircleMemberRemoved.php +++ b/lib/Listeners/CircleMemberRemoved.php @@ -11,6 +11,7 @@ use Exception; use OCA\Circles\Events\CircleMemberRemovedEvent; +use OCA\GroupFolders\Folder\FolderManager; use OCP\App\IAppManager; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; @@ -68,7 +69,7 @@ private function circleHasAssociatedGroupFolder(string $circleId): bool { } try { - $folderManager = Server::get(\OCA\GroupFolders\Folder\FolderManager::class); + $folderManager = Server::get(FolderManager::class); return $folderManager->hasFolderForCircle($circleId); } catch (Exception $e) { $this->logger->debug('Failed to check if circle ' . $circleId . ' has an associated team folder', ['exception' => $e]); diff --git a/lib/Listeners/Files/MembershipsRemoved.php b/lib/Listeners/Files/MembershipsRemoved.php index 89074fb6f..e2a712c6e 100644 --- a/lib/Listeners/Files/MembershipsRemoved.php +++ b/lib/Listeners/Files/MembershipsRemoved.php @@ -10,7 +10,6 @@ namespace OCA\Circles\Listeners\Files; use OCA\Circles\CirclesManager; -use OCA\Circles\Db\ShareWrapperRequest; use OCA\Circles\Events\MembershipsRemovedEvent; use OCA\Circles\Exceptions\CircleNotFoundException; use OCA\Circles\Exceptions\FederatedItemException; diff --git a/lib/Listeners/GroupMemberRemoved.php b/lib/Listeners/GroupMemberRemoved.php index 7eb44134a..2cf1a9cec 100644 --- a/lib/Listeners/GroupMemberRemoved.php +++ b/lib/Listeners/GroupMemberRemoved.php @@ -11,6 +11,7 @@ use Exception; use OCA\Circles\Service\SyncService; +use OCA\GroupFolders\Folder\FolderManager; use OCP\App\IAppManager; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; @@ -65,7 +66,7 @@ private function groupHasAssociatedGroupFolder(string $groupId): bool { } try { - $folderManager = Server::get(\OCA\GroupFolders\Folder\FolderManager::class); + $folderManager = Server::get(FolderManager::class); return $folderManager->hasFolderForGroup($groupId); } catch (Exception $e) { $this->logger->debug('Failed to check if group ' . $groupId . ' has an associated team folder', ['exception' => $e]); diff --git a/lib/Model/BaseMember.php b/lib/Model/BaseMember.php index 1fe6326cb..610a4f1f2 100644 --- a/lib/Model/BaseMember.php +++ b/lib/Model/BaseMember.php @@ -9,7 +9,6 @@ use JsonSerializable; use OCA\Circles\AppInfo\Application; -use OCA\Circles\Service\MiscService; use OCP\IL10N; use OCP\L10N\IFactory; use OCP\Server; diff --git a/lib/Model/Circle.php b/lib/Model/Circle.php index 083ea8980..f5a857de5 100644 --- a/lib/Model/Circle.php +++ b/lib/Model/Circle.php @@ -803,7 +803,7 @@ public function import(array $data): IDeserializable { /** @var CircleInvitation $circleInvitation */ $circleInvitation = $this->deserialize($this->getArray('invitation', $data), CircleInvitation::class); $this->setCircleInvitation($circleInvitation); - } catch (InvalidItemException $e) { + } catch (InvalidItemException) { } return $this; diff --git a/lib/Model/ModelManager.php b/lib/Model/ModelManager.php index 35969b3e4..e1c383318 100644 --- a/lib/Model/ModelManager.php +++ b/lib/Model/ModelManager.php @@ -261,7 +261,7 @@ private function importIntoCircle(Circle $circle, array $data, string $path, str $circleInvitation = new CircleInvitation(); $circleInvitation->importFromDatabase($data, $prefix); $circle->setCircleInvitation($circleInvitation); - } catch (CircleInvitationNotFoundException $e) { + } catch (CircleInvitationNotFoundException) { } break; } diff --git a/lib/Model/ShareWrapper.php b/lib/Model/ShareWrapper.php index 29bc6c5ce..da9880064 100644 --- a/lib/Model/ShareWrapper.php +++ b/lib/Model/ShareWrapper.php @@ -524,7 +524,7 @@ public function import(array $data): IDeserializable { try { $circle = new Circle(); $this->setCircle($circle->import($this->getArray('circle', $data))); - } catch (InvalidItemException $e) { + } catch (InvalidItemException) { } try { diff --git a/lib/Service/AvatarService.php b/lib/Service/AvatarService.php index 21e2af913..5dd4091e6 100644 --- a/lib/Service/AvatarService.php +++ b/lib/Service/AvatarService.php @@ -30,6 +30,7 @@ use OCP\Files\SimpleFS\ISimpleFile; use OCP\Files\SimpleFS\ISimpleFolder; use OCP\IL10N; +use OCP\Image; use OCP\Security\ISecureRandom; class AvatarService { @@ -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); diff --git a/lib/Service/RemoteStreamService.php b/lib/Service/RemoteStreamService.php index 485954d4a..ab11debe4 100644 --- a/lib/Service/RemoteStreamService.php +++ b/lib/Service/RemoteStreamService.php @@ -39,6 +39,7 @@ use OCP\AppFramework\Http; use OCP\IConfig; use OCP\IURLGenerator; +use OCP\Server; use ReflectionClass; use ReflectionException; @@ -137,7 +138,7 @@ public function getAppSignatory(bool $generate = true, string $confirmKey = ''): ) ); // use Server::get() to avoid circular dependency - $federationAgentService = \OCP\Server::get(FederationAgentService::class); + $federationAgentService = Server::get(FederationAgentService::class); $app->setFederationAgentId($federationAgentService->getOrCreateFederationAgentId()); if ($this->interfaceService->isCurrentInterfaceInternal()) { diff --git a/lib/Service/ShareService.php b/lib/Service/ShareService.php index 617b7f385..112959032 100644 --- a/lib/Service/ShareService.php +++ b/lib/Service/ShareService.php @@ -10,7 +10,6 @@ namespace OCA\Circles\Service; use OCA\Circles\Model\Circle; -use OCA\Circles\Model\Federated\FederatedEvent; /** * Class ShareService diff --git a/lib/Service/TeamFolderPolicy.php b/lib/Service/TeamFolderPolicy.php index 0d8f1701e..e3bf4fb9a 100644 --- a/lib/Service/TeamFolderPolicy.php +++ b/lib/Service/TeamFolderPolicy.php @@ -30,7 +30,7 @@ */ class TeamFolderPolicy { public function __construct( - private IAppConfig $appConfig, + private readonly IAppConfig $appConfig, ) { } diff --git a/lib/Settings/AdminSection.php b/lib/Settings/AdminSection.php index 20e297131..5eca623bc 100644 --- a/lib/Settings/AdminSection.php +++ b/lib/Settings/AdminSection.php @@ -14,8 +14,8 @@ class AdminSection implements IIconSection { public function __construct( - private IL10N $l, - private IURLGenerator $url, + private readonly IL10N $l, + private readonly IURLGenerator $url, ) { } diff --git a/lib/Settings/AdminTeamFolders.php b/lib/Settings/AdminTeamFolders.php index 7674afed1..99e0fca0f 100644 --- a/lib/Settings/AdminTeamFolders.php +++ b/lib/Settings/AdminTeamFolders.php @@ -16,15 +16,16 @@ use OCP\IAppConfig; use OCP\IL10N; use OCP\Settings\IDelegatedSettings; +use OCP\Util; class AdminTeamFolders implements IDelegatedSettings { /** * AdminTeamFolders constructor. */ public function __construct( - private IAppConfig $appConfig, - private IL10N $l, - private IInitialState $initialState, + private readonly IAppConfig $appConfig, + private readonly IL10N $l, + private readonly IInitialState $initialState, ) { } @@ -38,8 +39,8 @@ public function getForm(): TemplateResponse { $this->initialState->provideInitialState('teamFolderAutoCreate', $teamFolderAutoCreate); $this->initialState->provideInitialState('teamFolderDefaultQuota', $teamFolderDefaultQuota); - \OCP\Util::addStyle(Application::APP_ID, 'teams-settings-team-folders'); - \OCP\Util::addScript(Application::APP_ID, 'teams-settings-team-folders'); + Util::addStyle(Application::APP_ID, 'teams-settings-team-folders'); + Util::addScript(Application::APP_ID, 'teams-settings-team-folders'); return new TemplateResponse(Application::APP_ID, 'settings-team-folders', renderAs: ''); } diff --git a/lib/Tools/Traits/TNCSignatory.php b/lib/Tools/Traits/TNCSignatory.php index d3b4b0c3b..f2f073695 100644 --- a/lib/Tools/Traits/TNCSignatory.php +++ b/lib/Tools/Traits/TNCSignatory.php @@ -153,7 +153,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); } /** diff --git a/lib/Tools/Traits/TStringTools.php b/lib/Tools/Traits/TStringTools.php index 5ac6fe38d..024a49031 100644 --- a/lib/Tools/Traits/TStringTools.php +++ b/lib/Tools/Traits/TStringTools.php @@ -11,6 +11,7 @@ use DateTime; use Exception; +use OCA\Circles\Model\ManagedModel; trait TStringTools { use TArrayTools; @@ -45,7 +46,7 @@ protected function token(int $length = 15): string { protected function generateCircleIdFromString(string $source): string { $chars = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890'; $max = strlen($chars); - $length = \OCA\Circles\Model\ManagedModel::ID_LENGTH; + $length = ManagedModel::ID_LENGTH; $bytes = ''; for ($i = 0; strlen($bytes) < $length; $i++) { diff --git a/tests/unit/lib/Service/TeamFolderPolicyTest.php b/tests/unit/lib/Service/TeamFolderPolicyTest.php index 4cc85fc93..f4585c44b 100644 --- a/tests/unit/lib/Service/TeamFolderPolicyTest.php +++ b/tests/unit/lib/Service/TeamFolderPolicyTest.php @@ -19,8 +19,6 @@ class TeamFolderPolicyTest extends TestCase { private IAppConfig&MockObject $appConfig; protected function setUp(): void { - parent::setUp(); - $this->appConfig = $this->createMock(IAppConfig::class); $this->service = new TeamFolderPolicy( @@ -96,9 +94,7 @@ public function testGetDefaultQuota(): void { private function createCircle(int $config = Circle::CFG_CIRCLE): Circle&MockObject { $circle = $this->createMock(Circle::class); $circle->method('isConfig') - ->willReturnCallback(function (int $flag) use ($config): bool { - return ($config & $flag) === $flag; - }); + ->willReturnCallback(fn (int $flag): bool => ($config & $flag) === $flag); return $circle; } diff --git a/tests/unit/lib/ShareByCircleProviderTest.php b/tests/unit/lib/ShareByCircleProviderTest.php index 3d7c653fc..b80a95284 100644 --- a/tests/unit/lib/ShareByCircleProviderTest.php +++ b/tests/unit/lib/ShareByCircleProviderTest.php @@ -33,8 +33,6 @@ class ShareByCircleProviderTest extends TestCase { private FederatedUserService&MockObject $federatedUserService; protected function setUp(): void { - parent::setUp(); - $this->shareWrapperService = $this->createMock(ShareWrapperService::class); $this->federatedUserService = $this->createMock(FederatedUserService::class);