diff --git a/appinfo/routes.php b/appinfo/routes.php index bed52e0c..8b76844d 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -1,4 +1,5 @@ =7.2" }, "provide": { @@ -3382,8 +3439,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3418,7 +3475,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -3434,20 +3491,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", "shasum": "" }, "require": { @@ -3460,12 +3517,12 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" } }, "autoload": { @@ -3501,7 +3558,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" }, "funding": [ { @@ -3517,20 +3574,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2025-04-25T09:37:31+00:00" }, { "name": "symfony/string", - "version": "v6.4.11", + "version": "v6.4.21", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "5bc3eb632cf9c8dbfd6529d89be9950d1518883b" + "reference": "73e2c6966a5aef1d4892873ed5322245295370c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/5bc3eb632cf9c8dbfd6529d89be9950d1518883b", - "reference": "5bc3eb632cf9c8dbfd6529d89be9950d1518883b", + "url": "https://api.github.com/repos/symfony/string/zipball/73e2c6966a5aef1d4892873ed5322245295370c6", + "reference": "73e2c6966a5aef1d4892873ed5322245295370c6", "shasum": "" }, "require": { @@ -3587,7 +3644,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.11" + "source": "https://github.com/symfony/string/tree/v6.4.21" }, "funding": [ { @@ -3603,7 +3660,7 @@ "type": "tidelift" } ], - "time": "2024-08-12T09:55:28+00:00" + "time": "2025-04-18T15:23:29+00:00" }, { "name": "theseer/tokenizer", @@ -3836,5 +3893,5 @@ "platform-overrides": { "php": "8.1" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/lib/Command/Test.php b/lib/Command/Test.php index c35c8b76..d125ea90 100644 --- a/lib/Command/Test.php +++ b/lib/Command/Test.php @@ -48,7 +48,7 @@ public function __construct( IUserManager $userManager, IConfig $config, RelatedService $relatedService, - ICacheFactory $cacheFactory + ICacheFactory $cacheFactory, ) { $this->config = $config; parent::__construct(); @@ -102,7 +102,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int try { /** @var CirclesManager $circleManager */ $circleManager = Server::get(CirclesManager::class); - } catch (ContainerExceptionInterface | AutoloadNotAllowedException $e) { + } catch (ContainerExceptionInterface|AutoloadNotAllowedException $e) { throw new Exception('Circles needs to be enabled'); } diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index e2fbd0f3..9294289f 100755 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -44,7 +44,7 @@ public function __construct( LoggerInterface $logger, IUserSession $userSession, RelatedService $relatedService, - ConfigService $configService + ConfigService $configService, ) { parent::__construct($appName, $request); @@ -54,7 +54,7 @@ public function __construct( $this->configService = $configService; try { $this->circlesManager = Server::get(CirclesManager::class); - } catch (ContainerExceptionInterface | AutoloadNotAllowedException $e) { + } catch (ContainerExceptionInterface|AutoloadNotAllowedException $e) { } } @@ -72,7 +72,7 @@ public function getRelatedResources( string $providerId, string $itemId, int $limit = 0, - string $resourceType = '' + string $resourceType = '', ): DataResponse { if (is_null($this->circlesManager)) { $this->logger->info('RelatedResources require Circles'); diff --git a/lib/Db/CalendarShareRequestBuilder.php b/lib/Db/CalendarShareRequestBuilder.php index eaa8f85d..4797fbf9 100644 --- a/lib/Db/CalendarShareRequestBuilder.php +++ b/lib/Db/CalendarShareRequestBuilder.php @@ -46,7 +46,7 @@ public function getCalendarFromRequest(CoreRequestBuilder $qb): Calendar { /** @var Calendar $calendar */ try { $calendar = $qb->asItem(Calendar::class); - } catch (InvalidItemException | RowNotFoundException $e) { + } catch (InvalidItemException|RowNotFoundException $e) { throw new CalendarDataNotFoundException(); } diff --git a/lib/Db/DeckRequestBuilder.php b/lib/Db/DeckRequestBuilder.php index 1c959328..0ce454cd 100644 --- a/lib/Db/DeckRequestBuilder.php +++ b/lib/Db/DeckRequestBuilder.php @@ -43,7 +43,7 @@ public function getDeckFromRequest(CoreRequestBuilder $qb): DeckBoard { /** @var DeckBoard $deck */ try { $deck = $qb->asItem(DeckBoard::class); - } catch (InvalidItemException | RowNotFoundException $e) { + } catch (InvalidItemException|RowNotFoundException $e) { throw new DeckDataNotFoundException(); } diff --git a/lib/Db/FilesShareRequestBuilder.php b/lib/Db/FilesShareRequestBuilder.php index 0b856783..0c1b1a21 100644 --- a/lib/Db/FilesShareRequestBuilder.php +++ b/lib/Db/FilesShareRequestBuilder.php @@ -38,7 +38,7 @@ public function getItemFromRequest(CoreRequestBuilder $qb): FilesShare { /** @var FilesShare $share */ try { $share = $qb->asItem(FilesShare::class); - } catch (InvalidItemException | RowNotFoundException $e) { + } catch (InvalidItemException|RowNotFoundException $e) { throw new FilesShareNotFoundException(); } diff --git a/lib/Db/TalkRoomRequestBuilder.php b/lib/Db/TalkRoomRequestBuilder.php index 34f92776..4299cb5e 100644 --- a/lib/Db/TalkRoomRequestBuilder.php +++ b/lib/Db/TalkRoomRequestBuilder.php @@ -47,7 +47,7 @@ public function getRoomFromRequest(CoreRequestBuilder $qb): TalkRoom { /** @var TalkRoom $room */ try { $room = $qb->asItem(TalkRoom::class); - } catch (InvalidItemException | RowNotFoundException $e) { + } catch (InvalidItemException|RowNotFoundException $e) { throw new TalkDataNotFoundException(); } diff --git a/lib/Listener/FileShareUpdate.php b/lib/Listener/FileShareUpdate.php index e26dee6e..2386a2cd 100644 --- a/lib/Listener/FileShareUpdate.php +++ b/lib/Listener/FileShareUpdate.php @@ -23,7 +23,7 @@ class FileShareUpdate implements IEventListener { private RelatedService $relatedService; public function __construct( - RelatedService $relatedService + RelatedService $relatedService, ) { $this->relatedService = $relatedService; } diff --git a/lib/Model/Calendar.php b/lib/Model/Calendar.php index 985fe2af..5e27f882 100644 --- a/lib/Model/Calendar.php +++ b/lib/Model/Calendar.php @@ -72,9 +72,9 @@ public function getCalendarUri(): string { public function importFromDatabase(array $data): IQueryRow { $this->setCalendarId($this->getInt('id', $data)) - ->setCalendarName($this->get('displayname', $data)) - ->setCalendarPrincipalUri($this->get('principaluri', $data)) - ->setCalendarUri($this->get('uri', $data)); + ->setCalendarName($this->get('displayname', $data)) + ->setCalendarPrincipalUri($this->get('principaluri', $data)) + ->setCalendarUri($this->get('uri', $data)); return $this; } diff --git a/lib/Model/CalendarShare.php b/lib/Model/CalendarShare.php index 29b706bd..259de345 100644 --- a/lib/Model/CalendarShare.php +++ b/lib/Model/CalendarShare.php @@ -86,7 +86,7 @@ public function getUser(): string { public function importFromDatabase(array $data): IQueryRow { $this->setCalendarId($this->getInt('resourceid', $data)) - ->setSharePrincipalUri($this->get('principaluri', $data)); + ->setSharePrincipalUri($this->get('principaluri', $data)); return $this; } diff --git a/lib/Model/DeckBoard.php b/lib/Model/DeckBoard.php index 785dfcc9..38d163ec 100644 --- a/lib/Model/DeckBoard.php +++ b/lib/Model/DeckBoard.php @@ -108,9 +108,9 @@ public function getLastModified(): int { */ public function importFromDatabase(array $data): IQueryRow { $this->setBoardId($this->getInt('id', $data)) - ->setBoardName($this->get('title', $data)) - ->setOwner($this->get('owner', $data)) - ->setLastModified($this->getInt('last_modified', $data)); + ->setBoardName($this->get('title', $data)) + ->setOwner($this->get('owner', $data)) + ->setLastModified($this->getInt('last_modified', $data)); return $this; } diff --git a/lib/Model/DeckShare.php b/lib/Model/DeckShare.php index 364342cb..d9c094bc 100644 --- a/lib/Model/DeckShare.php +++ b/lib/Model/DeckShare.php @@ -91,8 +91,8 @@ public function getRecipientId(): string { */ public function importFromDatabase(array $data): IQueryRow { $this->setBoardId($this->getInt('board_id', $data)) - ->setRecipientType($this->getInt('type', $data)) - ->setRecipientId($this->get('participant', $data)); + ->setRecipientType($this->getInt('type', $data)) + ->setRecipientId($this->get('participant', $data)); return $this; } diff --git a/lib/Model/FilesShare.php b/lib/Model/FilesShare.php index 10fa7918..fc530ec0 100644 --- a/lib/Model/FilesShare.php +++ b/lib/Model/FilesShare.php @@ -125,12 +125,12 @@ public function getShareCreator(): string { public function importFromDatabase(array $data): IQueryRow { $this->setShareType($this->getInt('share_type', $data)) - ->setSharedWith($this->get('share_with', $data)) - ->setShareCreator($this->get('uid_initiator', $data)) - ->setFileId($this->getInt('file_source', $data)) - ->setFileOwner($this->get('uid_owner', $data)) - ->setFileTarget($this->get('file_target', $data)) - ->setShareTime($this->getInt('stime', $data)); + ->setSharedWith($this->get('share_with', $data)) + ->setShareCreator($this->get('uid_initiator', $data)) + ->setFileId($this->getInt('file_source', $data)) + ->setFileOwner($this->get('uid_owner', $data)) + ->setFileTarget($this->get('file_target', $data)) + ->setShareTime($this->getInt('stime', $data)); return $this; } diff --git a/lib/Model/RelatedResource.php b/lib/Model/RelatedResource.php index 1cfe2f85..68c63059 100644 --- a/lib/Model/RelatedResource.php +++ b/lib/Model/RelatedResource.php @@ -146,7 +146,7 @@ public function getUrl(): string { public function improve( float $quality, string $type, - bool $diminishingReturn = true + bool $diminishingReturn = true, ): IRelatedResource { $quality = ($this->currentQuality[$type] ?? $quality); $this->score = $this->score * $quality; diff --git a/lib/Model/TalkActor.php b/lib/Model/TalkActor.php index 923eb044..3bfd6f90 100644 --- a/lib/Model/TalkActor.php +++ b/lib/Model/TalkActor.php @@ -68,7 +68,7 @@ public function getActorId(): string { */ public function importFromDatabase(array $data): IQueryRow { $this->setActorType($this->get('actor_type', $data)) - ->setActorId($this->get('actor_id', $data)); + ->setActorId($this->get('actor_id', $data)); return $this; } diff --git a/lib/Model/TalkRoom.php b/lib/Model/TalkRoom.php index d8220faf..e655dac4 100644 --- a/lib/Model/TalkRoom.php +++ b/lib/Model/TalkRoom.php @@ -107,9 +107,9 @@ public function getToken(): string { */ public function importFromDatabase(array $data): IQueryRow { $this->setRoomId($this->getInt('id', $data)) - ->setRoomName($this->get('name', $data)) - ->setRoomType($this->getInt('type', $data)) - ->setToken($this->get('token', $data)); + ->setRoomName($this->get('name', $data)) + ->setRoomType($this->getInt('type', $data)) + ->setToken($this->get('token', $data)); return $this; } diff --git a/lib/RelatedResourceProviders/CalendarRelatedResourceProvider.php b/lib/RelatedResourceProviders/CalendarRelatedResourceProvider.php index 76d5af5d..cb3fdafd 100644 --- a/lib/RelatedResourceProviders/CalendarRelatedResourceProvider.php +++ b/lib/RelatedResourceProviders/CalendarRelatedResourceProvider.php @@ -38,7 +38,7 @@ class CalendarRelatedResourceProvider implements IRelatedResourceProvider { public function __construct( IURLGenerator $urlGenerator, IL10N $l10n, - CalendarShareRequest $calendarShareRequest + CalendarShareRequest $calendarShareRequest, ) { $this->urlGenerator = $urlGenerator; $this->l10n = $l10n; @@ -134,17 +134,17 @@ private function convertToRelatedResource(Calendar $calendar): IRelatedResource } $related->setTitle($calendar->getCalendarName()) - ->setSubtitle($this->l10n->t('Calendar')) - ->setTooltip($this->l10n->t('Calendar "%s"', $calendar->getCalendarName())) - ->setIcon( - $this->urlGenerator->getAbsoluteURL( - $this->urlGenerator->imagePath( - 'calendar', - 'calendar.svg' - ) + ->setSubtitle($this->l10n->t('Calendar')) + ->setTooltip($this->l10n->t('Calendar "%s"', $calendar->getCalendarName())) + ->setIcon( + $this->urlGenerator->getAbsoluteURL( + $this->urlGenerator->imagePath( + 'calendar', + 'calendar.svg' ) ) - ->setUrl($url); + ) + ->setUrl($url); $keywords = preg_split( '/[\/_\-. ]/', @@ -173,7 +173,7 @@ private function processCalendarShare( $related->addToVirtualGroup($participant->getSingleId()); } else { $related->addRecipient($participant->getSingleId()) - ->setAsGroupShared(); + ->setAsGroupShared(); } } catch (Exception $e) { } @@ -200,6 +200,6 @@ private function completeShareDetails(CalendarShare $share): void { } $share->setType($type) - ->setUser($user); + ->setUser($user); } } diff --git a/lib/RelatedResourceProviders/DeckRelatedResourceProvider.php b/lib/RelatedResourceProviders/DeckRelatedResourceProvider.php index e396483d..992aca58 100644 --- a/lib/RelatedResourceProviders/DeckRelatedResourceProvider.php +++ b/lib/RelatedResourceProviders/DeckRelatedResourceProvider.php @@ -39,7 +39,7 @@ class DeckRelatedResourceProvider implements IRelatedResourceProvider { public function __construct( IUrlGenerator $urlGenerator, IL10N $l10n, - DeckRequest $deckSharesRequest + DeckRequest $deckSharesRequest, ) { $this->urlGenerator = $urlGenerator; $this->l10n = $l10n; @@ -112,25 +112,25 @@ public function improveRelatedResource(CirclesManager $circlesManager, IRelatedR private function convertToRelatedResource(DeckBoard $board): IRelatedResource { $url = ''; try { - $url = - $this->urlGenerator->linkToRouteAbsolute('deck.page.index') + $url + = $this->urlGenerator->linkToRouteAbsolute('deck.page.index') . '#/board/' . $board->getBoardId(); } catch (Exception $e) { } $related = new RelatedResource(self::PROVIDER_ID, (string)$board->getBoardId()); $related->setTitle($board->getBoardName()) - ->setSubtitle($this->l10n->t('Deck')) - ->setTooltip($this->l10n->t('Deck board "%s"', $board->getBoardName())) - ->setIcon( - $this->urlGenerator->getAbsoluteURL( - $this->urlGenerator->imagePath( - 'deck', - 'deck.svg' - ) + ->setSubtitle($this->l10n->t('Deck')) + ->setTooltip($this->l10n->t('Deck board "%s"', $board->getBoardName())) + ->setIcon( + $this->urlGenerator->getAbsoluteURL( + $this->urlGenerator->imagePath( + 'deck', + 'deck.svg' ) ) - ->setUrl($url); + ) + ->setUrl($url); $related->setMetaInt(RelatedResource::ITEM_LAST_UPDATE, $board->getLastModified()); @@ -150,7 +150,7 @@ private function convertToRelatedResource(DeckBoard $board): IRelatedResource { private function processDeckShare( CirclesManager $circlesManager, RelatedResource $related, - DeckShare $share + DeckShare $share, ) { try { $participant = $this->convertDeckShare($circlesManager, $share); @@ -158,7 +158,7 @@ private function processDeckShare( $related->addToVirtualGroup($participant->getSingleId()); } else { $related->addRecipient($participant->getSingleId()) - ->setAsGroupShared(); + ->setAsGroupShared(); } } catch (Exception $e) { } diff --git a/lib/RelatedResourceProviders/FilesRelatedResourceProvider.php b/lib/RelatedResourceProviders/FilesRelatedResourceProvider.php index a5762f8e..5ef4743a 100644 --- a/lib/RelatedResourceProviders/FilesRelatedResourceProvider.php +++ b/lib/RelatedResourceProviders/FilesRelatedResourceProvider.php @@ -125,7 +125,7 @@ public function improveRelatedResource(CirclesManager $circlesManager, IRelatedR } $paths = $this->rootFolder->getUserFolder($current->getUserId()) - ->getById((int)$entry->getItemId()); + ->getById((int)$entry->getItemId()); if (sizeof($paths) > 0) { $entry->setTitle($paths[0]->getName()); @@ -180,7 +180,7 @@ private function convertToRelatedResource(FilesShare $share): IRelatedResource { private function managerGroupFolders( CirclesManager $circlesManager, ?IRelatedResource $related, - array $itemEntries + array $itemEntries, ): ?IRelatedResource { foreach ($itemEntries as $entry) { if (($entry['type'] ?? '') !== 'groupfolder') { @@ -223,7 +223,7 @@ private function getItemIdsFromParentPath(CirclesManager $circlesManager, int $i } $paths = $this->rootFolder->getUserFolder($current->getUserId()) - ->getById($itemId); + ->getById($itemId); $itemEntries = []; foreach ($paths as $path) { @@ -256,7 +256,7 @@ private function getItemIdsFromParentPath(CirclesManager $circlesManager, int $i private function processShareRecipient( CirclesManager $circlesManager, RelatedResource $related, - FilesShare $share + FilesShare $share, ) { try { $sharedWith = $this->convertShareRecipient( @@ -280,7 +280,7 @@ private function processShareRecipient( ); } else { $related->addRecipient($sharedWith->getSingleId()) - ->setAsGroupShared(); + ->setAsGroupShared(); } } catch (Exception $e) { } @@ -297,7 +297,7 @@ private function processShareRecipient( private function convertShareRecipient( CirclesManager $circlesManager, int $shareType, - string $sharedWith + string $sharedWith, ): FederatedUser { $type = match ($shareType) { IShare::TYPE_USER => Member::TYPE_USER, diff --git a/lib/RelatedResourceProviders/GroupFoldersRelatedResourceProvider.php b/lib/RelatedResourceProviders/GroupFoldersRelatedResourceProvider.php index 8c69c8e7..2c28c785 100644 --- a/lib/RelatedResourceProviders/GroupFoldersRelatedResourceProvider.php +++ b/lib/RelatedResourceProviders/GroupFoldersRelatedResourceProvider.php @@ -144,7 +144,7 @@ public function convertToRelatedResource(array $folderData): IRelatedResource { public function processApplicableMap( CirclesManager $circlesManager, RelatedResource $related, - array $applicableMap + array $applicableMap, ): void { foreach ($applicableMap as $k => $entry) { $entityId = ''; @@ -156,7 +156,7 @@ public function processApplicableMap( } $related->addRecipient($entityId) - ->setAsGroupShared(); + ->setAsGroupShared(); } } diff --git a/lib/RelatedResourceProviders/TalkRelatedResourceProvider.php b/lib/RelatedResourceProviders/TalkRelatedResourceProvider.php index 43b149f5..47c57bbd 100644 --- a/lib/RelatedResourceProviders/TalkRelatedResourceProvider.php +++ b/lib/RelatedResourceProviders/TalkRelatedResourceProvider.php @@ -37,7 +37,7 @@ public function __construct( private IURLGenerator $urlGenerator, private IL10N $l10n, private TalkRoomRequest $talkRoomRequest, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } @@ -78,7 +78,7 @@ public function getRelatedFromItem(CirclesManager $circlesManager, string $itemI if ($countActor === 2 && $room->getRoomType() === \OCA\Talk\Room::TYPE_ONE_TO_ONE) { $related->setTitle($this->l10n->t('Talk conversation')) - ->setMetaArray('1on1', json_decode($room->getRoomName())); + ->setMetaArray('1on1', json_decode($room->getRoomName())); } } @@ -149,16 +149,16 @@ private function convertToRelatedResource(TalkRoom $share): IRelatedResource { } $related = new RelatedResource(self::PROVIDER_ID, $share->getToken()); $related->setTitle($share->getRoomName()) - ->setSubtitle($this->l10n->t('Talk')) - ->setTooltip($this->l10n->t('Talk conversation "%s"', $share->getRoomName())) - ->setIcon( - $this->urlGenerator->getAbsoluteURL( - $this->urlGenerator->imagePath( - 'spreed', - 'app.svg' - ) + ->setSubtitle($this->l10n->t('Talk')) + ->setTooltip($this->l10n->t('Talk conversation "%s"', $share->getRoomName())) + ->setIcon( + $this->urlGenerator->getAbsoluteURL( + $this->urlGenerator->imagePath( + 'spreed', + 'app.svg' ) ) + ) ->setPreview( $this->urlGenerator->linkToOCSRouteAbsolute( 'spreed.Avatar.getAvatar', @@ -183,7 +183,7 @@ private function convertToRelatedResource(TalkRoom $share): IRelatedResource { private function processRoomParticipant( CirclesManager $circlesManager, RelatedResource $related, - TalkActor $actor + TalkActor $actor, ) { try { $participant = $this->convertRoomParticipant($circlesManager, $actor); @@ -191,7 +191,7 @@ private function processRoomParticipant( $related->addToVirtualGroup($participant->getSingleId()); } else { $related->addRecipient($participant->getSingleId()) - ->setAsGroupShared(); + ->setAsGroupShared(); } } catch (Exception $e) { } diff --git a/lib/Service/RelatedService.php b/lib/Service/RelatedService.php index c3e57965..a92e002d 100644 --- a/lib/Service/RelatedService.php +++ b/lib/Service/RelatedService.php @@ -71,7 +71,7 @@ public function __construct( IAppManager $appManager, ICacheFactory $cacheFactory, LoggerInterface $logger, - ConfigService $configService + ConfigService $configService, ) { $this->appManager = $appManager; $this->cache = $cacheFactory->createDistributed(self::CACHE_RELATED); @@ -80,7 +80,7 @@ public function __construct( try { $this->circlesManager = Server::get(CirclesManager::class); - } catch (ContainerExceptionInterface | AutoloadNotAllowedException $e) { + } catch (ContainerExceptionInterface|AutoloadNotAllowedException $e) { $this->logger->notice($e->getMessage()); } } @@ -98,7 +98,7 @@ public function getRelatedToItem( string $providerId, string $itemId, int $chunk = -1, - string $resourceType = '' + string $resourceType = '', ): array { if ($this->circlesManager === null) { return []; @@ -129,7 +129,7 @@ public function getRelatedToItem( private function retrieveRelatedToItem( string $providerId, string $itemId, - string $resourceType = '' + string $resourceType = '', ): array { $this->logger->debug('retrieving related to item ' . $providerId . '.' . $itemId); @@ -233,7 +233,7 @@ public function getRelatedFromItem(string $providerId, string $itemId): RelatedR } $result = $this->getRelatedResourceProvider($providerId) - ->getRelatedFromItem($this->circlesManager, $itemId); + ->getRelatedFromItem($this->circlesManager, $itemId); $this->logger->debug('get related to ' . $providerId . '.' . $itemId . ' - ' . json_encode($result)); @@ -256,7 +256,7 @@ public function getRelatedFromItem(string $providerId, string $itemId): RelatedR */ private function getCachedRelatedFromItem( string $providerId, - string $itemId + string $itemId, ): RelatedResource { $key = $this->generateRelatedFromItemCacheKey($providerId, $itemId); $cachedData = $this->cache->get($key); @@ -287,7 +287,7 @@ private function getCachedRelatedFromItem( private function cacheRelatedFromItem( string $providerId, string $itemId, - RelatedResource $related + RelatedResource $related, ): void { $this->logger->debug( 'caching related from ' . $providerId . '.' . $itemId . ' - ' . json_encode($related) @@ -305,7 +305,7 @@ private function cacheRelatedFromItem( */ private function generateRelatedFromItemCacheKey( string $providerId, - string $itemId + string $itemId, ): string { return 'relatedFromItem/' . $providerId . '::' . $itemId; } @@ -319,7 +319,7 @@ private function generateRelatedFromItemCacheKey( */ private function getItemsAvailableToEntity( IRelatedResourceProvider $provider, - FederatedUser $entity + FederatedUser $entity, ): array { try { return $this->getCachedItemsAvailableToEntity($provider->getProviderId(), $entity->getSingleId()); @@ -346,7 +346,7 @@ private function getItemsAvailableToEntity( */ private function getCachedItemsAvailableToEntity( string $providerId, - string $singleId + string $singleId, ): array { $key = $this->generateItemsAvailableToEntityCacheKey($providerId, $singleId); $cachedData = $this->cache->get($key); @@ -376,7 +376,7 @@ private function getCachedItemsAvailableToEntity( private function cacheItemsAvailableToEntity( string $providerId, string $singleId, - array $result + array $result, ): void { $this->logger->debug( 'caching available items to ' . $singleId . ' from ' . $providerId . ' - ' . json_encode($result) @@ -394,7 +394,7 @@ private function cacheItemsAvailableToEntity( */ private function generateItemsAvailableToEntityCacheKey( string $providerId, - string $singleId + string $singleId, ): string { return 'availableItem/' . $providerId . '::' . $singleId; } @@ -476,7 +476,7 @@ private function filterUnavailableResults(array $result): array { private function improveResult(array $result): array { foreach ($result as $entry) { $this->getRelatedResourceProvider($entry->getProviderId()) - ->improveRelatedResource($this->circlesManager, $entry); + ->improveRelatedResource($this->circlesManager, $entry); } return $result; @@ -516,7 +516,7 @@ private function getWeightCalculators(): array { } $this->weightCalculators[] = Server::get($class); - } catch (NotFoundExceptionInterface | ContainerExceptionInterface | ReflectionException $e) { + } catch (NotFoundExceptionInterface|ContainerExceptionInterface|ReflectionException $e) { $this->logger->notice($e->getMessage()); } } @@ -548,7 +548,7 @@ private function getRelatedResourceProviders(): array { if ($this->appManager->isInstalled('deck')) { try { $providers[] = Server::get(DeckRelatedResourceProvider::class); - } catch (NotFoundExceptionInterface | ContainerExceptionInterface $e) { + } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) { $this->logger->notice($e->getMessage()); } } @@ -556,7 +556,7 @@ private function getRelatedResourceProviders(): array { if ($this->appManager->isInstalled('calendar')) { try { $providers[] = Server::get(CalendarRelatedResourceProvider::class); - } catch (NotFoundExceptionInterface | ContainerExceptionInterface $e) { + } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) { $this->logger->notice($e->getMessage()); } } @@ -564,7 +564,7 @@ private function getRelatedResourceProviders(): array { if ($this->appManager->isInstalled('spreed')) { try { $providers[] = Server::get(TalkRelatedResourceProvider::class); - } catch (NotFoundExceptionInterface | ContainerExceptionInterface $e) { + } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) { $this->logger->notice($e->getMessage()); } } @@ -572,7 +572,7 @@ private function getRelatedResourceProviders(): array { if ($this->appManager->isInstalled('groupfolders')) { try { $providers[] = Server::get(GroupFoldersRelatedResourceProvider::class); - } catch (NotFoundExceptionInterface | ContainerExceptionInterface $e) { + } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) { $this->logger->notice($e->getMessage()); } } diff --git a/lib/Tools/Db/ExtendedQueryBuilder.php b/lib/Tools/Db/ExtendedQueryBuilder.php index d36aaa84..4dbd4d05 100644 --- a/lib/Tools/Db/ExtendedQueryBuilder.php +++ b/lib/Tools/Db/ExtendedQueryBuilder.php @@ -447,7 +447,7 @@ public function exprLimitBool(string $field, bool $value, string $alias = ''): s public function exprLimitEmpty( string $field, bool $orNull = false, - string $alias = '' + string $alias = '', ): ICompositeExpression { if ($this->getType() === DBALQueryBuilder::SELECT) { $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; @@ -473,7 +473,7 @@ public function exprLimitEmpty( public function exprLimitNull( string $field, bool $orEmpty = false, - string $alias = '' + string $alias = '', ): ICompositeExpression { if ($this->getType() === DBALQueryBuilder::SELECT) { $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; @@ -502,7 +502,7 @@ public function exprLimitArray( string $field, array $values, string $alias = '', - bool $cs = true + bool $cs = true, ): ICompositeExpression { if ($this->getType() === DBALQueryBuilder::SELECT) { $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; @@ -789,7 +789,7 @@ public function exprFilterBool(string $field, bool $value, string $alias = ''): public function exprFilterEmpty( string $field, bool $norNull = false, - string $alias = '' + string $alias = '', ): ICompositeExpression { if ($this->getType() === DBALQueryBuilder::SELECT) { $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; @@ -815,7 +815,7 @@ public function exprFilterEmpty( public function exprFilterNull( string $field, bool $norEmpty = false, - string $alias = '' + string $alias = '', ): ICompositeExpression { if ($this->getType() === DBALQueryBuilder::SELECT) { $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; @@ -844,7 +844,7 @@ public function exprFilterArray( string $field, array $values, string $alias = '', - bool $cs = true + bool $cs = true, ): ICompositeExpression { if ($this->getType() === DBALQueryBuilder::SELECT) { $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; @@ -965,7 +965,7 @@ private function parseSimpleSelectSql( array $data, ExtendedQueryBuilder $qb, string $object, - array $params + array $params, ): IQueryRow { $fromField = $this->get('modelFromField', $params); if ($fromField !== '') { @@ -1048,7 +1048,7 @@ public function getRows(callable $method, string $object = '', array $params = [ public function generateSelect( string $table, array $fields, - string $alias = '' + string $alias = '', ): self { if ($alias === '') { $alias = $table; @@ -1061,8 +1061,8 @@ function (string $item) use ($alias) { ); $this->select($selectFields) - ->from($table, $alias) - ->setDefaultSelectAlias($alias); + ->from($table, $alias) + ->setDefaultSelectAlias($alias); return $this; } @@ -1080,7 +1080,7 @@ public function generateSelectAlias( array $fields, string $alias, string $prefix, - array $default = [] + array $default = [], ): self { $prefix = trim($prefix) . '_'; foreach ($default as $k => $v) { diff --git a/lib/Tools/Traits/TStringTools.php b/lib/Tools/Traits/TStringTools.php index a1e8c7b4..516b8cd3 100644 --- a/lib/Tools/Traits/TStringTools.php +++ b/lib/Tools/Traits/TStringTools.php @@ -184,7 +184,7 @@ public function getDateDiff( int $first, int $second = 0, bool $short = false, - array $words = [] + array $words = [], ): string { if ($second === 0) { $first = time() - $first; @@ -229,10 +229,10 @@ public function getDateDiff( } return $f->diff($s)->format( - '%a ' . $days . - ', %h ' . $hours . - ', %i ' . $minutes . - ' and %s ' . $seconds + '%a ' . $days + . ', %h ' . $hours + . ', %i ' . $minutes + . ' and %s ' . $seconds ); } }