style: Apply php-cs-fixer updates

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2024-02-05 07:14:04 +01:00
parent f83290f075
commit 1fdc164462
13 changed files with 18 additions and 18 deletions

View File

@@ -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 {

View File

@@ -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();
}

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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();
}

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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');
}

View File

@@ -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();

View File

@@ -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',

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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