Skip to content

Commit

Permalink
fix phpcs
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Trovic <luka@nextcloud.com>
  • Loading branch information
luka-nextcloud committed Sep 26, 2024
1 parent 2a7c5b9 commit 439c2b4
Show file tree
Hide file tree
Showing 44 changed files with 67 additions and 65 deletions.
8 changes: 4 additions & 4 deletions lib/Activity/ActivityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function __construct(
StackMapper $stackMapper,
AclMapper $aclMapper,
IFactory $l10nFactory,
?string $userId
?string $userId,
) {
$this->manager = $manager;
$this->permissionService = $permissionsService;
Expand Down Expand Up @@ -484,7 +484,7 @@ private function findObjectForEntity($objectType, $entity) {
$objectId = $entity->getObjectId();
break;
default:
throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType);
throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType);
}
return $this->cardMapper->find($objectId);
}
Expand All @@ -499,11 +499,11 @@ private function findObjectForEntity($objectType, $entity) {
$objectId = $entity->getBoardId();
break;
default:
throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType);
throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType);
}
return $this->boardMapper->find($objectId);
}
throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType);
throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType);
}

private function findDetailsForStack($stackId) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Activity/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Filter implements \OCP\Activity\IFilter {

public function __construct(
IL10N $l10n,
IURLGenerator $urlGenerator
IURLGenerator $urlGenerator,
) {
$this->l10n = $l10n;
$this->urlGenerator = $urlGenerator;
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/BoardImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class BoardImport extends Command {
public function __construct(
private BoardImportCommandService $boardImportCommandService
private BoardImportCommandService $boardImportCommandService,
) {
parent::__construct();
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Command/TransferOwnership.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

if ($boardId) {
$output->writeln('Transfer board ' . $board->getTitle() . ' from '. $board->getOwner() ." to $newOwner");
$output->writeln('Transfer board ' . $board->getTitle() . ' from ' . $board->getOwner() . " to $newOwner");
} else {
$output->writeln("Transfer all boards from $owner to $newOwner");
}
Expand All @@ -94,7 +94,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

if ($boardId) {
$this->boardService->transferBoardOwnership($boardId, $newOwner, $remapAssignment);
$output->writeln('<info>Board ' . $board->getTitle() . ' from '. $board->getOwner() ." transferred to $newOwner completed</info>");
$output->writeln('<info>Board ' . $board->getTitle() . ' from ' . $board->getOwner() . " transferred to $newOwner completed</info>");
return 0;
}

Expand Down
3 changes: 2 additions & 1 deletion lib/Controller/SessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
use OCP\IRequest;

class SessionController extends OCSController {
public function __construct($appName,
public function __construct(
$appName,
IRequest $request,
private SessionService $sessionService,
private PermissionService $permissionService,
Expand Down
2 changes: 1 addition & 1 deletion lib/Cron/ScheduledNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(
ITimeFactory $time,
protected CardMapper $cardMapper,
protected NotificationHelper $notificationHelper,
protected LoggerInterface $logger
protected LoggerInterface $logger,
) {
parent::__construct($time);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/DeckCalendarBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DeckCalendarBackend {

public function __construct(
BoardService $boardService, StackService $stackService, CardService $cardService, PermissionService $permissionService,
BoardMapper $boardMapper
BoardMapper $boardMapper,
) {
$this->boardService = $boardService;
$this->stackService = $stackService;
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/BoardMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(
private IUserManager $userManager,
private IGroupManager $groupManager,
private CirclesService $circlesService,
private LoggerInterface $logger
private LoggerInterface $logger,
) {
parent::__construct($db, 'deck_boards', Board::class);

Expand Down
4 changes: 2 additions & 2 deletions lib/Db/CardMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(
IManager $notificationManager,
ICacheFactory $cacheFactory,
$databaseType = 'sqlite3',
$database4ByteSupport = true
$database4ByteSupport = true,
) {
parent::__construct($db, 'deck_cards', Card::class);
$this->labelMapper = $labelMapper;
Expand Down Expand Up @@ -402,7 +402,7 @@ private function extendQueryByFilter(IQueryBuilder $qb, SearchQuery $query) {
if (count($query->getTag())) {
foreach ($query->getTag() as $index => $tag) {
$qb->innerJoin('c', 'deck_assigned_labels', 'al' . $index, $qb->expr()->eq('c.id', 'al' . $index . '.card_id'));
$qb->innerJoin('al'. $index, 'deck_labels', 'l' . $index, $qb->expr()->eq('al' . $index . '.label_id', 'l' . $index . '.id'));
$qb->innerJoin('al' . $index, 'deck_labels', 'l' . $index, $qb->expr()->eq('al' . $index . '.label_id', 'l' . $index . '.id'));
$qb->andWhere($qb->expr()->iLike('l' . $index . '.title', $qb->createNamedParameter('%' . $this->db->escapeLikeParameter($tag->getValue()) . '%', IQueryBuilder::PARAM_STR)));
}
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Db/ChangeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
IDBConnection $db,
ICacheFactory $cacheFactory,
IRequest $request,
?string $userId
?string $userId,
) {
$this->db = $db;
$this->cache = $cacheFactory->createDistributed('deck_changes');
Expand All @@ -43,7 +43,7 @@ public function boardChanged($boardId) {
public function cardChanged($cardId, $updateCard = true) {
$time = time();
$etag = md5($time . microtime());
$this->cache->set(self::TYPE_CARD . '-' .$cardId, $etag);
$this->cache->set(self::TYPE_CARD . '-' . $cardId, $etag);
if ($updateCard) {
$sql = 'UPDATE `*PREFIX*deck_cards` SET `last_modified` = ?, `last_editor` = ? WHERE `id` = ?';
$this->db->executeUpdate($sql, [time(), $this->userId, $cardId]);
Expand All @@ -60,7 +60,7 @@ public function cardChanged($cardId, $updateCard = true) {
public function stackChanged($stackId, $updateBoard = true) {
$time = time();
$etag = md5($time . microtime());
$this->cache->set(self::TYPE_CARD . '-' .$stackId, $etag);
$this->cache->set(self::TYPE_CARD . '-' . $stackId, $etag);
if ($updateBoard) {
$sql = 'UPDATE `*PREFIX*deck_stacks` SET `last_modified` = ? WHERE `id` = ?';
$this->db->executeUpdate($sql, [time(), $stackId]);
Expand All @@ -76,7 +76,7 @@ public function checkEtag($type, $id) {
}

public function getEtag($type, $id) {
$entry = $this->cache->get($type . '-' .$id);
$entry = $this->cache->get($type . '-' . $id);
if ($entry === 'null') {
return '';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/StackMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class StackMapper extends DeckMapper implements IPermissionMapper {
public function __construct(
IDBConnection $db,
CardMapper $cardMapper,
ICacheFactory $cacheFactory
ICacheFactory $cacheFactory,
) {
parent::__construct($db, 'deck_stacks', Stack::class);
$this->cardMapper = $cardMapper;
Expand Down
2 changes: 1 addition & 1 deletion lib/Listeners/LiveUpdateListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
IRequest $request,
LoggerInterface $logger,
SessionService $sessionService,
StackMapper $stackMapper
StackMapper $stackMapper,
) {
try {
$this->queue = $container->get(IQueue::class);
Expand Down
4 changes: 2 additions & 2 deletions lib/Migration/Version11000Date20240222115515.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
$returnValue = null;

$assignedUsersTable = $schema->getTable('deck_assigned_users');
if($assignedUsersTable->hasIndex('deck_assigned_users_idx_c')) {
if ($assignedUsersTable->hasIndex('deck_assigned_users_idx_c')) {
$assignedUsersTable->dropIndex('deck_assigned_users_idx_c');
$returnValue = $schema;
}

$boardAclTable = $schema->getTable('deck_board_acl');
if($boardAclTable->hasIndex('deck_board_acl_idx_i')) {
if ($boardAclTable->hasIndex('deck_board_acl_idx_i')) {
$boardAclTable->dropIndex('deck_board_acl_idx_i');
$returnValue = $schema;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Notification/NotificationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(
IConfig $config,
IManager $notificationManager,
IGroupManager $groupManager,
$userId
$userId,
) {
$this->cardMapper = $cardMapper;
$this->boardMapper = $boardMapper;
Expand Down
2 changes: 1 addition & 1 deletion lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(
IUserManager $userManager,
CardMapper $cardMapper,
StackMapper $stackMapper,
BoardMapper $boardMapper
BoardMapper $boardMapper,
) {
$this->l10nFactory = $l10nFactory;
$this->url = $url;
Expand Down
2 changes: 1 addition & 1 deletion lib/Provider/DeckProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DeckProvider implements IFullTextSearchProvider {
* @param FullTextSearchService $fullTextSearchService
*/
public function __construct(
IL10N $l10n, IUrlGenerator $urlGenerator, FullTextSearchService $fullTextSearchService
IL10N $l10n, IUrlGenerator $urlGenerator, FullTextSearchService $fullTextSearchService,
) {
$this->l10n = $l10n;
$this->urlGenerator = $urlGenerator;
Expand Down
3 changes: 2 additions & 1 deletion lib/Reference/CreateCardReferenceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class CreateCardReferenceProvider extends ADiscoverableReferenceProvider {
public function __construct(
private IL10N $l10n,
private IURLGenerator $urlGenerator,
private ?string $userId) {
private ?string $userId,
) {
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Search/CardCommentProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CardCommentProvider implements IProvider {

public function __construct(
SearchService $searchService,
IL10N $l10n
IL10N $l10n,
) {
$this->searchService = $searchService;
$this->l10n = $l10n;
Expand Down
2 changes: 1 addition & 1 deletion lib/Search/DeckProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DeckProvider implements IProvider {
public function __construct(
SearchService $searchService,
IURLGenerator $urlGenerator,
IL10N $l10n
IL10N $l10n,
) {
$this->l10n = $l10n;
$this->searchService = $searchService;
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/AssignmentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct(
ChangeHelper $changeHelper,
IEventDispatcher $eventDispatcher,
AssignmentServiceValidator $assignmentServiceValidator,
$userId
$userId,
) {
$this->assignmentServiceValidator = $assignmentServiceValidator;
$this->permissionService = $permissionService;
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/AttachmentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(
$userId,
IL10N $l10n,
ActivityManager $activityManager,
AttachmentServiceValidator $attachmentServiceValidator
AttachmentServiceValidator $attachmentServiceValidator,
) {
$this->attachmentMapper = $attachmentMapper;
$this->cardMapper = $cardMapper;
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/BoardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function __construct(
IDBConnection $connection,
BoardServiceValidator $boardServiceValidator,
SessionMapper $sessionMapper,
?string $userId
?string $userId,
) {
$this->boardMapper = $boardMapper;
$this->stackMapper = $stackMapper;
Expand Down
6 changes: 3 additions & 3 deletions lib/Service/CardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct(
LoggerInterface $logger,
IRequest $request,
CardServiceValidator $cardServiceValidator,
?string $userId
?string $userId,
) {
$this->cardMapper = $cardMapper;
$this->stackMapper = $stackMapper;
Expand Down Expand Up @@ -356,11 +356,11 @@ public function update($id, $title, $stackId, $type, $owner, $description = '',
$card = $this->cardMapper->update($card);
$oldBoardId = $this->stackMapper->findBoardId($changes->getBefore()->getStackId());
$boardId = $this->cardMapper->findBoardId($card->getId());
if($boardId !== $oldBoardId) {
if ($boardId !== $oldBoardId) {
$stack = $this->stackMapper->find($card->getStackId());
$board = $this->boardService->find($this->cardMapper->findBoardId($card->getId()));
$boardLabels = $board->getLabels() ?? [];
foreach($card->getLabels() as $cardLabel) {
foreach ($card->getLabels() as $cardLabel) {
$this->removeLabel($card->getId(), $cardLabel->getId());
$label = $this->labelMapper->find($cardLabel->getId());
$filteredLabels = array_values(array_filter($boardLabels, fn ($item) => $item->getTitle() === $label->getTitle()));
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ConfigService {

public function __construct(
IConfig $config,
IGroupManager $groupManager
IGroupManager $groupManager,
) {
$this->groupManager = $groupManager;
$this->config = $config;
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/DefaultBoardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
BoardService $boardService,
StackService $stackService,
CardService $cardService,
IConfig $config
IConfig $config,
) {
$this->boardService = $boardService;
$this->stackService = $stackService;
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/FileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(
private IRootFolder $rootFolder,
private IConfig $config,
private AttachmentMapper $attachmentMapper,
private IMimeTypeDetector $mimeTypeDetector
private IMimeTypeDetector $mimeTypeDetector,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Service/FilesAppService.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct(
CardMapper $cardMapper,
LoggerInterface $logger,
IDBConnection $connection,
?string $userId
?string $userId,
) {
$this->request = $request;
$this->l10n = $l10n;
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/FullTextSearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FullTextSearchService {
private $cardMapper;

public function __construct(
BoardMapper $boardMapper, StackMapper $stackMapper, CardMapper $cardMapper
BoardMapper $boardMapper, StackMapper $stackMapper, CardMapper $cardMapper,
) {
$this->boardMapper = $boardMapper;
$this->stackMapper = $stackMapper;
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/Importer/BoardImportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __construct(
private CardMapper $cardMapper,
private ICommentsManager $commentsManager,
private IEventDispatcher $eventDispatcher,
private LoggerInterface $logger
private LoggerInterface $logger,
) {
$this->board = new Board();
$this->disableCommentsEvents();
Expand Down Expand Up @@ -364,7 +364,7 @@ public function importCardAssignments(): void {
$this->getImportSystem()->updateCardAssignment($cardId, (string)$assignment->getId(), $assignment);
$this->addOutput('Assignment ' . $assignment->getParticipant() . ' added');
} catch (NotFoundException $e) {
$this->addError('No origin or mapping found for card "' . $cardId . '" and ' . $assignment->getTypeString() .' assignment "' . $assignment->getParticipant(), $e);
$this->addError('No origin or mapping found for card "' . $cardId . '" and ' . $assignment->getTypeString() . ' assignment "' . $assignment->getParticipant(), $e);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/Importer/Systems/TrelloApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(
IURLGenerator $urlGenerator,
IL10N $l10n,
LoggerInterface $logger,
IClientService $httpClientService
IClientService $httpClientService,
) {
parent::__construct($userManager, $urlGenerator, $l10n);
$this->logger = $logger;
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/Importer/Systems/TrelloJsonService.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TrelloJsonService extends ABoardImportService {
public function __construct(
IUserManager $userManager,
IURLGenerator $urlGenerator,
IL10N $l10n
IL10N $l10n,
) {
$this->userManager = $userManager;
$this->urlGenerator = $urlGenerator;
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/LabelService.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(
PermissionService $permissionService,
BoardService $boardService,
ChangeHelper $changeHelper,
LabelServiceValidator $labelServiceValidator
LabelServiceValidator $labelServiceValidator,
) {
$this->labelMapper = $labelMapper;
$this->permissionService = $permissionService;
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/OverviewService.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(
AssignmentMapper $assignedUsersMapper,
IUserManager $userManager,
ICommentsManager $commentsManager,
AttachmentService $attachmentService
AttachmentService $attachmentService,
) {
$this->cardService = $cardService;
$this->boardMapper = $boardMapper;
Expand Down
Loading

0 comments on commit 439c2b4

Please sign in to comment.