diff --git a/composer.lock b/composer.lock
index 07aced933..9a4ff4530 100644
--- a/composer.lock
+++ b/composer.lock
@@ -399,16 +399,16 @@
},
{
"name": "nextcloud/coding-standard",
- "version": "v1.2.1",
+ "version": "v1.2.3",
"source": {
"type": "git",
"url": "https://github.com/nextcloud/coding-standard.git",
- "reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e"
+ "reference": "bc9c53a5306114b60c4363057aff9c2ed10a54da"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e",
- "reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e",
+ "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/bc9c53a5306114b60c4363057aff9c2ed10a54da",
+ "reference": "bc9c53a5306114b60c4363057aff9c2ed10a54da",
"shasum": ""
},
"require": {
@@ -434,9 +434,9 @@
"description": "Nextcloud coding standards for the php cs fixer",
"support": {
"issues": "https://github.com/nextcloud/coding-standard/issues",
- "source": "https://github.com/nextcloud/coding-standard/tree/v1.2.1"
+ "source": "https://github.com/nextcloud/coding-standard/tree/v1.2.3"
},
- "time": "2024-02-01T14:54:37+00:00"
+ "time": "2024-08-23T14:32:32+00:00"
},
{
"name": "nextcloud/ocp",
@@ -661,16 +661,16 @@
},
{
"name": "php-cs-fixer/shim",
- "version": "v3.49.0",
+ "version": "v3.62.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/shim.git",
- "reference": "f7d3219cac46632f12362c9aa7c2ac0d2fe92c52"
+ "reference": "7a91d5ce45c486f5b445d95901228507a02f60ae"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/f7d3219cac46632f12362c9aa7c2ac0d2fe92c52",
- "reference": "f7d3219cac46632f12362c9aa7c2ac0d2fe92c52",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/7a91d5ce45c486f5b445d95901228507a02f60ae",
+ "reference": "7a91d5ce45c486f5b445d95901228507a02f60ae",
"shasum": ""
},
"require": {
@@ -707,9 +707,9 @@
"description": "A tool to automatically fix PHP code style",
"support": {
"issues": "https://github.com/PHP-CS-Fixer/shim/issues",
- "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.49.0"
+ "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.62.0"
},
- "time": "2024-02-02T00:42:09+00:00"
+ "time": "2024-08-07T17:03:46+00:00"
},
{
"name": "phpunit/php-code-coverage",
diff --git a/lib/Activity/Filter.php b/lib/Activity/Filter.php
index 82f0b8aeb..182bc910c 100644
--- a/lib/Activity/Filter.php
+++ b/lib/Activity/Filter.php
@@ -39,8 +39,8 @@ public function getName(): string {
/**
* @return int whether the filter should be rather on the top or bottom of
- * the admin section. The filters are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The filters are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
* @since 11.0.0
*/
public function getPriority(): int {
diff --git a/lib/Activity/SettingBase.php b/lib/Activity/SettingBase.php
index acee7a374..3f0bac7e0 100644
--- a/lib/Activity/SettingBase.php
+++ b/lib/Activity/SettingBase.php
@@ -47,8 +47,8 @@ public function getName(): string {
/**
* @return int whether the filter should be rather on the top or bottom of
- * the admin section. The filters are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The filters are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
* @since 11.0.0
*/
public function getPriority(): int {
diff --git a/lib/Activity/SettingChanges.php b/lib/Activity/SettingChanges.php
index 40ce101ff..c8850a14f 100644
--- a/lib/Activity/SettingChanges.php
+++ b/lib/Activity/SettingChanges.php
@@ -25,8 +25,8 @@ public function getName(): string {
/**
* @return int whether the filter should be rather on the top or bottom of
- * the admin section. The filters are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The filters are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
* @since 11.0.0
*/
public function getPriority(): int {
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
index b2c0b83eb..597c8f55c 100644
--- a/lib/AppInfo/Application.php
+++ b/lib/AppInfo/Application.php
@@ -176,7 +176,7 @@ public function registerCommentsEntity(IEventDispatcher $eventDispatcher): void
$permissionService = $this->getContainer()->get(PermissionService::class);
try {
- return $permissionService->checkPermission($cardMapper, (int) $name, Acl::PERMISSION_READ);
+ return $permissionService->checkPermission($cardMapper, (int)$name, Acl::PERMISSION_READ);
} catch (\Exception $e) {
return false;
}
diff --git a/lib/Capabilities.php b/lib/Capabilities.php
index 542480d3e..f82a817e7 100644
--- a/lib/Capabilities.php
+++ b/lib/Capabilities.php
@@ -14,7 +14,7 @@ class Capabilities implements ICapability {
/** @var IAppManager */
private $appManager;
- /** @var PermissionService */
+ /** @var PermissionService */
private $permissionService;
diff --git a/lib/Command/TransferOwnership.php b/lib/Command/TransferOwnership.php
index a126178c3..392be112f 100644
--- a/lib/Command/TransferOwnership.php
+++ b/lib/Command/TransferOwnership.php
@@ -72,17 +72,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int
try {
$board = $boardId ? $this->boardMapper->find($boardId) : null;
} catch (\Exception $e) {
- $output->writeln("Could not find a board for the provided id.");
+ $output->writeln('Could not find a board for the provided id.');
return 1;
}
if ($boardId !== null && $board->getOwner() !== $owner) {
- $output->writeln("$owner is not the owner of the board $boardId (" . $board->getTitle() . ")");
+ $output->writeln("$owner is not the owner of the board $boardId (" . $board->getTitle() . ')');
return 1;
}
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");
}
@@ -94,12 +94,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if ($boardId) {
$this->boardService->transferBoardOwnership($boardId, $newOwner, $remapAssignment);
- $output->writeln("Board " . $board->getTitle() . " from ". $board->getOwner() ." transferred to $newOwner completed");
+ $output->writeln('Board ' . $board->getTitle() . ' from '. $board->getOwner() ." transferred to $newOwner completed");
return 0;
}
foreach ($this->boardService->transferOwnership($owner, $newOwner, $remapAssignment) as $board) {
- $output->writeln(" - " . $board->getTitle() . " transferred");
+ $output->writeln(' - ' . $board->getTitle() . ' transferred');
}
$output->writeln("All boards from $owner to $newOwner transferred");
diff --git a/lib/DAV/Calendar.php b/lib/DAV/Calendar.php
index 7ced87d83..64980a9ab 100644
--- a/lib/DAV/Calendar.php
+++ b/lib/DAV/Calendar.php
@@ -25,7 +25,7 @@ class Calendar extends ExternalCalendar {
private $children;
/** @var DeckCalendarBackend */
private $backend;
- /** @var Board */
+ /** @var Board */
private $board;
public function __construct(string $principalUri, string $calendarUri, Board $board, DeckCalendarBackend $backend) {
diff --git a/lib/Db/AclMapper.php b/lib/Db/AclMapper.php
index 80b7eaac9..5c46d468c 100644
--- a/lib/Db/AclMapper.php
+++ b/lib/Db/AclMapper.php
@@ -75,7 +75,7 @@ public function findBoardId($id): ?int {
try {
$entity = $this->find($id);
return $entity->getBoardId();
- } catch (DoesNotExistException | MultipleObjectsReturnedException $e) {
+ } catch (DoesNotExistException|MultipleObjectsReturnedException $e) {
}
return null;
}
diff --git a/lib/Db/AttachmentMapper.php b/lib/Db/AttachmentMapper.php
index 09decd19a..4e9aa1649 100644
--- a/lib/Db/AttachmentMapper.php
+++ b/lib/Db/AttachmentMapper.php
@@ -61,9 +61,9 @@ public function find($id) {
public function findByData($cardId, $data) {
$qb = $this->db->getQueryBuilder();
$qb->select('*')
- ->from($this->getTableName())
- ->where($qb->expr()->eq('card_id', $qb->createNamedParameter($cardId, IQueryBuilder::PARAM_INT)))
- ->andWhere($qb->expr()->eq('data', $qb->createNamedParameter($data, IQueryBuilder::PARAM_STR)));
+ ->from($this->getTableName())
+ ->where($qb->expr()->eq('card_id', $qb->createNamedParameter($cardId, IQueryBuilder::PARAM_INT)))
+ ->andWhere($qb->expr()->eq('data', $qb->createNamedParameter($data, IQueryBuilder::PARAM_STR)));
return $this->findEntity($qb);
}
diff --git a/lib/Db/Card.php b/lib/Db/Card.php
index 966cc7be4..6813c0167 100644
--- a/lib/Db/Card.php
+++ b/lib/Db/Card.php
@@ -165,7 +165,7 @@ public function getDaysUntilDue(): ?int {
$matchDate->setTime(0, 0);
$diff = $today->diff($matchDate);
- return (int) $diff->format('%R%a'); // Extract days count in interval
+ return (int)$diff->format('%R%a'); // Extract days count in interval
}
public function getCalendarPrefix(): string {
diff --git a/lib/Db/CardMapper.php b/lib/Db/CardMapper.php
index 64a0f5a1b..f0d16b56b 100644
--- a/lib/Db/CardMapper.php
+++ b/lib/Db/CardMapper.php
@@ -410,7 +410,7 @@ private function extendQueryByFilter(IQueryBuilder $qb, SearchQuery $query) {
foreach ($query->getDuedate() as $duedate) {
$dueDateColumn = $this->databaseType === 'sqlite3' ? $qb->createFunction('DATETIME(`c`.`duedate`)') : 'c.duedate';
$date = $duedate->getValue();
- if ($date === "") {
+ if ($date === '') {
$qb->andWhere($qb->expr()->isNotNull('c.duedate'));
continue;
}
@@ -461,7 +461,7 @@ private function extendQueryByFilter(IQueryBuilder $qb, SearchQuery $query) {
foreach ($query->getAssigned() as $index => $assignment) {
$qb->innerJoin('c', 'deck_assigned_users', 'au' . $index, $qb->expr()->eq('c.id', 'au' . $index . '.card_id'));
$assignedQueryValue = $assignment->getValue();
- if ($assignedQueryValue === "") {
+ if ($assignedQueryValue === '') {
$qb->andWhere($qb->expr()->isNotNull('au' . $index . '.participant'));
continue;
}
@@ -589,7 +589,7 @@ public function findBoardId($id): ?int {
}
$this->cache->set('findBoardId:' . $id, $result);
}
- return $result !== false ? (int) $result : null;
+ return $result !== false ? (int)$result : null;
}
public function mapOwner(Card &$card) {
diff --git a/lib/Middleware/ExceptionMiddleware.php b/lib/Middleware/ExceptionMiddleware.php
index 6da9dd5ca..d026c2b1e 100644
--- a/lib/Middleware/ExceptionMiddleware.php
+++ b/lib/Middleware/ExceptionMiddleware.php
@@ -89,7 +89,7 @@ public function afterException($controller, $methodName, \Exception $exception)
];
$this->logger->error($exception->getMessage(), ['exception' => $exception]);
if ($debugMode === true) {
- $response['exception'] = (array) $exception;
+ $response['exception'] = (array)$exception;
}
return new JSONResponse($response, 500);
}
diff --git a/lib/Notification/NotificationHelper.php b/lib/Notification/NotificationHelper.php
index 652d79ea9..6d37b3820 100644
--- a/lib/Notification/NotificationHelper.php
+++ b/lib/Notification/NotificationHelper.php
@@ -142,11 +142,11 @@ public function sendCardAssigned(Card $card, string $userId): void {
->setUser($userId)
->setDateTime(new DateTime())
->setObject('card', (string)$card->getId())
- ->setSubject('card-assigned', [
- $card->getTitle(),
- $board->getTitle(),
- $this->currentUser
- ]);
+ ->setSubject('card-assigned', [
+ $card->getTitle(),
+ $board->getTitle(),
+ $this->currentUser
+ ]);
$this->notificationManager->notify($notification);
}
@@ -206,9 +206,9 @@ public function sendMention(IComment $comment): void {
$notification = $this->notificationManager->createNotification();
$notification
->setApp('deck')
- ->setUser((string) $mention['id'])
+ ->setUser((string)$mention['id'])
->setDateTime(new DateTime())
- ->setObject('card', (string) $card->getId())
+ ->setObject('card', (string)$card->getId())
->setSubject('card-comment-mentioned', [$card->getTitle(), $boardId, $this->currentUser])
->setMessage('{message}', ['message' => $comment->getMessage()]);
$this->notificationManager->notify($notification);
diff --git a/lib/Reference/BoardReferenceProvider.php b/lib/Reference/BoardReferenceProvider.php
index 7f07684f1..f7579a6c2 100644
--- a/lib/Reference/BoardReferenceProvider.php
+++ b/lib/Reference/BoardReferenceProvider.php
@@ -97,7 +97,7 @@ private function getBoardId(string $url): ?int {
preg_match('/^' . preg_quote($startIndex, '/') . '(?:\/#!?)?\/board\/([0-9]+)$/', $url, $matches);
}
if ($matches && count($matches) > 1) {
- return (int) $matches[1];
+ return (int)$matches[1];
}
return null;
@@ -106,7 +106,7 @@ private function getBoardId(string $url): ?int {
public function getCachePrefix(string $referenceId): string {
$boardId = $this->getBoardId($referenceId);
if ($boardId !== null) {
- return (string) $boardId;
+ return (string)$boardId;
}
return $referenceId;
diff --git a/lib/Reference/CardReferenceProvider.php b/lib/Reference/CardReferenceProvider.php
index 4abb51bce..e196f2824 100644
--- a/lib/Reference/CardReferenceProvider.php
+++ b/lib/Reference/CardReferenceProvider.php
@@ -111,9 +111,9 @@ public function resolveReference(string $referenceText): ?IReference {
if ($ids !== null) {
[, $cardId] = $ids;
try {
- $card = $this->cardService->find((int) $cardId)->jsonSerialize();
- $stack = $this->stackService->find((int) $card['stackId'])->jsonSerialize();
- $board = $this->boardService->find((int) $stack['boardId'])->jsonSerialize();
+ $card = $this->cardService->find((int)$cardId)->jsonSerialize();
+ $stack = $this->stackService->find((int)$card['stackId'])->jsonSerialize();
+ $board = $this->boardService->find((int)$stack['boardId'])->jsonSerialize();
} catch (NoPermissionException $e) {
// Skip throwing if user has no permissions
return null;
diff --git a/lib/Reference/CommentReferenceProvider.php b/lib/Reference/CommentReferenceProvider.php
index 0743af527..aae02b9e5 100644
--- a/lib/Reference/CommentReferenceProvider.php
+++ b/lib/Reference/CommentReferenceProvider.php
@@ -73,7 +73,7 @@ public function resolveReference(string $referenceText): ?IReference {
try {
$card = $this->cardService->find($cardId)->jsonSerialize();
$board = $this->boardService->find($boardId)->jsonSerialize();
- $stack = $this->stackService->find((int) $card['stackId'])->jsonSerialize();
+ $stack = $this->stackService->find((int)$card['stackId'])->jsonSerialize();
} catch (NoPermissionException $e) {
// Skip throwing if user has no permissions
return null;
@@ -162,9 +162,9 @@ private function getIds(string $url): ?array {
}
if ($matches && count($matches) > 3) {
return [
- (int) $matches[1],
- (int) $matches[2],
- (int) $matches[3],
+ (int)$matches[1],
+ (int)$matches[2],
+ (int)$matches[3],
];
}
diff --git a/lib/Service/CommentService.php b/lib/Service/CommentService.php
index 47980a051..50b33ff56 100644
--- a/lib/Service/CommentService.php
+++ b/lib/Service/CommentService.php
@@ -65,8 +65,8 @@ public function list(string $cardId, int $limit = 20, int $offset = 0): DataResp
private function get(int $cardId, int $commentId): IComment {
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_READ);
try {
- $comment = $this->commentsManager->get((string) $commentId);
- if ($comment->getObjectType() !== Application::COMMENT_ENTITY_TYPE || (int) $comment->getObjectId() !== $cardId) {
+ $comment = $this->commentsManager->get((string)$commentId);
+ if ($comment->getObjectType() !== Application::COMMENT_ENTITY_TYPE || (int)$comment->getObjectId() !== $cardId) {
throw new CommentNotFoundException();
}
} catch (CommentNotFoundException $e) {
@@ -134,7 +134,7 @@ public function update(string $cardId, string $commentId, string $message): Data
if (!is_numeric($commentId)) {
throw new BadRequestException('A valid comment id must be provided');
}
- $comment = $this->get((int) $cardId, (int) $commentId);
+ $comment = $this->get((int)$cardId, (int)$commentId);
if ($comment->getActorType() !== 'users' || $comment->getActorId() !== $this->userId) {
throw new NoPermissionException('Only authors are allowed to edit their comment.');
}
diff --git a/lib/Service/Importer/BoardImportService.php b/lib/Service/Importer/BoardImportService.php
index 0251fd1c2..d22f78c87 100644
--- a/lib/Service/Importer/BoardImportService.php
+++ b/lib/Service/Importer/BoardImportService.php
@@ -404,7 +404,7 @@ public function getData(): \stdClass {
* @return void
*/
public function setConfig(string $configName, $value): void {
- if (empty((array) $this->config)) {
+ if (empty((array)$this->config)) {
$this->setConfigInstance(new \stdClass);
}
$this->config->$configName = $value;
diff --git a/lib/Service/Importer/Systems/DeckJsonService.php b/lib/Service/Importer/Systems/DeckJsonService.php
index 2bb531e88..677f09036 100644
--- a/lib/Service/Importer/Systems/DeckJsonService.php
+++ b/lib/Service/Importer/Systems/DeckJsonService.php
@@ -51,7 +51,7 @@ public function validateUsers(): void {
if (!is_string($nextcloudUid) && !is_numeric($nextcloudUid)) {
throw new \LogicException('User on setting uidRelation is invalid');
}
- $nextcloudUid = (string) $nextcloudUid;
+ $nextcloudUid = (string)$nextcloudUid;
$this->getImportService()->getConfig('uidRelation')->$exportUid = $this->userManager->get($nextcloudUid);
if (!$this->getImportService()->getConfig('uidRelation')->$exportUid) {
throw new \LogicException('User on setting uidRelation not found: ' . $nextcloudUid);
@@ -106,7 +106,7 @@ public function getCardAssignments(): array {
public function getComments(): array {
$comments = [];
foreach ($this->tmpCards as $sourceCard) {
- if (!property_exists($sourceCard, "comments")) {
+ if (!property_exists($sourceCard, 'comments')) {
continue;
}
$commentsOriginal = $sourceCard->comments;
diff --git a/lib/Service/Importer/Systems/TrelloJsonService.php b/lib/Service/Importer/Systems/TrelloJsonService.php
index a48b8ffe6..d9b255eb9 100644
--- a/lib/Service/Importer/Systems/TrelloJsonService.php
+++ b/lib/Service/Importer/Systems/TrelloJsonService.php
@@ -71,7 +71,7 @@ public function validateUsers(): void {
if (!is_string($nextcloudUid) && !is_numeric($nextcloudUid)) {
throw new \LogicException('User on setting uidRelation is invalid');
}
- $nextcloudUid = (string) $nextcloudUid;
+ $nextcloudUid = (string)$nextcloudUid;
$this->getImportService()->getConfig('uidRelation')->$trelloUid = $this->userManager->get($nextcloudUid);
if (!$this->getImportService()->getConfig('uidRelation')->$trelloUid) {
throw new \LogicException('User on setting uidRelation not found: ' . $nextcloudUid);
@@ -141,7 +141,7 @@ function (\stdClass $a) use ($trelloCard) {
$message = $this->l10n->t(
"This comment has more than %s characters.\n" .
"Added as an attachment to the card with name %s.\n" .
- "Accessible on URL: %s.",
+ 'Accessible on URL: %s.',
[
IComment::MAX_MESSAGE_LENGTH,
'comment_' . $commentId . '.md',
diff --git a/lib/Service/PermissionService.php b/lib/Service/PermissionService.php
index eec3474c3..3f2fcb61d 100644
--- a/lib/Service/PermissionService.php
+++ b/lib/Service/PermissionService.php
@@ -143,7 +143,7 @@ public function userIsBoardOwner($boardId, $userId = null) {
try {
$board = $this->getBoard($boardId);
return $userId === $board->getOwner();
- } catch (DoesNotExistException | MultipleObjectsReturnedException $e) {
+ } catch (DoesNotExistException|MultipleObjectsReturnedException $e) {
}
return false;
}
@@ -205,8 +205,8 @@ public function userCan(array $acls, $permission, $userId = null) {
*/
public function findUsers($boardId, $refresh = false) {
// cache users of a board so we don't query them for every cards
- if (array_key_exists((string) $boardId, $this->users) && !$refresh) {
- return $this->users[(string) $boardId];
+ if (array_key_exists((string)$boardId, $this->users) && !$refresh) {
+ return $this->users[(string)$boardId];
}
try {
@@ -269,8 +269,8 @@ public function findUsers($boardId, $refresh = false) {
}
}
}
- $this->users[(string) $boardId] = $users;
- return $this->users[(string) $boardId];
+ $this->users[(string)$boardId] = $users;
+ return $this->users[(string)$boardId];
}
public function canCreate() {
diff --git a/lib/Sharing/DeckShareProvider.php b/lib/Sharing/DeckShareProvider.php
index dc86ddd34..c882caadb 100644
--- a/lib/Sharing/DeckShareProvider.php
+++ b/lib/Sharing/DeckShareProvider.php
@@ -110,7 +110,7 @@ public function create(IShare $share) {
try {
$board = $this->boardMapper->find($boardId);
$valid = $valid && !$board->getArchived();
- } catch (DoesNotExistException | MultipleObjectsReturnedException $e) {
+ } catch (DoesNotExistException|MultipleObjectsReturnedException $e) {
$valid = false;
}
@@ -966,8 +966,8 @@ public function getAccessList($nodes, $currentAccess) {
protected function filterSharesOfUser(array $shares): array {
// Deck shares when the user has a share exception
foreach ($shares as $id => $share) {
- $type = (int) $share['share_type'];
- $permissions = (int) $share['permissions'];
+ $type = (int)$share['share_type'];
+ $permissions = (int)$share['permissions'];
if ($type === self::SHARE_TYPE_DECK_USER) {
unset($shares[$share['parent']]);
diff --git a/lib/Validators/BaseValidator.php b/lib/Validators/BaseValidator.php
index 54e72ed23..8c1d0c1c6 100644
--- a/lib/Validators/BaseValidator.php
+++ b/lib/Validators/BaseValidator.php
@@ -45,7 +45,7 @@ private function validate($data) {
} else {
if (!$this->{$rule}($value)) {
throw new BadRequestException(
- $field . ' must be provided and must be '. str_replace("_", " ", $rule));
+ $field . ' must be provided and must be '. str_replace('_', ' ', $rule));
}
}
}
@@ -111,7 +111,7 @@ private function not_empty($value): bool {
*/
private function max($value, $limit): bool {
if (!$limit || !is_numeric($limit)) {
- throw new Exception("Validation rule max requires at least 1 parameter. " . json_encode($limit));
+ throw new Exception('Validation rule max requires at least 1 parameter. ' . json_encode($limit));
}
return $this->getSize($value) <= $limit;
}
@@ -121,7 +121,7 @@ private function max($value, $limit): bool {
*/
private function min($value, $limit): bool {
if (!$limit || !is_numeric($limit)) {
- throw new Exception("Validation rule max requires at least 1 parameter.");
+ throw new Exception('Validation rule max requires at least 1 parameter.');
}
return $this->getSize($value) >= $limit;
}
@@ -129,7 +129,7 @@ private function min($value, $limit): bool {
/**
* Get the size of an attribute.
*
- * @param mixed $value
+ * @param mixed $value
* @return int
*/
protected function getSize($value): int {
@@ -158,6 +158,6 @@ protected function getErrorMessage($rule, $field, $parameter = null): string {
: $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);
}
}
diff --git a/tests/integration/database/BoardDatabaseTest.php b/tests/integration/database/BoardDatabaseTest.php
index 8a0dd1a43..9b8ea0c35 100644
--- a/tests/integration/database/BoardDatabaseTest.php
+++ b/tests/integration/database/BoardDatabaseTest.php
@@ -31,11 +31,11 @@
* @group DB
*/
class BoardDatabaseTest extends \Test\TestCase {
- public const TEST_USER1 = "test-share-user1";
- public const TEST_USER2 = "test-share-user2";
- public const TEST_USER3 = "test-share-user3";
- public const TEST_USER4 = "test-share-user4";
- public const TEST_GROUP1 = "test-share-group1";
+ public const TEST_USER1 = 'test-share-user1';
+ public const TEST_USER2 = 'test-share-user2';
+ public const TEST_USER3 = 'test-share-user3';
+ public const TEST_USER4 = 'test-share-user4';
+ public const TEST_GROUP1 = 'test-share-group1';
/** @var BoardService */
private $boardService;
diff --git a/tests/integration/features/bootstrap/BoardContext.php b/tests/integration/features/bootstrap/BoardContext.php
index 4f59b2cf7..1e4043742 100644
--- a/tests/integration/features/bootstrap/BoardContext.php
+++ b/tests/integration/features/bootstrap/BoardContext.php
@@ -71,7 +71,7 @@ public function fetchesTheBoardNamed($boardName) {
break;
}
}
- Assert::assertNotNull($id, "Could not find board named ".$boardName);
+ Assert::assertNotNull($id, 'Could not find board named '.$boardName);
} else {
$id = $this->board['id'];
}
diff --git a/tests/integration/features/bootstrap/SearchContext.php b/tests/integration/features/bootstrap/SearchContext.php
index 127255d01..ba0e7291d 100644
--- a/tests/integration/features/bootstrap/SearchContext.php
+++ b/tests/integration/features/bootstrap/SearchContext.php
@@ -36,7 +36,7 @@ public function searchingFor(string $term) {
/**
* @When /^searching for "([^"]*)" in comments in unified search$/
* @param string $term
- * https://cloud.nextcloud.com/ocs/v2.php/search/providers/talk-conversations/search?term=an&from=%2Fapps%2Fdashboard%2F
+ * https://cloud.nextcloud.com/ocs/v2.php/search/providers/talk-conversations/search?term=an&from=%2Fapps%2Fdashboard%2F
*/
public function searchingForComments(string $term) {
$this->requestContext->sendOCSRequest('GET', '/search/providers/search-deck-comment/search?term=' . urlencode($term), []);
diff --git a/tests/integration/features/bootstrap/SessionContext.php b/tests/integration/features/bootstrap/SessionContext.php
index b26b221a3..2351d1889 100644
--- a/tests/integration/features/bootstrap/SessionContext.php
+++ b/tests/integration/features/bootstrap/SessionContext.php
@@ -32,7 +32,7 @@ public function opensTheBoardNamed($name) {
'boardId' => $board['id'],
]);
$res = json_decode((string)$this->getResponse()->getBody(), true);
- Assert::assertArrayHasKey('token', $res['ocs']['data'], "session creation did not respond with a token");
+ Assert::assertArrayHasKey('token', $res['ocs']['data'], 'session creation did not respond with a token');
// store token
$user = $this->serverContext->getCurrentUser();
@@ -44,7 +44,7 @@ public function opensTheBoardNamed($name) {
*/
public function theResponseShouldHaveActiveSessions($length) {
$board = $this->boardContext->getLastUsedBoard();
- Assert::assertEquals($length, count($board['activeSessions']), "unexpected count of active sessions");
+ Assert::assertEquals($length, count($board['activeSessions']), 'unexpected count of active sessions');
}
/**
@@ -52,7 +52,7 @@ public function theResponseShouldHaveActiveSessions($length) {
*/
public function theUserShouldBeInTheListOfActiveSessions($user) {
$board = $this->boardContext->getLastUsedBoard();
- Assert::assertContains($user, $board['activeSessions'], "user is not found in the list of active sessions");
+ Assert::assertContains($user, $board['activeSessions'], 'user is not found in the list of active sessions');
}
/**
@@ -67,7 +67,7 @@ public function closingTheBoardNamed($name) {
$user = $this->serverContext->getCurrentUser();
$token = $this->tokens[$user];
- Assert::assertNotEmpty($token, "no token for the user found");
+ Assert::assertNotEmpty($token, 'no token for the user found');
$this->requestContext->sendOCSRequest('POST', '/apps/deck/api/v1.0/session/close', [
'boardId' => $board['id'],
'token' => $token
diff --git a/tests/unit/Command/UserExportTest.php b/tests/unit/Command/UserExportTest.php
index 80907ca72..1069600aa 100644
--- a/tests/unit/Command/UserExportTest.php
+++ b/tests/unit/Command/UserExportTest.php
@@ -88,8 +88,8 @@ public function getCard($id) {
public function getComment($id) {
$comment = new Comment();
- $comment->setActor("users", "admin");
- $comment->setMessage("fake comment" . $id);
+ $comment->setActor('users', 'admin');
+ $comment->setMessage('fake comment' . $id);
return $comment;
}
public function testExecute() {
diff --git a/tests/unit/Db/AclTest.php b/tests/unit/Db/AclTest.php
index bffcdda93..899ec73c1 100644
--- a/tests/unit/Db/AclTest.php
+++ b/tests/unit/Db/AclTest.php
@@ -27,7 +27,7 @@ class AclTest extends \Test\TestCase {
private function createAclUser() {
$acl = new Acl();
$acl->setId(1);
- $acl->setParticipant("admin");
+ $acl->setParticipant('admin');
$acl->setType(Acl::PERMISSION_TYPE_USER);
$acl->setBoardId(1);
$acl->setPermissionEdit(true);
@@ -39,7 +39,7 @@ private function createAclUser() {
private function createAclGroup() {
$acl = new Acl();
$acl->setId(1);
- $acl->setParticipant("administrators");
+ $acl->setParticipant('administrators');
$acl->setType(Acl::PERMISSION_TYPE_GROUP);
$acl->setBoardId(1);
$acl->setPermissionEdit(true);
diff --git a/tests/unit/Db/AttachmentTest.php b/tests/unit/Db/AttachmentTest.php
index a17185eaa..dcda496b2 100644
--- a/tests/unit/Db/AttachmentTest.php
+++ b/tests/unit/Db/AttachmentTest.php
@@ -28,7 +28,7 @@ private function createAttachment() {
$attachment = new Attachment();
$attachment->setId(1);
$attachment->setCardId(123);
- $attachment->setData("blob");
+ $attachment->setData('blob');
$attachment->setCreatedBy('admin');
$attachment->setType('deck_file');
return $attachment;
diff --git a/tests/unit/Db/BoardTest.php b/tests/unit/Db/BoardTest.php
index 57f2492ad..9a59dbcd8 100644
--- a/tests/unit/Db/BoardTest.php
+++ b/tests/unit/Db/BoardTest.php
@@ -8,9 +8,9 @@ class BoardTest extends TestCase {
private function createBoard() {
$board = new Board();
$board->setId(1);
- $board->setTitle("My Board");
- $board->setOwner("admin");
- $board->setColor("000000");
+ $board->setTitle('My Board');
+ $board->setOwner('admin');
+ $board->setColor('000000');
$board->setArchived(false);
// TODO: relation shared labels acl
return $board;
@@ -20,9 +20,9 @@ public function testJsonSerialize() {
$board->setUsers(['user1', 'user2']);
$this->assertEquals([
'id' => 1,
- 'title' => "My Board",
- 'owner' => "admin",
- 'color' => "000000",
+ 'title' => 'My Board',
+ 'owner' => 'admin',
+ 'color' => '000000',
'labels' => [],
'permissions' => [],
'stacks' => [],
@@ -44,9 +44,9 @@ public function testUnfetchedValues() {
self::assertNull($board->getLabels());
$this->assertEquals([
'id' => 1,
- 'title' => "My Board",
- 'owner' => "admin",
- 'color' => "000000",
+ 'title' => 'My Board',
+ 'owner' => 'admin',
+ 'color' => '000000',
'labels' => [],
'permissions' => [],
'stacks' => [],
@@ -63,13 +63,13 @@ public function testUnfetchedValues() {
public function testSetLabels() {
$board = $this->createBoard();
- $board->setLabels(["foo", "bar"]);
+ $board->setLabels(['foo', 'bar']);
$this->assertEquals([
'id' => 1,
- 'title' => "My Board",
- 'owner' => "admin",
- 'color' => "000000",
- 'labels' => ["foo", "bar"],
+ 'title' => 'My Board',
+ 'owner' => 'admin',
+ 'color' => '000000',
+ 'labels' => ['foo', 'bar'],
'permissions' => [],
'stacks' => [],
'deletedAt' => 0,
@@ -95,9 +95,9 @@ public function testSetShared() {
$board->setShared(1);
$this->assertEquals([
'id' => 1,
- 'title' => "My Board",
- 'owner' => "admin",
- 'color' => "000000",
+ 'title' => 'My Board',
+ 'owner' => 'admin',
+ 'color' => '000000',
'labels' => [],
'permissions' => [],
'stacks' => [],
diff --git a/tests/unit/Db/CardTest.php b/tests/unit/Db/CardTest.php
index 794255a46..f38549f8c 100644
--- a/tests/unit/Db/CardTest.php
+++ b/tests/unit/Db/CardTest.php
@@ -32,13 +32,13 @@ class CardTest extends TestCase {
private function createCard() {
$card = new Card();
$card->setId(1);
- $card->setTitle("My Card");
- $card->setDescription("a long description");
+ $card->setTitle('My Card');
+ $card->setDescription('a long description');
$card->setStackId(1);
$card->setType('text');
$card->setLastModified(234);
$card->setCreatedAt(123);
- $card->setOwner("admin");
+ $card->setOwner('admin');
$card->setOrder(12);
$card->setArchived(false);
$card->setDone(null);
@@ -68,8 +68,8 @@ public function testJsonSerialize() {
$card = $this->createCard();
$this->assertEquals([
'id' => 1,
- 'title' => "My Card",
- 'description' => "a long description",
+ 'title' => 'My Card',
+ 'description' => 'a long description',
'type' => 'text',
'lastModified' => 234,
'createdAt' => 123,
@@ -96,8 +96,8 @@ public function testJsonSerializeLabels() {
$card->setLabels([]);
$this->assertEquals([
'id' => 1,
- 'title' => "My Card",
- 'description' => "a long description",
+ 'title' => 'My Card',
+ 'description' => 'a long description',
'type' => 'text',
'lastModified' => 234,
'createdAt' => 123,
@@ -126,8 +126,8 @@ public function testJsonSerializeAsignedUsers() {
$card->setLabels([]);
$this->assertEquals([
'id' => 1,
- 'title' => "My Card",
- 'description' => "a long description",
+ 'title' => 'My Card',
+ 'description' => 'a long description',
'type' => 'text',
'lastModified' => 234,
'createdAt' => 123,
diff --git a/tests/unit/Db/LabelTest.php b/tests/unit/Db/LabelTest.php
index ee8a370a1..3c1d50594 100644
--- a/tests/unit/Db/LabelTest.php
+++ b/tests/unit/Db/LabelTest.php
@@ -29,8 +29,8 @@ class LabelTest extends TestCase {
private function createLabel() {
$label = new Label();
$label->setId(1);
- $label->setTitle("My Label");
- $label->setColor("000000");
+ $label->setTitle('My Label');
+ $label->setColor('000000');
return $label;
}
public function testJsonSerializeBoard() {
diff --git a/tests/unit/Db/StackTest.php b/tests/unit/Db/StackTest.php
index 3ec9688e5..03364256e 100644
--- a/tests/unit/Db/StackTest.php
+++ b/tests/unit/Db/StackTest.php
@@ -27,7 +27,7 @@ class StackTest extends \Test\TestCase {
private function createStack() {
$board = new Stack();
$board->setId(1);
- $board->setTitle("My Stack");
+ $board->setTitle('My Stack');
$board->setBoardId(1);
$board->setOrder(1);
return $board;
@@ -36,7 +36,7 @@ public function testJsonSerialize() {
$stack = $this->createStack();
$this->assertEquals([
'id' => 1,
- 'title' => "My Stack",
+ 'title' => 'My Stack',
'order' => 1,
'boardId' => 1,
'deletedAt' => 0,
@@ -45,15 +45,15 @@ public function testJsonSerialize() {
], $stack->jsonSerialize());
}
public function testJsonSerializeWithCards() {
- $cards = ["foo", "bar"];
+ $cards = ['foo', 'bar'];
$stack = $this->createStack();
$stack->setCards($cards);
$this->assertEquals([
'id' => 1,
- 'title' => "My Stack",
+ 'title' => 'My Stack',
'order' => 1,
'boardId' => 1,
- 'cards' => ["foo", "bar"],
+ 'cards' => ['foo', 'bar'],
'deletedAt' => 0,
'lastModified' => 0,
'ETag' => $stack->getETag(),
diff --git a/tests/unit/Middleware/ExceptionMiddlewareTest.php b/tests/unit/Middleware/ExceptionMiddlewareTest.php
index 6d0f2f85d..123f25b25 100644
--- a/tests/unit/Middleware/ExceptionMiddlewareTest.php
+++ b/tests/unit/Middleware/ExceptionMiddlewareTest.php
@@ -69,8 +69,8 @@ public function dataAfterException() {
public function testAfterException($exception, $status, $message) {
$result = $this->exceptionMiddleware->afterException($this->controller, 'bar', $exception);
$expected = new JSONResponse([
- "status" => $status,
- "message" => $message
+ 'status' => $status,
+ 'message' => $message
], $status);
$this->assertEquals($expected, $result);
}
diff --git a/tests/unit/Notification/NotificationHelperTest.php b/tests/unit/Notification/NotificationHelperTest.php
index 4e0803dcd..7dd60a90e 100644
--- a/tests/unit/Notification/NotificationHelperTest.php
+++ b/tests/unit/Notification/NotificationHelperTest.php
@@ -60,7 +60,7 @@ class NotificationHelperTest extends \Test\TestCase {
protected $cardMapper;
/** @var BoardMapper|MockObject */
protected $boardMapper;
- /** @var AssignmentMapper|MockObject */
+ /** @var AssignmentMapper|MockObject */
protected $assignedUsersMapper;
/** @var PermissionService|MockObject */
protected $permissionService;
diff --git a/tests/unit/Service/AssignmentServiceTest.php b/tests/unit/Service/AssignmentServiceTest.php
index 5c83a10d9..8a78bc5da 100644
--- a/tests/unit/Service/AssignmentServiceTest.php
+++ b/tests/unit/Service/AssignmentServiceTest.php
@@ -78,7 +78,7 @@ class AssignmentServiceTest extends TestCase {
*/
private $assignmentService;
/**
- * @var AssignmentServiceValidator
+ * @var AssignmentServiceValidator
*/
private $assignmentServiceValidator;
diff --git a/tests/unit/Service/AttachmentServiceTest.php b/tests/unit/Service/AttachmentServiceTest.php
index 0a07cbed2..b63706622 100644
--- a/tests/unit/Service/AttachmentServiceTest.php
+++ b/tests/unit/Service/AttachmentServiceTest.php
@@ -70,7 +70,7 @@ class AttachmentServiceTest extends TestCase {
private $cardMapper;
/** @var PermissionService|MockObject */
private $permissionService;
- /** @var string */
+ /** @var string */
private $userId = 'admin';
/** @var Application|MockObject */
private $application;
@@ -79,7 +79,7 @@ class AttachmentServiceTest extends TestCase {
private $attachmentService;
/** @var MockObject */
private $attachmentServiceImpl;
- /** @var ActivityManager */
+ /** @var ActivityManager */
private $activityManager;
private $appContainer;
/** @var IL10N */
@@ -91,7 +91,7 @@ class AttachmentServiceTest extends TestCase {
*/
private $filesAppServiceImpl;
/**
- * @var AttachmentServiceValidator
+ * @var AttachmentServiceValidator
*/
private $attachmentServiceValidator;
diff --git a/tests/unit/Service/LabelServiceTest.php b/tests/unit/Service/LabelServiceTest.php
index 79c192aaf..0f27000c3 100644
--- a/tests/unit/Service/LabelServiceTest.php
+++ b/tests/unit/Service/LabelServiceTest.php
@@ -31,17 +31,17 @@
class LabelServiceTest extends TestCase {
- /** @var LabelMapper|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LabelMapper|\PHPUnit\Framework\MockObject\MockObject */
private $labelMapper;
- /** @var PermissionService|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var PermissionService|\PHPUnit\Framework\MockObject\MockObject */
private $permissionService;
- /** @var LabelService */
+ /** @var LabelService */
private $labelService;
/** @var BoardService|\PHPUnit\Framework\MockObject\MockObject */
private $boardService;
/** @var ChangeHelper|\PHPUnit\Framework\MockObject\MockObject */
private $changeHelper;
- /** @var LabelServiceValidator\MockObject */
+ /** @var LabelServiceValidator\MockObject */
private $labelServiceValidator;
public function setUp(): void {
diff --git a/tests/unit/Service/StackServiceTest.php b/tests/unit/Service/StackServiceTest.php
index 48062cc45..5244a0c50 100644
--- a/tests/unit/Service/StackServiceTest.php
+++ b/tests/unit/Service/StackServiceTest.php
@@ -212,8 +212,8 @@ public function testDelete() {
$this->stackMapper->expects($this->once())->method('update')->willReturn($stackToBeDeleted);
$this->cardMapper->expects($this->once())->method('findAll')->willReturn([]);
$this->stackService->delete(123);
- $this->assertTrue($stackToBeDeleted->getDeletedAt() <= time(), "deletedAt is in the past");
- $this->assertTrue($stackToBeDeleted->getDeletedAt() > 0, "deletedAt is set");
+ $this->assertTrue($stackToBeDeleted->getDeletedAt() <= time(), 'deletedAt is in the past');
+ $this->assertTrue($stackToBeDeleted->getDeletedAt() > 0, 'deletedAt is set');
}
public function testUpdate() {
diff --git a/tests/unit/controller/CardApiControllerTest.php b/tests/unit/controller/CardApiControllerTest.php
index dfc498173..9922906ff 100644
--- a/tests/unit/controller/CardApiControllerTest.php
+++ b/tests/unit/controller/CardApiControllerTest.php
@@ -111,8 +111,8 @@ public function testUpdate() {
$this->stackExample['id']);
$this->cardService->expects($this->once())
- ->method('update')
- ->willReturn($card);
+ ->method('update')
+ ->willReturn($card);
$expected = new DataResponse($card, HTTP::STATUS_OK);
$actual = $this->controller->update('title', 'plain', 0, 'description', $this->userId, null);