From f83290f075a3e087621eff7da41a733ef8b08280 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 04:45:12 +0000 Subject: [PATCH 1/2] Chore(deps-dev): Bump nextcloud/coding-standard from 1.1.1 to 1.2.1 Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 1.1.1 to 1.2.1. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v1.1.1...v1.2.1) --- updated-dependencies: - dependency-name: nextcloud/coding-standard dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.lock b/composer.lock index de6462f58..3439ed8d9 100644 --- a/composer.lock +++ b/composer.lock @@ -209,16 +209,16 @@ }, { "name": "nextcloud/coding-standard", - "version": "v1.1.1", + "version": "v1.2.1", "source": { "type": "git", "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb" + "reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/55def702fb9a37a219511e1d8c6fe8e37164c1fb", - "reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e", + "reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e", "shasum": "" }, "require": { @@ -244,9 +244,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.1.1" + "source": "https://github.com/nextcloud/coding-standard/tree/v1.2.1" }, - "time": "2023-06-01T12:05:01+00:00" + "time": "2024-02-01T14:54:37+00:00" }, { "name": "nextcloud/ocp", @@ -464,16 +464,16 @@ }, { "name": "php-cs-fixer/shim", - "version": "v3.40.2", + "version": "v3.49.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "f75393dc76faeecfa5fd4018531faa9b543e9d4e" + "reference": "f7d3219cac46632f12362c9aa7c2ac0d2fe92c52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/f75393dc76faeecfa5fd4018531faa9b543e9d4e", - "reference": "f75393dc76faeecfa5fd4018531faa9b543e9d4e", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/f7d3219cac46632f12362c9aa7c2ac0d2fe92c52", + "reference": "f7d3219cac46632f12362c9aa7c2ac0d2fe92c52", "shasum": "" }, "require": { @@ -510,9 +510,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.40.2" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.49.0" }, - "time": "2023-12-03T09:22:01+00:00" + "time": "2024-02-02T00:42:09+00:00" }, { "name": "phpunit/php-code-coverage", From 1fdc1644622bb8822c92fd2e22f6c5df190c024c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 5 Feb 2024 07:14:04 +0100 Subject: [PATCH 2/2] style: Apply php-cs-fixer updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Activity/CommentEventHandler.php | 2 +- lib/Activity/DeckProvider.php | 2 +- lib/Controller/BoardController.php | 2 +- lib/Controller/PageController.php | 2 +- lib/Controller/SessionController.php | 2 +- lib/Db/CardMapper.php | 6 +++--- lib/Event/CardUpdatedEvent.php | 2 +- lib/Service/ConfigService.php | 6 +++--- lib/Service/SearchService.php | 2 +- tests/integration/features/bootstrap/BoardContext.php | 4 ++-- tests/unit/Service/BoardServiceTest.php | 2 +- tests/unit/Service/DefaultBoardServiceTest.php | 2 +- tests/unit/Service/StackServiceTest.php | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/Activity/CommentEventHandler.php b/lib/Activity/CommentEventHandler.php index 47e11a9fd..3de458c10 100644 --- a/lib/Activity/CommentEventHandler.php +++ b/lib/Activity/CommentEventHandler.php @@ -23,12 +23,12 @@ namespace OCA\Deck\Activity; -use \OCP\Comments\ICommentsEventHandler; use OCA\Deck\Db\CardMapper; use OCA\Deck\Db\ChangeHelper; use OCA\Deck\Notification\NotificationHelper; use OCP\Comments\CommentsEvent; use OCP\Comments\IComment; +use OCP\Comments\ICommentsEventHandler; class CommentEventHandler implements ICommentsEventHandler { diff --git a/lib/Activity/DeckProvider.php b/lib/Activity/DeckProvider.php index 12f9be73c..db7975bfc 100644 --- a/lib/Activity/DeckProvider.php +++ b/lib/Activity/DeckProvider.php @@ -77,7 +77,7 @@ class DeckProvider implements IProvider { * @throws \InvalidArgumentException Should be thrown if your provider does not know this event * @since 11.0.0 */ - public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent { + public function parse($language, IEvent $event, ?IEvent $previousEvent = null): IEvent { if ($event->getApp() !== 'deck') { throw new \InvalidArgumentException(); } diff --git a/lib/Controller/BoardController.php b/lib/Controller/BoardController.php index 0220a43db..bcfaa6e42 100644 --- a/lib/Controller/BoardController.php +++ b/lib/Controller/BoardController.php @@ -55,7 +55,7 @@ class BoardController extends ApiController { * @param $boardId * @return \OCP\AppFramework\Db\Entity */ - public function read($boardId) { + public function read(int $boardId) { return $this->boardService->find($boardId); } diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 7c81a6093..ab45b0b4b 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -23,7 +23,6 @@ namespace OCA\Deck\Controller; -use \OCP\AppFramework\Http\RedirectResponse; use OCA\Deck\Db\Acl; use OCA\Deck\Db\CardMapper; use OCA\Deck\Service\BoardService; @@ -37,6 +36,7 @@ use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\ContentSecurityPolicy; +use OCP\AppFramework\Http\RedirectResponse; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as CollaborationResourcesEvent; diff --git a/lib/Controller/SessionController.php b/lib/Controller/SessionController.php index 4a28f0a08..918512291 100644 --- a/lib/Controller/SessionController.php +++ b/lib/Controller/SessionController.php @@ -68,7 +68,7 @@ class SessionController extends OCSController { #[NoAdminRequired] #[NoCSRFRequired] - public function close(int $boardId, string $token = null): DataResponse { + public function close(int $boardId, ?string $token = null): DataResponse { if ($token === null) { return new DataResponse(); } diff --git a/lib/Db/CardMapper.php b/lib/Db/CardMapper.php index a5d5c6f03..e12f02de9 100644 --- a/lib/Db/CardMapper.php +++ b/lib/Db/CardMapper.php @@ -313,7 +313,7 @@ class CardMapper extends QBMapper implements IPermissionMapper { return $this->findEntities($qb); } - public function search(array $boardIds, SearchQuery $query, int $limit = null, int $offset = null): array { + public function search(array $boardIds, SearchQuery $query, ?int $limit = null, ?int $offset = null): array { $qb = $this->queryCardsByBoards($boardIds); $this->extendQueryByFilter($qb, $query); @@ -356,7 +356,7 @@ class CardMapper extends QBMapper implements IPermissionMapper { return $entities; } - public function searchComments(array $boardIds, SearchQuery $query, int $limit = null, int $offset = null): array { + public function searchComments(array $boardIds, SearchQuery $query, ?int $limit = null, ?int $offset = null): array { if (count($query->getTextTokens()) === 0) { return []; } @@ -614,7 +614,7 @@ class CardMapper extends QBMapper implements IPermissionMapper { }); } - public function transferOwnership(string $ownerId, string $newOwnerId, int $boardId = null): void { + public function transferOwnership(string $ownerId, string $newOwnerId, ?int $boardId = null): void { $params = [ 'owner' => $ownerId, 'newOwner' => $newOwnerId diff --git a/lib/Event/CardUpdatedEvent.php b/lib/Event/CardUpdatedEvent.php index e5006f8df..012bd8267 100644 --- a/lib/Event/CardUpdatedEvent.php +++ b/lib/Event/CardUpdatedEvent.php @@ -31,7 +31,7 @@ use OCA\Deck\Db\Card; class CardUpdatedEvent extends ACardEvent { private $cardBefore; - public function __construct(Card $card, Card $before = null) { + public function __construct(Card $card, ?Card $before = null) { parent::__construct($card); $this->cardBefore = $before; } diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index c0732922d..006565dea 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -110,7 +110,7 @@ class ConfigService { return false; } - public function isCalendarEnabled(int $boardId = null): bool { + public function isCalendarEnabled(?int $boardId = null): bool { if ($this->getUserId() === null) { return false; } @@ -124,7 +124,7 @@ class ConfigService { return (bool)$this->config->getUserValue($this->getUserId(), Application::APP_ID, 'board:' . $boardId . ':calendar', $defaultState); } - public function isCardDetailsInModal(int $boardId = null): bool { + public function isCardDetailsInModal(?int $boardId = null): bool { if ($this->getUserId() === null) { return false; } @@ -223,7 +223,7 @@ class ConfigService { return array_filter($groups); } - public function getAttachmentFolder(string $userId = null): string { + public function getAttachmentFolder(?string $userId = null): string { if ($userId === null && $this->getUserId() === null) { throw new NoPermissionException('Must be logged in get the attachment folder'); } diff --git a/lib/Service/SearchService.php b/lib/Service/SearchService.php index 50a891e21..131c09e01 100644 --- a/lib/Service/SearchService.php +++ b/lib/Service/SearchService.php @@ -75,7 +75,7 @@ class SearchService { $this->urlGenerator = $urlGenerator; } - public function searchCards(string $term, int $limit = null, ?int $cursor = null): array { + public function searchCards(string $term, ?int $limit = null, ?int $cursor = null): array { $boards = $this->boardService->getUserBoards(); $boardIds = array_map(static function (Board $board) { return $board->getId(); diff --git a/tests/integration/features/bootstrap/BoardContext.php b/tests/integration/features/bootstrap/BoardContext.php index 09d05fa30..4f59b2cf7 100644 --- a/tests/integration/features/bootstrap/BoardContext.php +++ b/tests/integration/features/bootstrap/BoardContext.php @@ -83,7 +83,7 @@ class BoardContext implements Context { /** * @When shares the board with user :user */ - public function sharesTheBoardWithUser($user, TableNode $permissions = null) { + public function sharesTheBoardWithUser($user, ?TableNode $permissions = null) { $defaults = [ 'permissionEdit' => '0', 'permissionShare' => '0', @@ -103,7 +103,7 @@ class BoardContext implements Context { /** * @When shares the board with group :group */ - public function sharesTheBoardWithGroup($group, TableNode $permissions = null) { + public function sharesTheBoardWithGroup($group, ?TableNode $permissions = null) { $defaults = [ 'permissionEdit' => '0', 'permissionShare' => '0', diff --git a/tests/unit/Service/BoardServiceTest.php b/tests/unit/Service/BoardServiceTest.php index f02e456ba..bba051cc5 100644 --- a/tests/unit/Service/BoardServiceTest.php +++ b/tests/unit/Service/BoardServiceTest.php @@ -23,7 +23,6 @@ namespace OCA\Deck\Service; -use \Test\TestCase; use OC\L10N\L10N; use OCA\Deck\Activity\ActivityManager; use OCA\Deck\Db\Acl; @@ -51,6 +50,7 @@ use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserManager; use PHPUnit\Framework\MockObject\MockObject; +use Test\TestCase; class BoardServiceTest extends TestCase { diff --git a/tests/unit/Service/DefaultBoardServiceTest.php b/tests/unit/Service/DefaultBoardServiceTest.php index a6cd809c3..a2f42623c 100644 --- a/tests/unit/Service/DefaultBoardServiceTest.php +++ b/tests/unit/Service/DefaultBoardServiceTest.php @@ -23,13 +23,13 @@ namespace OCA\Deck\Service; -use \Test\TestCase; use OCA\Deck\Db\Board; use OCA\Deck\Db\BoardMapper; use OCA\Deck\Db\Card; use OCA\Deck\Db\Stack; use OCP\IConfig; use OCP\IL10N; +use Test\TestCase; class DefaultBoardServiceTest extends TestCase { diff --git a/tests/unit/Service/StackServiceTest.php b/tests/unit/Service/StackServiceTest.php index ec3cf44c7..48062cc45 100644 --- a/tests/unit/Service/StackServiceTest.php +++ b/tests/unit/Service/StackServiceTest.php @@ -23,7 +23,6 @@ namespace OCA\Deck\Service; -use \Test\TestCase; use OCA\Deck\Activity\ActivityManager; use OCA\Deck\Db\AssignmentMapper; use OCA\Deck\Db\BoardMapper; @@ -38,6 +37,7 @@ use OCA\Deck\Model\CardDetails; use OCA\Deck\Validators\StackServiceValidator; use OCP\EventDispatcher\IEventDispatcher; use Psr\Log\LoggerInterface; +use Test\TestCase; /** * Class StackServiceTest