fix phpcs

Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
Luka Trovic
2024-09-26 17:12:20 +02:00
parent 2a7c5b9c9c
commit 439c2b422e
44 changed files with 67 additions and 65 deletions

View File

@@ -100,7 +100,7 @@ class ActivityManager {
StackMapper $stackMapper, StackMapper $stackMapper,
AclMapper $aclMapper, AclMapper $aclMapper,
IFactory $l10nFactory, IFactory $l10nFactory,
?string $userId ?string $userId,
) { ) {
$this->manager = $manager; $this->manager = $manager;
$this->permissionService = $permissionsService; $this->permissionService = $permissionsService;
@@ -484,7 +484,7 @@ class ActivityManager {
$objectId = $entity->getObjectId(); $objectId = $entity->getObjectId();
break; break;
default: 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); return $this->cardMapper->find($objectId);
} }
@@ -499,11 +499,11 @@ class ActivityManager {
$objectId = $entity->getBoardId(); $objectId = $entity->getBoardId();
break; break;
default: 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); 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) { private function findDetailsForStack($stackId) {

View File

@@ -15,7 +15,7 @@ class Filter implements \OCP\Activity\IFilter {
public function __construct( public function __construct(
IL10N $l10n, IL10N $l10n,
IURLGenerator $urlGenerator IURLGenerator $urlGenerator,
) { ) {
$this->l10n = $l10n; $this->l10n = $l10n;
$this->urlGenerator = $urlGenerator; $this->urlGenerator = $urlGenerator;

View File

@@ -15,7 +15,7 @@ use Symfony\Component\Console\Output\OutputInterface;
class BoardImport extends Command { class BoardImport extends Command {
public function __construct( public function __construct(
private BoardImportCommandService $boardImportCommandService private BoardImportCommandService $boardImportCommandService,
) { ) {
parent::__construct(); parent::__construct();
} }

View File

@@ -82,7 +82,7 @@ final class TransferOwnership extends Command {
} }
if ($boardId) { 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 { } else {
$output->writeln("Transfer all boards from $owner to $newOwner"); $output->writeln("Transfer all boards from $owner to $newOwner");
} }
@@ -94,7 +94,7 @@ final class TransferOwnership extends Command {
if ($boardId) { if ($boardId) {
$this->boardService->transferBoardOwnership($boardId, $newOwner, $remapAssignment); $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; return 0;
} }

View File

@@ -21,7 +21,8 @@ use OCP\AppFramework\OCSController;
use OCP\IRequest; use OCP\IRequest;
class SessionController extends OCSController { class SessionController extends OCSController {
public function __construct($appName, public function __construct(
$appName,
IRequest $request, IRequest $request,
private SessionService $sessionService, private SessionService $sessionService,
private PermissionService $permissionService, private PermissionService $permissionService,

View File

@@ -20,7 +20,7 @@ class ScheduledNotifications extends Job {
ITimeFactory $time, ITimeFactory $time,
protected CardMapper $cardMapper, protected CardMapper $cardMapper,
protected NotificationHelper $notificationHelper, protected NotificationHelper $notificationHelper,
protected LoggerInterface $logger protected LoggerInterface $logger,
) { ) {
parent::__construct($time); parent::__construct($time);
} }

View File

@@ -32,7 +32,7 @@ class DeckCalendarBackend {
public function __construct( public function __construct(
BoardService $boardService, StackService $stackService, CardService $cardService, PermissionService $permissionService, BoardService $boardService, StackService $stackService, CardService $cardService, PermissionService $permissionService,
BoardMapper $boardMapper BoardMapper $boardMapper,
) { ) {
$this->boardService = $boardService; $this->boardService = $boardService;
$this->stackService = $stackService; $this->stackService = $stackService;

View File

@@ -31,7 +31,7 @@ class BoardMapper extends QBMapper implements IPermissionMapper {
private IUserManager $userManager, private IUserManager $userManager,
private IGroupManager $groupManager, private IGroupManager $groupManager,
private CirclesService $circlesService, private CirclesService $circlesService,
private LoggerInterface $logger private LoggerInterface $logger,
) { ) {
parent::__construct($db, 'deck_boards', Board::class); parent::__construct($db, 'deck_boards', Board::class);

View File

@@ -45,7 +45,7 @@ class CardMapper extends QBMapper implements IPermissionMapper {
IManager $notificationManager, IManager $notificationManager,
ICacheFactory $cacheFactory, ICacheFactory $cacheFactory,
$databaseType = 'sqlite3', $databaseType = 'sqlite3',
$database4ByteSupport = true $database4ByteSupport = true,
) { ) {
parent::__construct($db, 'deck_cards', Card::class); parent::__construct($db, 'deck_cards', Card::class);
$this->labelMapper = $labelMapper; $this->labelMapper = $labelMapper;
@@ -402,7 +402,7 @@ class CardMapper extends QBMapper implements IPermissionMapper {
if (count($query->getTag())) { if (count($query->getTag())) {
foreach ($query->getTag() as $index => $tag) { 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('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))); $qb->andWhere($qb->expr()->iLike('l' . $index . '.title', $qb->createNamedParameter('%' . $this->db->escapeLikeParameter($tag->getValue()) . '%', IQueryBuilder::PARAM_STR)));
} }
} }

View File

@@ -24,7 +24,7 @@ class ChangeHelper {
IDBConnection $db, IDBConnection $db,
ICacheFactory $cacheFactory, ICacheFactory $cacheFactory,
IRequest $request, IRequest $request,
?string $userId ?string $userId,
) { ) {
$this->db = $db; $this->db = $db;
$this->cache = $cacheFactory->createDistributed('deck_changes'); $this->cache = $cacheFactory->createDistributed('deck_changes');
@@ -43,7 +43,7 @@ class ChangeHelper {
public function cardChanged($cardId, $updateCard = true) { public function cardChanged($cardId, $updateCard = true) {
$time = time(); $time = time();
$etag = md5($time . microtime()); $etag = md5($time . microtime());
$this->cache->set(self::TYPE_CARD . '-' .$cardId, $etag); $this->cache->set(self::TYPE_CARD . '-' . $cardId, $etag);
if ($updateCard) { if ($updateCard) {
$sql = 'UPDATE `*PREFIX*deck_cards` SET `last_modified` = ?, `last_editor` = ? WHERE `id` = ?'; $sql = 'UPDATE `*PREFIX*deck_cards` SET `last_modified` = ?, `last_editor` = ? WHERE `id` = ?';
$this->db->executeUpdate($sql, [time(), $this->userId, $cardId]); $this->db->executeUpdate($sql, [time(), $this->userId, $cardId]);
@@ -60,7 +60,7 @@ class ChangeHelper {
public function stackChanged($stackId, $updateBoard = true) { public function stackChanged($stackId, $updateBoard = true) {
$time = time(); $time = time();
$etag = md5($time . microtime()); $etag = md5($time . microtime());
$this->cache->set(self::TYPE_CARD . '-' .$stackId, $etag); $this->cache->set(self::TYPE_CARD . '-' . $stackId, $etag);
if ($updateBoard) { if ($updateBoard) {
$sql = 'UPDATE `*PREFIX*deck_stacks` SET `last_modified` = ? WHERE `id` = ?'; $sql = 'UPDATE `*PREFIX*deck_stacks` SET `last_modified` = ? WHERE `id` = ?';
$this->db->executeUpdate($sql, [time(), $stackId]); $this->db->executeUpdate($sql, [time(), $stackId]);
@@ -76,7 +76,7 @@ class ChangeHelper {
} }
public function getEtag($type, $id) { public function getEtag($type, $id) {
$entry = $this->cache->get($type . '-' .$id); $entry = $this->cache->get($type . '-' . $id);
if ($entry === 'null') { if ($entry === 'null') {
return ''; return '';
} }

View File

@@ -24,7 +24,7 @@ class StackMapper extends DeckMapper implements IPermissionMapper {
public function __construct( public function __construct(
IDBConnection $db, IDBConnection $db,
CardMapper $cardMapper, CardMapper $cardMapper,
ICacheFactory $cacheFactory ICacheFactory $cacheFactory,
) { ) {
parent::__construct($db, 'deck_stacks', Stack::class); parent::__construct($db, 'deck_stacks', Stack::class);
$this->cardMapper = $cardMapper; $this->cardMapper = $cardMapper;

View File

@@ -38,7 +38,7 @@ class LiveUpdateListener implements IEventListener {
IRequest $request, IRequest $request,
LoggerInterface $logger, LoggerInterface $logger,
SessionService $sessionService, SessionService $sessionService,
StackMapper $stackMapper StackMapper $stackMapper,
) { ) {
try { try {
$this->queue = $container->get(IQueue::class); $this->queue = $container->get(IQueue::class);

View File

@@ -20,13 +20,13 @@ class Version11000Date20240222115515 extends SimpleMigrationStep {
$returnValue = null; $returnValue = null;
$assignedUsersTable = $schema->getTable('deck_assigned_users'); $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'); $assignedUsersTable->dropIndex('deck_assigned_users_idx_c');
$returnValue = $schema; $returnValue = $schema;
} }
$boardAclTable = $schema->getTable('deck_board_acl'); $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'); $boardAclTable->dropIndex('deck_board_acl_idx_i');
$returnValue = $schema; $returnValue = $schema;
} }

View File

@@ -58,7 +58,7 @@ class NotificationHelper {
IConfig $config, IConfig $config,
IManager $notificationManager, IManager $notificationManager,
IGroupManager $groupManager, IGroupManager $groupManager,
$userId $userId,
) { ) {
$this->cardMapper = $cardMapper; $this->cardMapper = $cardMapper;
$this->boardMapper = $boardMapper; $this->boardMapper = $boardMapper;

View File

@@ -36,7 +36,7 @@ class Notifier implements INotifier {
IUserManager $userManager, IUserManager $userManager,
CardMapper $cardMapper, CardMapper $cardMapper,
StackMapper $stackMapper, StackMapper $stackMapper,
BoardMapper $boardMapper BoardMapper $boardMapper,
) { ) {
$this->l10nFactory = $l10nFactory; $this->l10nFactory = $l10nFactory;
$this->url = $url; $this->url = $url;

View File

@@ -47,7 +47,7 @@ class DeckProvider implements IFullTextSearchProvider {
* @param FullTextSearchService $fullTextSearchService * @param FullTextSearchService $fullTextSearchService
*/ */
public function __construct( public function __construct(
IL10N $l10n, IUrlGenerator $urlGenerator, FullTextSearchService $fullTextSearchService IL10N $l10n, IUrlGenerator $urlGenerator, FullTextSearchService $fullTextSearchService,
) { ) {
$this->l10n = $l10n; $this->l10n = $l10n;
$this->urlGenerator = $urlGenerator; $this->urlGenerator = $urlGenerator;

View File

@@ -17,7 +17,8 @@ class CreateCardReferenceProvider extends ADiscoverableReferenceProvider {
public function __construct( public function __construct(
private IL10N $l10n, private IL10N $l10n,
private IURLGenerator $urlGenerator, private IURLGenerator $urlGenerator,
private ?string $userId) { private ?string $userId,
) {
} }
/** /**

View File

@@ -25,7 +25,7 @@ class CardCommentProvider implements IProvider {
public function __construct( public function __construct(
SearchService $searchService, SearchService $searchService,
IL10N $l10n IL10N $l10n,
) { ) {
$this->searchService = $searchService; $this->searchService = $searchService;
$this->l10n = $l10n; $this->l10n = $l10n;

View File

@@ -27,7 +27,7 @@ class DeckProvider implements IProvider {
public function __construct( public function __construct(
SearchService $searchService, SearchService $searchService,
IURLGenerator $urlGenerator, IURLGenerator $urlGenerator,
IL10N $l10n IL10N $l10n,
) { ) {
$this->l10n = $l10n; $this->l10n = $l10n;
$this->searchService = $searchService; $this->searchService = $searchService;

View File

@@ -76,7 +76,7 @@ class AssignmentService {
ChangeHelper $changeHelper, ChangeHelper $changeHelper,
IEventDispatcher $eventDispatcher, IEventDispatcher $eventDispatcher,
AssignmentServiceValidator $assignmentServiceValidator, AssignmentServiceValidator $assignmentServiceValidator,
$userId $userId,
) { ) {
$this->assignmentServiceValidator = $assignmentServiceValidator; $this->assignmentServiceValidator = $assignmentServiceValidator;
$this->permissionService = $permissionService; $this->permissionService = $permissionService;

View File

@@ -58,7 +58,7 @@ class AttachmentService {
$userId, $userId,
IL10N $l10n, IL10N $l10n,
ActivityManager $activityManager, ActivityManager $activityManager,
AttachmentServiceValidator $attachmentServiceValidator AttachmentServiceValidator $attachmentServiceValidator,
) { ) {
$this->attachmentMapper = $attachmentMapper; $this->attachmentMapper = $attachmentMapper;
$this->cardMapper = $cardMapper; $this->cardMapper = $cardMapper;

View File

@@ -89,7 +89,7 @@ class BoardService {
IDBConnection $connection, IDBConnection $connection,
BoardServiceValidator $boardServiceValidator, BoardServiceValidator $boardServiceValidator,
SessionMapper $sessionMapper, SessionMapper $sessionMapper,
?string $userId ?string $userId,
) { ) {
$this->boardMapper = $boardMapper; $this->boardMapper = $boardMapper;
$this->stackMapper = $stackMapper; $this->stackMapper = $stackMapper;

View File

@@ -77,7 +77,7 @@ class CardService {
LoggerInterface $logger, LoggerInterface $logger,
IRequest $request, IRequest $request,
CardServiceValidator $cardServiceValidator, CardServiceValidator $cardServiceValidator,
?string $userId ?string $userId,
) { ) {
$this->cardMapper = $cardMapper; $this->cardMapper = $cardMapper;
$this->stackMapper = $stackMapper; $this->stackMapper = $stackMapper;
@@ -356,11 +356,11 @@ class CardService {
$card = $this->cardMapper->update($card); $card = $this->cardMapper->update($card);
$oldBoardId = $this->stackMapper->findBoardId($changes->getBefore()->getStackId()); $oldBoardId = $this->stackMapper->findBoardId($changes->getBefore()->getStackId());
$boardId = $this->cardMapper->findBoardId($card->getId()); $boardId = $this->cardMapper->findBoardId($card->getId());
if($boardId !== $oldBoardId) { if ($boardId !== $oldBoardId) {
$stack = $this->stackMapper->find($card->getStackId()); $stack = $this->stackMapper->find($card->getStackId());
$board = $this->boardService->find($this->cardMapper->findBoardId($card->getId())); $board = $this->boardService->find($this->cardMapper->findBoardId($card->getId()));
$boardLabels = $board->getLabels() ?? []; $boardLabels = $board->getLabels() ?? [];
foreach($card->getLabels() as $cardLabel) { foreach ($card->getLabels() as $cardLabel) {
$this->removeLabel($card->getId(), $cardLabel->getId()); $this->removeLabel($card->getId(), $cardLabel->getId());
$label = $this->labelMapper->find($cardLabel->getId()); $label = $this->labelMapper->find($cardLabel->getId());
$filteredLabels = array_values(array_filter($boardLabels, fn ($item) => $item->getTitle() === $label->getTitle())); $filteredLabels = array_values(array_filter($boardLabels, fn ($item) => $item->getTitle() === $label->getTitle()));

View File

@@ -29,7 +29,7 @@ class ConfigService {
public function __construct( public function __construct(
IConfig $config, IConfig $config,
IGroupManager $groupManager IGroupManager $groupManager,
) { ) {
$this->groupManager = $groupManager; $this->groupManager = $groupManager;
$this->config = $config; $this->config = $config;

View File

@@ -27,7 +27,7 @@ class DefaultBoardService {
BoardService $boardService, BoardService $boardService,
StackService $stackService, StackService $stackService,
CardService $cardService, CardService $cardService,
IConfig $config IConfig $config,
) { ) {
$this->boardService = $boardService; $this->boardService = $boardService;
$this->stackService = $stackService; $this->stackService = $stackService;

View File

@@ -33,7 +33,7 @@ class FileService implements IAttachmentService {
private IRootFolder $rootFolder, private IRootFolder $rootFolder,
private IConfig $config, private IConfig $config,
private AttachmentMapper $attachmentMapper, private AttachmentMapper $attachmentMapper,
private IMimeTypeDetector $mimeTypeDetector private IMimeTypeDetector $mimeTypeDetector,
) { ) {
} }

View File

@@ -55,7 +55,7 @@ class FilesAppService implements IAttachmentService, ICustomAttachmentService {
CardMapper $cardMapper, CardMapper $cardMapper,
LoggerInterface $logger, LoggerInterface $logger,
IDBConnection $connection, IDBConnection $connection,
?string $userId ?string $userId,
) { ) {
$this->request = $request; $this->request = $request;
$this->l10n = $l10n; $this->l10n = $l10n;

View File

@@ -39,7 +39,7 @@ class FullTextSearchService {
private $cardMapper; private $cardMapper;
public function __construct( public function __construct(
BoardMapper $boardMapper, StackMapper $stackMapper, CardMapper $cardMapper BoardMapper $boardMapper, StackMapper $stackMapper, CardMapper $cardMapper,
) { ) {
$this->boardMapper = $boardMapper; $this->boardMapper = $boardMapper;
$this->stackMapper = $stackMapper; $this->stackMapper = $stackMapper;

View File

@@ -70,7 +70,7 @@ class BoardImportService {
private CardMapper $cardMapper, private CardMapper $cardMapper,
private ICommentsManager $commentsManager, private ICommentsManager $commentsManager,
private IEventDispatcher $eventDispatcher, private IEventDispatcher $eventDispatcher,
private LoggerInterface $logger private LoggerInterface $logger,
) { ) {
$this->board = new Board(); $this->board = new Board();
$this->disableCommentsEvents(); $this->disableCommentsEvents();
@@ -364,7 +364,7 @@ class BoardImportService {
$this->getImportSystem()->updateCardAssignment($cardId, (string)$assignment->getId(), $assignment); $this->getImportSystem()->updateCardAssignment($cardId, (string)$assignment->getId(), $assignment);
$this->addOutput('Assignment ' . $assignment->getParticipant() . ' added'); $this->addOutput('Assignment ' . $assignment->getParticipant() . ' added');
} catch (NotFoundException $e) { } 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);
} }
} }
} }

View File

@@ -31,7 +31,7 @@ class TrelloApiService extends TrelloJsonService {
IURLGenerator $urlGenerator, IURLGenerator $urlGenerator,
IL10N $l10n, IL10N $l10n,
LoggerInterface $logger, LoggerInterface $logger,
IClientService $httpClientService IClientService $httpClientService,
) { ) {
parent::__construct($userManager, $urlGenerator, $l10n); parent::__construct($userManager, $urlGenerator, $l10n);
$this->logger = $logger; $this->logger = $logger;

View File

@@ -37,7 +37,7 @@ class TrelloJsonService extends ABoardImportService {
public function __construct( public function __construct(
IUserManager $userManager, IUserManager $userManager,
IURLGenerator $urlGenerator, IURLGenerator $urlGenerator,
IL10N $l10n IL10N $l10n,
) { ) {
$this->userManager = $userManager; $this->userManager = $userManager;
$this->urlGenerator = $urlGenerator; $this->urlGenerator = $urlGenerator;

View File

@@ -32,7 +32,7 @@ class LabelService {
PermissionService $permissionService, PermissionService $permissionService,
BoardService $boardService, BoardService $boardService,
ChangeHelper $changeHelper, ChangeHelper $changeHelper,
LabelServiceValidator $labelServiceValidator LabelServiceValidator $labelServiceValidator,
) { ) {
$this->labelMapper = $labelMapper; $this->labelMapper = $labelMapper;
$this->permissionService = $permissionService; $this->permissionService = $permissionService;

View File

@@ -36,7 +36,7 @@ class OverviewService {
AssignmentMapper $assignedUsersMapper, AssignmentMapper $assignedUsersMapper,
IUserManager $userManager, IUserManager $userManager,
ICommentsManager $commentsManager, ICommentsManager $commentsManager,
AttachmentService $attachmentService AttachmentService $attachmentService,
) { ) {
$this->cardService = $cardService; $this->cardService = $cardService;
$this->boardMapper = $boardMapper; $this->boardMapper = $boardMapper;

View File

@@ -40,7 +40,7 @@ class PermissionService {
private IGroupManager $groupManager, private IGroupManager $groupManager,
private IManager $shareManager, private IManager $shareManager,
private IConfig $config, private IConfig $config,
private ?string $userId private ?string $userId,
) { ) {
$this->boardCache = new CappedMemoryCache(); $this->boardCache = new CappedMemoryCache();
$this->permissionCache = new CappedMemoryCache(); $this->permissionCache = new CappedMemoryCache();

View File

@@ -46,7 +46,7 @@ class SearchService {
FilterStringParser $filterStringParser, FilterStringParser $filterStringParser,
IUserManager $userManager, IUserManager $userManager,
IL10N $l10n, IL10N $l10n,
IURLGenerator $urlGenerator IURLGenerator $urlGenerator,
) { ) {
$this->boardService = $boardService; $this->boardService = $boardService;
$this->cardMapper = $cardMapper; $this->cardMapper = $cardMapper;

View File

@@ -33,7 +33,7 @@ class SessionService {
ISecureRandom $secureRandom, ISecureRandom $secureRandom,
ITimeFactory $timeFactory, ITimeFactory $timeFactory,
$userId, $userId,
IEventDispatcher $eventDispatcher IEventDispatcher $eventDispatcher,
) { ) {
$this->sessionMapper = $sessionMapper; $this->sessionMapper = $sessionMapper;
$this->secureRandom = $secureRandom; $this->secureRandom = $secureRandom;

View File

@@ -56,7 +56,7 @@ class StackService {
ChangeHelper $changeHelper, ChangeHelper $changeHelper,
LoggerInterface $logger, LoggerInterface $logger,
IEventDispatcher $eventDispatcher, IEventDispatcher $eventDispatcher,
StackServiceValidator $stackServiceValidator StackServiceValidator $stackServiceValidator,
) { ) {
$this->stackMapper = $stackMapper; $this->stackMapper = $stackMapper;
$this->boardMapper = $boardMapper; $this->boardMapper = $boardMapper;

View File

@@ -69,7 +69,7 @@ class DeckShareProvider implements \OCP\Share\IShareProvider {
IL10N $l, IL10N $l,
ITimeFactory $timeFactory, ITimeFactory $timeFactory,
IMimeTypeLoader $mimeTypeLoader, IMimeTypeLoader $mimeTypeLoader,
?string $userId ?string $userId,
) { ) {
$this->dbConnection = $connection; $this->dbConnection = $connection;
$this->shareManager = $shareManager; $this->shareManager = $shareManager;
@@ -174,7 +174,7 @@ class DeckShareProvider implements \OCP\Share\IShareProvider {
string $target, string $target,
int $permissions, int $permissions,
string $token, string $token,
?\DateTime $expirationDate ?\DateTime $expirationDate,
): int { ): int {
$qb = $this->dbConnection->getQueryBuilder(); $qb = $this->dbConnection->getQueryBuilder();
$qb->insert('share') $qb->insert('share')

View File

@@ -59,6 +59,6 @@ class DeckTeamResourceProvider implements \OCP\Teams\ITeamResourceProvider {
} }
public function getBoardBulletIcon(Board $board): string { public function getBoardBulletIcon(Board $board): string {
return '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" viewBox="0 0 16 16"><g fill="#' . $board->getColor(). '"><rect ry="15" height="14" width="14" y="1" x="1"/></g></svg>'; return '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" viewBox="0 0 16 16"><g fill="#' . $board->getColor() . '"><rect ry="15" height="14" width="14" y="1" x="1"/></g></svg>';
} }
} }

View File

@@ -45,7 +45,7 @@ abstract class BaseValidator {
} else { } else {
if (!$this->{$rule}($value)) { if (!$this->{$rule}($value)) {
throw new BadRequestException( throw new BadRequestException(
$field . ' must be provided and must be '. str_replace('_', ' ', $rule)); $field . ' must be provided and must be ' . str_replace('_', ' ', $rule));
} }
} }
} }
@@ -154,10 +154,10 @@ abstract class BaseValidator {
protected function getErrorMessage($rule, $field, $parameter = null): string { protected function getErrorMessage($rule, $field, $parameter = null): string {
if (in_array($rule, ['max', 'min'])) { if (in_array($rule, ['max', 'min'])) {
return $rule === 'max' return $rule === 'max'
? $field . ' cannot be longer than '. $parameter . ' characters ' ? $field . ' cannot be longer than ' . $parameter . ' characters '
: $field . ' must be at least '. $parameter . ' characters long '; : $field . ' must be at least ' . $parameter . ' characters long ';
} }
return $field . ' must be provided and must be '. str_replace('_', ' ', $rule); return $field . ' must be provided and must be ' . str_replace('_', ' ', $rule);
} }
} }

View File

@@ -71,7 +71,7 @@ class BoardContext implements Context {
break; break;
} }
} }
Assert::assertNotNull($id, 'Could not find board named '.$boardName); Assert::assertNotNull($id, 'Could not find board named ' . $boardName);
} else { } else {
$id = $this->board['id']; $id = $this->board['id'];
} }
@@ -259,7 +259,7 @@ class BoardContext implements Context {
} }
private function assignToCard($participant, $type) { private function assignToCard($participant, $type) {
$this->requestContext->sendJSONrequest('POST', '/index.php/apps/deck/cards/' . $this->card['id'] .'/assign', [ $this->requestContext->sendJSONrequest('POST', '/index.php/apps/deck/cards/' . $this->card['id'] . '/assign', [
'userId' => $participant, 'userId' => $participant,
'type' => $type 'type' => $type
]); ]);
@@ -274,7 +274,7 @@ class BoardContext implements Context {
return $label['title'] === $tag; return $label['title'] === $tag;
}); });
$label = array_shift($filteredLabels); $label = array_shift($filteredLabels);
$this->requestContext->sendJSONrequest('POST', '/index.php/apps/deck/cards/' . $this->card['id'] .'/label/' . $label['id']); $this->requestContext->sendJSONrequest('POST', '/index.php/apps/deck/cards/' . $this->card['id'] . '/label/' . $label['id']);
$this->requestContext->getResponse()->getBody()->seek(0); $this->requestContext->getResponse()->getBody()->seek(0);
} }

View File

@@ -45,7 +45,7 @@ class CommentContext implements Context {
*/ */
public function updateACommentWithContentOnTheCard($content) { public function updateACommentWithContentOnTheCard($content) {
$card = $this->boardContext->getLastUsedCard(); $card = $this->boardContext->getLastUsedCard();
$this->requestContext->sendOCSRequest('PUT', '/apps/deck/api/v1.0/cards/' . $card['id'] . '/comments/'. $this->lastComment['id'], [ $this->requestContext->sendOCSRequest('PUT', '/apps/deck/api/v1.0/cards/' . $card['id'] . '/comments/' . $this->lastComment['id'], [
'message' => $content, 'message' => $content,
'parentId' => null 'parentId' => null
]); ]);
@@ -56,7 +56,7 @@ class CommentContext implements Context {
*/ */
public function deleteTheCommentOnTheCard() { public function deleteTheCommentOnTheCard() {
$card = $this->boardContext->getLastUsedCard(); $card = $this->boardContext->getLastUsedCard();
$this->requestContext->sendOCSRequest('DELETE', '/apps/deck/api/v1.0/cards/' . $card['id'] . '/comments/'. $this->lastComment['id']); $this->requestContext->sendOCSRequest('DELETE', '/apps/deck/api/v1.0/cards/' . $card['id'] . '/comments/' . $this->lastComment['id']);
} }
} }

View File

@@ -103,13 +103,13 @@ class ActivityManagerTest extends TestCase {
if ($format !== '') { if ($format !== '') {
$this->assertStringContainsString('{user}', $format); $this->assertStringContainsString('{user}', $format);
} else { } else {
self::addWarning('No activity string found for '. $constant); self::addWarning('No activity string found for ' . $constant);
} }
$format = $this->activityManager->getActivityFormat('cz', $value, [], true); $format = $this->activityManager->getActivityFormat('cz', $value, [], true);
if ($format !== '') { if ($format !== '') {
$this->assertStringStartsWith('You', $format); $this->assertStringStartsWith('You', $format);
} else { } else {
self::addWarning('No own activity string found for '. $constant); self::addWarning('No own activity string found for ' . $constant);
} }
} }
} }

View File

@@ -220,7 +220,7 @@ class NotifierTest extends \Test\TestCase {
->with('otheruser') ->with('otheruser')
->willReturn($user); ->willReturn($user);
$expectedMessage = 'The card "Card title" on "Board title" has been assigned to you by '.$dn.'.'; $expectedMessage = 'The card "Card title" on "Board title" has been assigned to you by ' . $dn . '.';
$notification->expects($this->once()) $notification->expects($this->once())
->method('setParsedSubject') ->method('setParsedSubject')
->with($expectedMessage); ->with($expectedMessage);
@@ -304,7 +304,7 @@ class NotifierTest extends \Test\TestCase {
->with('otheruser') ->with('otheruser')
->willReturn($user); ->willReturn($user);
$expectedMessage = 'The board "Board title" has been shared with you by '.$dn.'.'; $expectedMessage = 'The board "Board title" has been shared with you by ' . $dn . '.';
$notification->expects($this->once()) $notification->expects($this->once())
->method('setParsedSubject') ->method('setParsedSubject')
->with($expectedMessage); ->with($expectedMessage);