Skip to content

Commit

Permalink
chore: Run cs:fix
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Sep 20, 2024
1 parent 5ed8077 commit 34594f9
Show file tree
Hide file tree
Showing 22 changed files with 64 additions and 60 deletions.
2 changes: 1 addition & 1 deletion lib/AugmentedTemplateResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class AugmentedTemplateResponse extends TemplateResponse {
public function render() {
$return = parent::render();
preg_replace('/<link rel="manifest" href="(.*?)">/i', '<link rel="manifest" href="'. OC::$server->getURLGenerator()->linkToRouteAbsolute('bookmarks.web_view.manifest').'">', $return);
preg_replace('/<link rel="manifest" href="(.*?)">/i', '<link rel="manifest" href="' . OC::$server->getURLGenerator()->linkToRouteAbsolute('bookmarks.web_view.manifest') . '">', $return);
return $return;
}
}
4 changes: 2 additions & 2 deletions lib/BackgroundJobs/BackupJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class BackupJob extends TimedJob {
private IUserSession $session;

public function __construct(
BookmarkMapper $bookmarkMapper, ITimeFactory $timeFactory, IUserManager $userManager, BackupManager $backupManager, LoggerInterface $logger, IConfig $config, IUserSession $session
BookmarkMapper $bookmarkMapper, ITimeFactory $timeFactory, IUserManager $userManager, BackupManager $backupManager, LoggerInterface $logger, IConfig $config, IUserSession $session,
) {
parent::__construct($timeFactory);
$this->bookmarkMapper = $bookmarkMapper;
Expand Down Expand Up @@ -71,7 +71,7 @@ protected function run($argument) {
$this->backupManager->runBackup($userId);
$this->backupManager->cleanupOldBackups($userId);
} catch (\Exception $e) {
$this->logger->error('Bookmarks backup for user '.$userId.' errored');
$this->logger->error('Bookmarks backup for user ' . $userId . ' errored');
$this->logger->error($e->getMessage());
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/BackgroundJobs/CrawlJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CrawlJob extends TimedJob {
private $crawler;

public function __construct(
IConfig $settings, BookmarkMapper $bookmarkMapper, CrawlService $crawler, ITimeFactory $timeFactory
IConfig $settings, BookmarkMapper $bookmarkMapper, CrawlService $crawler, ITimeFactory $timeFactory,
) {
parent::__construct($timeFactory);
$this->settings = $settings;
Expand Down
4 changes: 2 additions & 2 deletions lib/BackgroundJobs/FileCacheGCJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class FileCacheGCJob extends TimedJob {
private $logger;

public function __construct(
FileCache $fileCache, LoggerInterface $logger, ITimeFactory $timeFactory
FileCache $fileCache, LoggerInterface $logger, ITimeFactory $timeFactory,
) {
parent::__construct($timeFactory);
$this->setInterval(self::INTERVAL);
Expand All @@ -38,7 +38,7 @@ protected function run($argument) : void {
try {
$this->fileCache->gc();
} catch (NotPermittedException $e) {
$this->logger->error('Could not collect garbage: '.$e->getMessage());
$this->logger->error('Could not collect garbage: ' . $e->getMessage());
}
}
}
2 changes: 1 addition & 1 deletion lib/BackgroundJobs/IndividualCrawlJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class IndividualCrawlJob extends Job {
private $jobList;

public function __construct(
IConfig $settings, BookmarkMapper $bookmarkMapper, CrawlService $crawler, ITimeFactory $timeFactory, IJobList $jobList
IConfig $settings, BookmarkMapper $bookmarkMapper, CrawlService $crawler, ITimeFactory $timeFactory, IJobList $jobList,
) {
parent::__construct($timeFactory);
$this->settings = $settings;
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/BookmarkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class BookmarkController extends ApiController {
private $lockManager;

public function __construct(
$appName, $request, IL10N $l10n, BookmarkMapper $bookmarkMapper, TagMapper $tagMapper, FolderMapper $folderMapper, TreeMapper $treeMapper, PublicFolderMapper $publicFolderMapper, ITimeFactory $timeFactory, LoggerInterface $logger, IURLGenerator $url, HtmlExporter $htmlExporter, Authorizer $authorizer, BookmarkService $bookmarks, FolderService $folders, IRootFolder $rootFolder, \OCA\Bookmarks\Service\LockManager $lockManager
$appName, $request, IL10N $l10n, BookmarkMapper $bookmarkMapper, TagMapper $tagMapper, FolderMapper $folderMapper, TreeMapper $treeMapper, PublicFolderMapper $publicFolderMapper, ITimeFactory $timeFactory, LoggerInterface $logger, IURLGenerator $url, HtmlExporter $htmlExporter, Authorizer $authorizer, BookmarkService $bookmarks, FolderService $folders, IRootFolder $rootFolder, \OCA\Bookmarks\Service\LockManager $lockManager,
) {
parent::__construct($appName, $request);
$this->request = $request;
Expand Down Expand Up @@ -198,7 +198,7 @@ private function _getRootFolderId(): ?int {
$publicFolder = $this->publicFolderMapper->find($this->authorizer->getToken());
$this->rootFolderId = $publicFolder->getFolderId();
} catch (DoesNotExistException|MultipleObjectsReturnedException $e) {
$this->logger->error($e->getMessage()."\n".$e->getMessage());
$this->logger->error($e->getMessage() . "\n" . $e->getMessage());
}
}
return $this->rootFolderId;
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/FoldersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private function _getRootFolderId(): ?int {
$publicFolder = $this->publicFolderMapper->find($this->authorizer->getToken());
$this->rootFolderId = $publicFolder->getFolderId();
} catch (DoesNotExistException|MultipleObjectsReturnedException $e) {
$this->logger->error($e->getMessage()."\n".$e->getMessage());
$this->logger->error($e->getMessage() . "\n" . $e->getMessage());
}
}
return $this->rootFolderId;
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/InternalBookmarkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class InternalBookmarkController extends ApiController {
private $bookmarks;

public function __construct(
$appName, $request, $userId, BookmarkController $publicController, BookmarkService $bookmarks, Authorizer $authorizer
$appName, $request, $userId, BookmarkController $publicController, BookmarkService $bookmarks, Authorizer $authorizer,
) {
parent::__construct($appName, $request);
$this->publicController = $publicController;
Expand Down
3 changes: 2 additions & 1 deletion lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class SettingsController extends ApiController {
* @param UserSettingsService $userSettingsService
*/
public function __construct(
$appName, $request,
$appName,
$request,
private UserSettingsService $userSettingsService,
) {
parent::__construct($appName, $request);
Expand Down
5 changes: 3 additions & 2 deletions lib/Controller/WebViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public function __construct(
private \OCA\Bookmarks\Controller\InternalFoldersController $folderController,
private \OCA\Bookmarks\Controller\InternalBookmarkController $bookmarkController,
private \OCA\Bookmarks\Controller\InternalTagsController $tagsController,
private UserSettingsService $userSettingsService) {
private UserSettingsService $userSettingsService,
) {
parent::__construct($appName, $request);
$this->userId = $userId;
}
Expand Down Expand Up @@ -147,7 +148,7 @@ public function link(string $token) {
* @return StreamResponse
*/
public function serviceWorker(): StreamResponse {
$response = new StreamResponse(__DIR__.'/../../js/bookmarks-service-worker.js');
$response = new StreamResponse(__DIR__ . '/../../js/bookmarks-service-worker.js');
$response->setHeaders(['Content-Type' => 'application/javascript']);
$policy = new ContentSecurityPolicy();
$policy->addAllowedWorkerSrcDomain("'self'");
Expand Down
40 changes: 20 additions & 20 deletions lib/Db/BookmarkMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ protected function mapRowToEntity(array $row): Bookmark {
if ($hasTags !== false) {
return BookmarkWithTagsAndParent::fromRow($row);
}
return call_user_func($this->entityClass .'::fromRow', $row);
return call_user_func($this->entityClass . '::fromRow', $row);
}


Expand Down Expand Up @@ -264,9 +264,9 @@ private function _generateCTE(int $folderId, bool $withSoftDeleted) : array {
// The base case of the recursion is just the folder we're given
$baseCase = $this->db->getQueryBuilder();
$baseCase
->selectAlias($baseCase->createFunction($this->getDbType() === 'mysql'? 'cast('.$baseCase->createPositionalParameter($folderId, IQueryBuilder::PARAM_INT).' as UNSIGNED)' : 'cast('.$baseCase->createPositionalParameter($folderId, IQueryBuilder::PARAM_INT).' as BIGINT)'), 'item_id')
->selectAlias($baseCase->createFunction($this->getDbType() === 'mysql'? 'cast(' . $baseCase->createPositionalParameter($folderId, IQueryBuilder::PARAM_INT) . ' as UNSIGNED)' : 'cast(' . $baseCase->createPositionalParameter($folderId, IQueryBuilder::PARAM_INT) . ' as BIGINT)'), 'item_id')
->selectAlias($baseCase->createFunction($this->getDbType() === 'mysql'? 'cast(0 as UNSIGNED)' : 'cast(0 as BIGINT)'), 'parent_folder')
->selectAlias($baseCase->createFunction($this->getDbType() === 'mysql'? 'cast('.$baseCase->createPositionalParameter(TreeMapper::TYPE_FOLDER).' as CHAR(20))' : 'cast('.$baseCase->createPositionalParameter(TreeMapper::TYPE_FOLDER).' as TEXT)'), 'type')
->selectAlias($baseCase->createFunction($this->getDbType() === 'mysql'? 'cast(' . $baseCase->createPositionalParameter(TreeMapper::TYPE_FOLDER) . ' as CHAR(20))' : 'cast(' . $baseCase->createPositionalParameter(TreeMapper::TYPE_FOLDER) . ' as TEXT)'), 'type')
->selectAlias($baseCase->createFunction($this->getDbType() === 'mysql'? 'cast(0 as UNSIGNED)' : 'cast(0 as BIGINT)'), 'idx')
->selectAlias($baseCase->createFunction($this->getDbType() === 'mysql'? 'cast(NULL as DATETIME)' : 'cast(NULL as timestamp)'), 'soft_deleted_at');

Expand All @@ -280,7 +280,7 @@ private function _generateCTE(int $folderId, bool $withSoftDeleted) : array {
->selectAlias('tr.index', 'idx')
->selectAlias('tr.soft_deleted_at', 'soft_deleted_at')
->from('*PREFIX*bookmarks_tree', 'tr')
->join('tr', $this->getDbType() === 'mysql'? 'folder_tree' : 'inner_folder_tree', 'e', 'e.item_id = tr.parent_folder AND e.type = '.$recursiveCase->createPositionalParameter(TreeMapper::TYPE_FOLDER) . (!$withSoftDeleted ? ' AND e.soft_deleted_at is NULL' : ''));
->join('tr', $this->getDbType() === 'mysql'? 'folder_tree' : 'inner_folder_tree', 'e', 'e.item_id = tr.parent_folder AND e.type = ' . $recursiveCase->createPositionalParameter(TreeMapper::TYPE_FOLDER) . (!$withSoftDeleted ? ' AND e.soft_deleted_at is NULL' : ''));

// The second recursive case lists all children of shared folders we've already found
$recursiveCaseShares = $this->db->getQueryBuilder();
Expand All @@ -292,7 +292,7 @@ private function _generateCTE(int $folderId, bool $withSoftDeleted) : array {
->selectAlias('e.idx', 'idx')
->selectAlias('e.soft_deleted_at', 'soft_deleted_at')
->from(($this->getDbType() === 'mysql'? 'folder_tree' : 'second_folder_tree'), 'e')
->join('e', '*PREFIX*bookmarks_shared_folders', 's', 's.id = e.item_id AND e.type = '.$recursiveCaseShares->createPositionalParameter(TreeMapper::TYPE_SHARE) . (!$withSoftDeleted ? ' AND e.soft_deleted_at is NULL' : ''));
->join('e', '*PREFIX*bookmarks_shared_folders', 's', 's.id = e.item_id AND e.type = ' . $recursiveCaseShares->createPositionalParameter(TreeMapper::TYPE_SHARE) . (!$withSoftDeleted ? ' AND e.soft_deleted_at is NULL' : ''));

if ($this->getDbType() === 'mysql') {
// For mysql we can just throw these three queries together in a CTE
Expand Down Expand Up @@ -324,7 +324,7 @@ private function _generateCTE(int $folderId, bool $withSoftDeleted) : array {
->selectAlias('tr.index', 'idx')
->selectAlias('tr.soft_deleted_at', 'soft_deleted_at')
->from('*PREFIX*bookmarks_tree', 'tr')
->join('tr', 'folder_tree', 'e', 'e.item_id = tr.parent_folder AND e.type = '.$secondRecursiveCase->createPositionalParameter(TreeMapper::TYPE_FOLDER) . (!$withSoftDeleted ? ' AND e.soft_deleted_at is NULL' : ''));
->join('tr', 'folder_tree', 'e', 'e.item_id = tr.parent_folder AND e.type = ' . $secondRecursiveCase->createPositionalParameter(TreeMapper::TYPE_FOLDER) . (!$withSoftDeleted ? ' AND e.soft_deleted_at is NULL' : ''));

// First the base case together with the normal recurisve case
// Then the second helper base case together with the recursive shares case
Expand All @@ -335,8 +335,8 @@ private function _generateCTE(int $folderId, bool $withSoftDeleted) : array {
'WITH RECURSIVE second_folder_tree(item_id, parent_folder, type, idx, soft_deleted_at) AS (' .
'WITH RECURSIVE inner_folder_tree(item_id, parent_folder, type, idx, soft_deleted_at) AS ( ' .
$baseCase->getSQL() . ' UNION ALL ' . $recursiveCase->getSQL() . ')' .
' ' . $secondBaseCase->getSQL() . ' UNION ALL '. $recursiveCaseShares->getSQL() .')'.
' ' . $thirdBaseCase->getSQL() . ' UNION ALL ' . $secondRecursiveCase->getSQL(). ')';
' ' . $secondBaseCase->getSQL() . ' UNION ALL ' . $recursiveCaseShares->getSQL() . ')' .
' ' . $thirdBaseCase->getSQL() . ' UNION ALL ' . $secondRecursiveCase->getSQL() . ')';
}

// Now we need to concatenate the params of all these queries for downstream assembly of the greater query
Expand All @@ -362,7 +362,7 @@ private function _sortAndPaginate(IQueryBuilder $qb, QueryParameters $params): v
} elseif ($sqlSortColumn === 'url') {
$qb->addOrderBy('b.url', 'ASC');
} else {
$qb->addOrderBy('b.'.$sqlSortColumn, 'DESC');
$qb->addOrderBy('b.' . $sqlSortColumn, 'DESC');
}
// Always sort by id additionally, so the ordering is stable
$qb->addOrderBy('b.id', 'ASC');
Expand Down Expand Up @@ -457,7 +457,7 @@ private function _filterDuplicated(IQueryBuilder $qb, QueryParameters $params) {
->where($subQuery->expr()->eq('b.id', 'trdup.id'))
->andWhere($subQuery->expr()->neq('trdup.parent_folder', 'tree.parent_folder'))
->andWhere($subQuery->expr()->eq('trdup.type', $qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK)));
$qb->andWhere($qb->createFunction('EXISTS('.$subQuery->getSQL().')'));
$qb->andWhere($qb->createFunction('EXISTS(' . $subQuery->getSQL() . ')'));
}
}

Expand Down Expand Up @@ -502,8 +502,8 @@ private function _filterUntagged(IQueryBuilder $qb, QueryParameters $params): vo
private function _filterTags(IQueryBuilder $qb, QueryParameters $params): void {
if (count($params->getTags())) {
foreach ($params->getTags() as $i => $tag) {
$qb->leftJoin('b', '*PREFIX*bookmarks_tags', 'tg'.$i, $qb->expr()->eq('tg'.$i.'.bookmark_id', 'b.id'));
$qb->andWhere($qb->expr()->eq('tg'.$i.'.tag', $qb->createPositionalParameter($tag)));
$qb->leftJoin('b', '*PREFIX*bookmarks_tags', 'tg' . $i, $qb->expr()->eq('tg' . $i . '.bookmark_id', 'b.id'));
$qb->andWhere($qb->expr()->eq('tg' . $i . '.tag', $qb->createPositionalParameter($tag)));
}
}
}
Expand All @@ -518,7 +518,7 @@ public function countArchived(string $userId): int {

$qb
->from('bookmarks', 'b')
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = '.$qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = ' . $qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('tr', 'bookmarks_shared_folders', 'sf', $qb->expr()->eq('tr.parent_folder', 'sf.folder_id'))
->where(
$qb->expr()->andX(
Expand All @@ -545,7 +545,7 @@ public function countAllClicks(string $userId): int {

$qb
->from('bookmarks', 'b')
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = '.$qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = ' . $qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('tr', 'bookmarks_shared_folders', 'sf', $qb->expr()->eq('tr.parent_folder', 'sf.folder_id'))
->where(
$qb->expr()->andX(
Expand All @@ -571,7 +571,7 @@ public function countWithClicks(string $userId): int {

$qb
->from('bookmarks', 'b')
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = '.$qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = ' . $qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('tr', 'bookmarks_shared_folders', 'sf', $qb->expr()->eq('tr.parent_folder', 'sf.folder_id'))
->where(
$qb->expr()->andX(
Expand All @@ -598,7 +598,7 @@ public function countUnavailable(string $userId): int {

$qb
->from('bookmarks', 'b')
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = '.$qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = ' . $qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('tr', 'bookmarks_shared_folders', 'sf', $qb->expr()->eq('tr.parent_folder', 'sf.folder_id'))
->where(
$qb->expr()->andX(
Expand All @@ -624,7 +624,7 @@ public function countDuplicated(string $userId): int {

$qb
->from('bookmarks', 'b')
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = '.$qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = ' . $qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('tr', 'bookmarks_shared_folders', 'sf', $qb->expr()->eq('tr.parent_folder', 'sf.folder_id'))
->where(
$qb->expr()->andX(
Expand All @@ -641,7 +641,7 @@ public function countDuplicated(string $userId): int {
->where($subQuery->expr()->eq('b.id', 'trdup.id'))
->andWhere($subQuery->expr()->neq('trdup.parent_folder', 'tr.parent_folder'))
->andWhere($subQuery->expr()->eq('trdup.type', $qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK)));
$qb->andWhere($qb->createFunction('EXISTS('.$subQuery->getSQL().')'));
$qb->andWhere($qb->createFunction('EXISTS(' . $subQuery->getSQL() . ')'));

return $qb->execute()->fetch(PDO::FETCH_COLUMN);
}
Expand Down Expand Up @@ -697,7 +697,7 @@ public function findAllInPublicFolder(string $token, QueryParameters $queryParam
$this->_filterSearch($qb, $queryParams);
$this->_sortAndPaginate($qb, $queryParams);

$finalQuery = $cte . ' '. $qb->getSQL();
$finalQuery = $cte . ' ' . $qb->getSQL();
$params = array_merge($params, $qb->getParameters());
$paramTypes = array_merge($paramTypes, $qb->getParameterTypes());

Expand Down Expand Up @@ -857,7 +857,7 @@ private function getDbType(): string {
* @param IQueryBuilder $qb
*/
private function _selectFolders(IQueryBuilder $qb, bool $isSoftDeleted): void {
$qb->leftJoin('b', '*PREFIX*bookmarks_tree', 'tr2', 'b.id = tr2.id AND tr2.type = '.$qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK) . ($isSoftDeleted ? ' AND tr2.soft_deleted_at is NOT NULL' : ' AND tr2.soft_deleted_at is NULL'));
$qb->leftJoin('b', '*PREFIX*bookmarks_tree', 'tr2', 'b.id = tr2.id AND tr2.type = ' . $qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK) . ($isSoftDeleted ? ' AND tr2.soft_deleted_at is NOT NULL' : ' AND tr2.soft_deleted_at is NULL'));
if ($this->getDbType() === 'pgsql') {
$folders = $qb->createFunction('array_to_string(array_agg(' . $qb->getColumnName('tr2.parent_folder') . "), ',')");
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/PublicFolderMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function insertOrUpdate(Entity $entity): PublicFolder {
*/
public static function randomString(
int $length = 64,
string $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
string $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
): string {
if ($length < 1) {
throw new RangeException('Length must be a positive integer');
Expand Down
4 changes: 2 additions & 2 deletions lib/Db/TagMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function findAllWithCount($userId): array {
->selectAlias($qb->createFunction('COUNT(DISTINCT ' . $qb->getColumnName('t.bookmark_id') . ')'), 'count')
->from('bookmarks_tags', 't')
->innerJoin('t', 'bookmarks', 'b', $qb->expr()->eq('b.id', 't.bookmark_id'))
->innerJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = '.$qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK) . ' AND tr.soft_deleted_at IS NULL')
->innerJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = ' . $qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK) . ' AND tr.soft_deleted_at IS NULL')
->leftJoin('tr', 'bookmarks_shared_folders', 'sf', $qb->expr()->eq('tr.parent_folder', 'sf.folder_id'))
->where($qb->expr()->eq('b.user_id', $qb->createPositionalParameter($userId)))
->orWhere($qb->expr()->andX(
Expand All @@ -65,7 +65,7 @@ public function findAll($userId): array {
->select('t.tag')
->from('bookmarks_tags', 't')
->innerJoin('t', 'bookmarks', 'b', $qb->expr()->eq('b.id', 't.bookmark_id'))
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = '.$qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('b', 'bookmarks_tree', 'tr', 'b.id = tr.id AND tr.type = ' . $qb->createPositionalParameter(TreeMapper::TYPE_BOOKMARK))
->leftJoin('tr', 'bookmarks_shared_folders', 'sf', $qb->expr()->eq('tr.parent_folder', 'sf.folder_id'))
->where($qb->expr()->eq('b.user_id', $qb->createPositionalParameter($userId)))
->orWhere($qb->expr()->andX(
Expand Down
Loading

0 comments on commit 34594f9

Please sign in to comment.