summaryrefslogtreecommitdiffstats
path: root/apps/user_status
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-11-23 10:22:34 +0100
committerBenjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>2023-11-23 10:36:13 +0100
commitaa5f037af71c915424c6dcfd5ad2dc82797dc0d6 (patch)
tree843203cd1346158aab3515687e37a90e78c929e9 /apps/user_status
parent272719ed1cba6836ea0a597bb9767754eeb1e0d4 (diff)
downloadnextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.tar.gz
nextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.zip
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'apps/user_status')
-rw-r--r--apps/user_status/lib/AppInfo/Application.php2
-rw-r--r--apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php2
-rw-r--r--apps/user_status/lib/Connector/UserStatus.php2
-rw-r--r--apps/user_status/lib/Connector/UserStatusProvider.php2
-rw-r--r--apps/user_status/lib/ContactsMenu/StatusProvider.php2
-rw-r--r--apps/user_status/lib/Controller/HeartbeatController.php12
-rw-r--r--apps/user_status/lib/Controller/PredefinedStatusController.php4
-rw-r--r--apps/user_status/lib/Controller/StatusesController.php4
-rw-r--r--apps/user_status/lib/Controller/UserStatusController.php6
-rw-r--r--apps/user_status/lib/Dashboard/UserStatusWidget.php16
-rw-r--r--apps/user_status/lib/Db/UserStatusMapper.php2
-rw-r--r--apps/user_status/lib/Listener/UserDeletedListener.php2
-rw-r--r--apps/user_status/lib/Listener/UserLiveStatusListener.php8
-rw-r--r--apps/user_status/lib/Migration/Version0001Date20200602134824.php2
-rw-r--r--apps/user_status/lib/ResponseDefinitions.php1
-rw-r--r--apps/user_status/lib/Service/JSDataService.php2
-rw-r--r--apps/user_status/lib/Service/StatusService.php39
-rw-r--r--apps/user_status/tests/Unit/Connector/UserStatusTest.php2
-rw-r--r--apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php44
-rw-r--r--apps/user_status/tests/Unit/Db/UserStatusMapperTest.php2
-rw-r--r--apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php14
-rw-r--r--apps/user_status/tests/Unit/Service/StatusServiceTest.php54
22 files changed, 109 insertions, 115 deletions
diff --git a/apps/user_status/lib/AppInfo/Application.php b/apps/user_status/lib/AppInfo/Application.php
index 7a47fc45c95..68e5e6169ee 100644
--- a/apps/user_status/lib/AppInfo/Application.php
+++ b/apps/user_status/lib/AppInfo/Application.php
@@ -27,10 +27,10 @@ namespace OCA\UserStatus\AppInfo;
use OCA\UserStatus\Capabilities;
use OCA\UserStatus\Connector\UserStatusProvider;
+use OCA\UserStatus\Dashboard\UserStatusWidget;
use OCA\UserStatus\Listener\BeforeTemplateRenderedListener;
use OCA\UserStatus\Listener\UserDeletedListener;
use OCA\UserStatus\Listener\UserLiveStatusListener;
-use OCA\UserStatus\Dashboard\UserStatusWidget;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
diff --git a/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php b/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php
index 8f2ef421597..7118f748f37 100644
--- a/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php
+++ b/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php
@@ -47,7 +47,7 @@ class ClearOldStatusesBackgroundJob extends TimedJob {
* @param UserStatusMapper $mapper
*/
public function __construct(ITimeFactory $time,
- UserStatusMapper $mapper) {
+ UserStatusMapper $mapper) {
parent::__construct($time);
$this->mapper = $mapper;
diff --git a/apps/user_status/lib/Connector/UserStatus.php b/apps/user_status/lib/Connector/UserStatus.php
index ff05ded9e2b..41dd2513964 100644
--- a/apps/user_status/lib/Connector/UserStatus.php
+++ b/apps/user_status/lib/Connector/UserStatus.php
@@ -26,8 +26,8 @@ declare(strict_types=1);
namespace OCA\UserStatus\Connector;
use DateTimeImmutable;
-use OCP\UserStatus\IUserStatus;
use OCA\UserStatus\Db;
+use OCP\UserStatus\IUserStatus;
class UserStatus implements IUserStatus {
diff --git a/apps/user_status/lib/Connector/UserStatusProvider.php b/apps/user_status/lib/Connector/UserStatusProvider.php
index cc674c9967e..4bc2645dceb 100644
--- a/apps/user_status/lib/Connector/UserStatusProvider.php
+++ b/apps/user_status/lib/Connector/UserStatusProvider.php
@@ -25,9 +25,9 @@ declare(strict_types=1);
*/
namespace OCA\UserStatus\Connector;
+use OC\UserStatus\ISettableProvider;
use OCA\UserStatus\Service\StatusService;
use OCP\UserStatus\IProvider;
-use OC\UserStatus\ISettableProvider;
class UserStatusProvider implements IProvider, ISettableProvider {
diff --git a/apps/user_status/lib/ContactsMenu/StatusProvider.php b/apps/user_status/lib/ContactsMenu/StatusProvider.php
index f1316f02df8..7eb0d7a41e1 100644
--- a/apps/user_status/lib/ContactsMenu/StatusProvider.php
+++ b/apps/user_status/lib/ContactsMenu/StatusProvider.php
@@ -46,7 +46,7 @@ class StatusProvider implements IBulkProvider {
$statuses = $this->statusService->findByUserIds($uids);
/** @var array<string, UserStatus> $indexed */
$indexed = array_combine(
- array_map(fn(UserStatus $status) => $status->getUserId(), $statuses),
+ array_map(fn (UserStatus $status) => $status->getUserId(), $statuses),
$statuses
);
diff --git a/apps/user_status/lib/Controller/HeartbeatController.php b/apps/user_status/lib/Controller/HeartbeatController.php
index c2b1ed57f01..79e12902495 100644
--- a/apps/user_status/lib/Controller/HeartbeatController.php
+++ b/apps/user_status/lib/Controller/HeartbeatController.php
@@ -29,8 +29,6 @@ namespace OCA\UserStatus\Controller;
use OCA\UserStatus\Db\UserStatus;
use OCA\UserStatus\ResponseDefinitions;
use OCA\UserStatus\Service\StatusService;
-use OCP\AppFramework\Controller;
-use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
@@ -59,11 +57,11 @@ class HeartbeatController extends OCSController {
private $service;
public function __construct(string $appName,
- IRequest $request,
- IEventDispatcher $eventDispatcher,
- IUserSession $userSession,
- ITimeFactory $timeFactory,
- StatusService $service) {
+ IRequest $request,
+ IEventDispatcher $eventDispatcher,
+ IUserSession $userSession,
+ ITimeFactory $timeFactory,
+ StatusService $service) {
parent::__construct($appName, $request);
$this->eventDispatcher = $eventDispatcher;
$this->userSession = $userSession;
diff --git a/apps/user_status/lib/Controller/PredefinedStatusController.php b/apps/user_status/lib/Controller/PredefinedStatusController.php
index ec78fedbc0b..99acdca9f79 100644
--- a/apps/user_status/lib/Controller/PredefinedStatusController.php
+++ b/apps/user_status/lib/Controller/PredefinedStatusController.php
@@ -51,8 +51,8 @@ class PredefinedStatusController extends OCSController {
* @param PredefinedStatusService $predefinedStatusService
*/
public function __construct(string $appName,
- IRequest $request,
- PredefinedStatusService $predefinedStatusService) {
+ IRequest $request,
+ PredefinedStatusService $predefinedStatusService) {
parent::__construct($appName, $request);
$this->predefinedStatusService = $predefinedStatusService;
}
diff --git a/apps/user_status/lib/Controller/StatusesController.php b/apps/user_status/lib/Controller/StatusesController.php
index 9e2bea8ff2f..ff9008d1b70 100644
--- a/apps/user_status/lib/Controller/StatusesController.php
+++ b/apps/user_status/lib/Controller/StatusesController.php
@@ -54,8 +54,8 @@ class StatusesController extends OCSController {
* @param StatusService $service
*/
public function __construct(string $appName,
- IRequest $request,
- StatusService $service) {
+ IRequest $request,
+ StatusService $service) {
parent::__construct($appName, $request);
$this->service = $service;
}
diff --git a/apps/user_status/lib/Controller/UserStatusController.php b/apps/user_status/lib/Controller/UserStatusController.php
index 5f0647563ca..f2b1537e4f7 100644
--- a/apps/user_status/lib/Controller/UserStatusController.php
+++ b/apps/user_status/lib/Controller/UserStatusController.php
@@ -115,7 +115,7 @@ class UserStatusController extends OCSController {
* 200: The message was updated successfully
*/
public function setPredefinedMessage(string $messageId,
- ?int $clearAt): DataResponse {
+ ?int $clearAt): DataResponse {
try {
$status = $this->service->setPredefinedMessage($this->userId, $messageId, $clearAt);
$this->service->removeBackupUserStatus($this->userId);
@@ -143,8 +143,8 @@ class UserStatusController extends OCSController {
* 200: The message was updated successfully
*/
public function setCustomMessage(?string $statusIcon,
- ?string $message,
- ?int $clearAt): DataResponse {
+ ?string $message,
+ ?int $clearAt): DataResponse {
try {
if (($message !== null && $message !== '') || ($clearAt !== null && $clearAt !== 0)) {
$status = $this->service->setCustomMessage($this->userId, $statusIcon, $message, $clearAt);
diff --git a/apps/user_status/lib/Dashboard/UserStatusWidget.php b/apps/user_status/lib/Dashboard/UserStatusWidget.php
index 6c0dd356730..127f95d0a0e 100644
--- a/apps/user_status/lib/Dashboard/UserStatusWidget.php
+++ b/apps/user_status/lib/Dashboard/UserStatusWidget.php
@@ -31,7 +31,6 @@ use OCA\UserStatus\Db\UserStatus;
use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Services\IInitialState;
use OCP\Dashboard\IAPIWidget;
-use OCP\Dashboard\IButtonWidget;
use OCP\Dashboard\IAPIWidgetV2;
use OCP\Dashboard\IIconWidget;
use OCP\Dashboard\IOptionWidget;
@@ -44,7 +43,6 @@ use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\UserStatus\IUserStatus;
-use OCP\Util;
/**
* Class UserStatusWidget
@@ -72,12 +70,12 @@ class UserStatusWidget implements IAPIWidget, IAPIWidgetV2, IIconWidget, IOption
* @param StatusService $service
*/
public function __construct(IL10N $l10n,
- IDateTimeFormatter $dateTimeFormatter,
- IURLGenerator $urlGenerator,
- IInitialState $initialStateService,
- IUserManager $userManager,
- IUserSession $userSession,
- StatusService $service) {
+ IDateTimeFormatter $dateTimeFormatter,
+ IURLGenerator $urlGenerator,
+ IInitialState $initialStateService,
+ IUserManager $userManager,
+ IUserSession $userSession,
+ StatusService $service) {
$this->l10n = $l10n;
$this->dateTimeFormatter = $dateTimeFormatter;
$this->urlGenerator = $urlGenerator;
@@ -176,7 +174,7 @@ class UserStatusWidget implements IAPIWidget, IAPIWidgetV2, IIconWidget, IOption
public function getItems(string $userId, ?string $since = null, int $limit = 7): array {
$widgetItemsData = $this->getWidgetData($userId, $since, $limit);
- return array_map(function(array $widgetData) {
+ return array_map(function (array $widgetData) {
$formattedDate = $this->dateTimeFormatter->formatTimeSpan($widgetData['timestamp']);
return new WidgetItem(
$widgetData['displayName'],
diff --git a/apps/user_status/lib/Db/UserStatusMapper.php b/apps/user_status/lib/Db/UserStatusMapper.php
index c8ffcca5ad9..febee32c821 100644
--- a/apps/user_status/lib/Db/UserStatusMapper.php
+++ b/apps/user_status/lib/Db/UserStatusMapper.php
@@ -26,11 +26,11 @@ declare(strict_types=1);
namespace OCA\UserStatus\Db;
-use Sabre\CalDAV\Schedule\Plugin;
use OCP\AppFramework\Db\QBMapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\UserStatus\IUserStatus;
+use Sabre\CalDAV\Schedule\Plugin;
/**
* @template-extends QBMapper<UserStatus>
diff --git a/apps/user_status/lib/Listener/UserDeletedListener.php b/apps/user_status/lib/Listener/UserDeletedListener.php
index 0cacc89971a..2840ab0ef39 100644
--- a/apps/user_status/lib/Listener/UserDeletedListener.php
+++ b/apps/user_status/lib/Listener/UserDeletedListener.php
@@ -26,8 +26,8 @@ declare(strict_types=1);
namespace OCA\UserStatus\Listener;
use OCA\UserStatus\Service\StatusService;
-use OCP\EventDispatcher\IEventListener;
use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IEventListener;
use OCP\User\Events\UserDeletedEvent;
/**
diff --git a/apps/user_status/lib/Listener/UserLiveStatusListener.php b/apps/user_status/lib/Listener/UserLiveStatusListener.php
index 687e01fc3a7..0d0e6e3ebf0 100644
--- a/apps/user_status/lib/Listener/UserLiveStatusListener.php
+++ b/apps/user_status/lib/Listener/UserLiveStatusListener.php
@@ -25,14 +25,14 @@ declare(strict_types=1);
*/
namespace OCA\UserStatus\Listener;
-use OCA\UserStatus\Db\UserStatus;
use OCA\UserStatus\Connector\UserStatus as ConnectorUserStatus;
+use OCA\UserStatus\Db\UserStatus;
use OCA\UserStatus\Db\UserStatusMapper;
use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\EventDispatcher\IEventListener;
use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IEventListener;
use OCP\User\Events\UserLiveStatusEvent;
use OCP\UserStatus\IUserStatus;
@@ -47,8 +47,8 @@ class UserLiveStatusListener implements IEventListener {
private ITimeFactory $timeFactory;
public function __construct(UserStatusMapper $mapper,
- StatusService $statusService,
- ITimeFactory $timeFactory) {
+ StatusService $statusService,
+ ITimeFactory $timeFactory) {
$this->mapper = $mapper;
$this->statusService = $statusService;
$this->timeFactory = $timeFactory;
diff --git a/apps/user_status/lib/Migration/Version0001Date20200602134824.php b/apps/user_status/lib/Migration/Version0001Date20200602134824.php
index 64490cc4207..11e9f8261a4 100644
--- a/apps/user_status/lib/Migration/Version0001Date20200602134824.php
+++ b/apps/user_status/lib/Migration/Version0001Date20200602134824.php
@@ -27,8 +27,8 @@ declare(strict_types=1);
*/
namespace OCA\UserStatus\Migration;
-use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
+use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
diff --git a/apps/user_status/lib/ResponseDefinitions.php b/apps/user_status/lib/ResponseDefinitions.php
index 2c20bd9f126..f73e5f3b0d9 100644
--- a/apps/user_status/lib/ResponseDefinitions.php
+++ b/apps/user_status/lib/ResponseDefinitions.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
diff --git a/apps/user_status/lib/Service/JSDataService.php b/apps/user_status/lib/Service/JSDataService.php
index c08643ec64f..443389b7192 100644
--- a/apps/user_status/lib/Service/JSDataService.php
+++ b/apps/user_status/lib/Service/JSDataService.php
@@ -44,7 +44,7 @@ class JSDataService implements \JsonSerializable {
* @param StatusService $statusService
*/
public function __construct(IUserSession $userSession,
- StatusService $statusService) {
+ StatusService $statusService) {
$this->userSession = $userSession;
$this->statusService = $statusService;
}
diff --git a/apps/user_status/lib/Service/StatusService.php b/apps/user_status/lib/Service/StatusService.php
index 99fafaa6426..829c6c58570 100644
--- a/apps/user_status/lib/Service/StatusService.php
+++ b/apps/user_status/lib/Service/StatusService.php
@@ -38,7 +38,6 @@ use OCA\UserStatus\Exception\InvalidStatusTypeException;
use OCA\UserStatus\Exception\StatusMessageTooLongException;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\Calendar\ISchedulingInformation;
use OCP\DB\Exception;
use OCP\IConfig;
use OCP\IEmojiHelper;
@@ -86,12 +85,12 @@ class StatusService {
public const MAXIMUM_MESSAGE_LENGTH = 80;
public function __construct(private UserStatusMapper $mapper,
- private ITimeFactory $timeFactory,
- private PredefinedStatusService $predefinedStatusService,
- private IEmojiHelper $emojiHelper,
- private IConfig $config,
- private IUserManager $userManager,
- private CalendarStatusService $calendarStatusService) {
+ private ITimeFactory $timeFactory,
+ private PredefinedStatusService $predefinedStatusService,
+ private IEmojiHelper $emojiHelper,
+ private IConfig $config,
+ private IUserManager $userManager,
+ private CalendarStatusService $calendarStatusService) {
$this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes';
$this->shareeEnumerationInGroupOnly = $this->shareeEnumeration && $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_to_group', 'no') === 'yes';
$this->shareeEnumerationPhone = $this->shareeEnumeration && $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_to_phone', 'no') === 'yes';
@@ -190,9 +189,9 @@ class StatusService {
* @throws InvalidStatusTypeException
*/
public function setStatus(string $userId,
- string $status,
- ?int $statusTimestamp,
- bool $isUserDefined): UserStatus {
+ string $status,
+ ?int $statusTimestamp,
+ bool $isUserDefined): UserStatus {
try {
$userStatus = $this->mapper->findByUserId($userId);
} catch (DoesNotExistException $ex) {
@@ -232,8 +231,8 @@ class StatusService {
* @throws InvalidClearAtException
*/
public function setPredefinedMessage(string $userId,
- string $messageId,
- ?int $clearAt): UserStatus {
+ string $messageId,
+ ?int $clearAt): UserStatus {
try {
$userStatus = $this->mapper->findByUserId($userId);
} catch (DoesNotExistException $ex) {
@@ -276,10 +275,10 @@ class StatusService {
* @throws InvalidMessageIdException
*/
public function setUserStatus(string $userId,
- string $status,
- string $messageId,
- bool $createBackup,
- string $customMessage = null): ?UserStatus {
+ string $status,
+ string $messageId,
+ bool $createBackup,
+ string $customMessage = null): ?UserStatus {
// Check if status-type is valid
if (!in_array($status, self::PRIORITY_ORDERED_STATUSES, true)) {
throw new InvalidStatusTypeException('Status-type "' . $status . '" is not supported');
@@ -339,9 +338,9 @@ class StatusService {
* @throws StatusMessageTooLongException
*/
public function setCustomMessage(string $userId,
- ?string $statusIcon,
- ?string $message,
- ?int $clearAt): UserStatus {
+ ?string $statusIcon,
+ ?string $message,
+ ?int $clearAt): UserStatus {
try {
$userStatus = $this->mapper->findByUserId($userId);
} catch (DoesNotExistException $ex) {
@@ -569,7 +568,7 @@ class StatusService {
if (!$userStatus->getIsBackup()
&& $userStatus->getMessageId() === $messageId) {
$statuesToDelete[$userStatus->getUserId()] = $userStatus->getId();
- } else if ($userStatus->getIsBackup()) {
+ } elseif ($userStatus->getIsBackup()) {
$backups[$userStatus->getUserId()] = $userStatus->getId();
}
}
diff --git a/apps/user_status/tests/Unit/Connector/UserStatusTest.php b/apps/user_status/tests/Unit/Connector/UserStatusTest.php
index 61b5d326287..4a43aede5c0 100644
--- a/apps/user_status/tests/Unit/Connector/UserStatusTest.php
+++ b/apps/user_status/tests/Unit/Connector/UserStatusTest.php
@@ -26,8 +26,8 @@ declare(strict_types=1);
namespace OCA\UserStatus\Tests\Connector;
use OCA\UserStatus\Connector\UserStatus;
-use Test\TestCase;
use OCA\UserStatus\Db;
+use Test\TestCase;
class UserStatusTest extends TestCase {
public function testUserStatus() {
diff --git a/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php b/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php
index b0cd9ef501e..cabcc63b291 100644
--- a/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php
+++ b/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php
@@ -110,14 +110,14 @@ class UserStatusControllerTest extends TestCase {
* @dataProvider setStatusDataProvider
*/
public function testSetStatus(string $statusType,
- ?string $statusIcon,
- ?string $message,
- ?int $clearAt,
- bool $expectSuccess,
- bool $expectException,
- ?Throwable $exception,
- bool $expectLogger,
- ?string $expectedLogMessage): void {
+ ?string $statusIcon,
+ ?string $message,
+ ?int $clearAt,
+ bool $expectSuccess,
+ bool $expectException,
+ ?Throwable $exception,
+ bool $expectLogger,
+ ?string $expectedLogMessage): void {
$userStatus = $this->getUserStatus();
if ($expectException) {
@@ -178,12 +178,12 @@ class UserStatusControllerTest extends TestCase {
* @dataProvider setPredefinedMessageDataProvider
*/
public function testSetPredefinedMessage(string $messageId,
- ?int $clearAt,
- bool $expectSuccess,
- bool $expectException,
- ?Throwable $exception,
- bool $expectLogger,
- ?string $expectedLogMessage): void {
+ ?int $clearAt,
+ bool $expectSuccess,
+ bool $expectException,
+ ?Throwable $exception,
+ bool $expectLogger,
+ ?string $expectedLogMessage): void {
$userStatus = $this->getUserStatus();
if ($expectException) {
@@ -248,14 +248,14 @@ class UserStatusControllerTest extends TestCase {
* @dataProvider setCustomMessageDataProvider
*/
public function testSetCustomMessage(?string $statusIcon,
- string $message,
- ?int $clearAt,
- bool $expectSuccess,
- bool $expectException,
- ?Throwable $exception,
- bool $expectLogger,
- ?string $expectedLogMessage,
- bool $expectSuccessAsReset = false): void {
+ string $message,
+ ?int $clearAt,
+ bool $expectSuccess,
+ bool $expectException,
+ ?Throwable $exception,
+ bool $expectLogger,
+ ?string $expectedLogMessage,
+ bool $expectSuccessAsReset = false): void {
$userStatus = $this->getUserStatus();
if ($expectException) {
diff --git a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
index 38913e5f8f5..58267aed5f4 100644
--- a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
+++ b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
@@ -302,7 +302,7 @@ class UserStatusMapperTest extends TestCase {
$this->assertEquals('_user1', $user1Status->getUserId());
$this->assertEquals(true, $user1Status->getIsBackup());
$this->assertEquals('Current', $user1Status->getCustomMessage());
- } else if ($hasBackup) {
+ } elseif ($hasBackup) {
$user1Status = $this->mapper->findByUserId('user1', true);
$this->assertEquals('_user1', $user1Status->getUserId());
$this->assertEquals(true, $user1Status->getIsBackup());
diff --git a/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php b/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php
index b2d446d912e..5bc60ca71f9 100644
--- a/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php
+++ b/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php
@@ -72,13 +72,13 @@ class UserLiveStatusListenerTest extends TestCase {
* @dataProvider handleEventWithCorrectEventDataProvider
*/
public function testHandleWithCorrectEvent(string $userId,
- string $previousStatus,
- int $previousTimestamp,
- bool $previousIsUserDefined,
- string $eventStatus,
- int $eventTimestamp,
- bool $expectExisting,
- bool $expectUpdate): void {
+ string $previousStatus,
+ int $previousTimestamp,
+ bool $previousIsUserDefined,
+ string $eventStatus,
+ int $eventTimestamp,
+ bool $expectExisting,
+ bool $expectUpdate): void {
$userStatus = new UserStatus();
if ($expectExisting) {
diff --git a/apps/user_status/tests/Unit/Service/StatusServiceTest.php b/apps/user_status/tests/Unit/Service/StatusServiceTest.php
index d0742a105a3..8789a425622 100644
--- a/apps/user_status/tests/Unit/Service/StatusServiceTest.php
+++ b/apps/user_status/tests/Unit/Service/StatusServiceTest.php
@@ -43,11 +43,9 @@ use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\DB\Exception;
-use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IEmojiHelper;
use OCP\IUser;
-use OCP\IUserBackend;
use OCP\IUserManager;
use OCP\UserStatus\IUserStatus;
use PHPUnit\Framework\MockObject\MockObject;
@@ -274,15 +272,15 @@ class StatusServiceTest extends TestCase {
* @dataProvider setStatusDataProvider
*/
public function testSetStatus(string $userId,
- string $status,
- ?int $statusTimestamp,
- bool $isUserDefined,
- bool $expectExisting,
- bool $expectSuccess,
- bool $expectTimeFactory,
- bool $expectException,
- ?string $expectedExceptionClass,
- ?string $expectedExceptionMessage): void {
+ string $status,
+ ?int $statusTimestamp,
+ bool $isUserDefined,
+ bool $expectExisting,
+ bool $expectSuccess,
+ bool $expectTimeFactory,
+ bool $expectException,
+ ?string $expectedExceptionClass,
+ ?string $expectedExceptionMessage): void {
$userStatus = new UserStatus();
if ($expectExisting) {
@@ -405,14 +403,14 @@ class StatusServiceTest extends TestCase {
* @dataProvider setPredefinedMessageDataProvider
*/
public function testSetPredefinedMessage(string $userId,
- string $messageId,
- bool $isValidMessageId,
- ?int $clearAt,
- bool $expectExisting,
- bool $expectSuccess,
- bool $expectException,
- ?string $expectedExceptionClass,
- ?string $expectedExceptionMessage): void {
+ string $messageId,
+ bool $isValidMessageId,
+ ?int $clearAt,
+ bool $expectExisting,
+ bool $expectSuccess,
+ bool $expectException,
+ ?string $expectedExceptionClass,
+ ?string $expectedExceptionMessage): void {
$userStatus = new UserStatus();
if ($expectExisting) {
@@ -503,15 +501,15 @@ class StatusServiceTest extends TestCase {
* @dataProvider setCustomMessageDataProvider
*/
public function testSetCustomMessage(string $userId,
- ?string $statusIcon,
- bool $supportsEmoji,
- string $message,
- ?int $clearAt,
- bool $expectExisting,
- bool $expectSuccess,
- bool $expectException,
- ?string $expectedExceptionClass,
- ?string $expectedExceptionMessage): void {
+ ?string $statusIcon,
+ bool $supportsEmoji,
+ string $message,
+ ?int $clearAt,
+ bool $expectExisting,
+ bool $expectSuccess,
+ bool $expectException,
+ ?string $expectedExceptionClass,
+ ?string $expectedExceptionMessage): void {
$userStatus = new UserStatus();
if ($expectExisting) {