Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Chat/ChatManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ChatManager {
private IEventDispatcher $dispatcher;
private IDBConnection $connection;
private INotificationManager $notificationManager;
private \OCP\Share\IManager $shareManager;
private IManager $shareManager;
private RoomShareProvider $shareProvider;
private ParticipantService $participantService;
private Notifier $notifier;
Expand Down
6 changes: 3 additions & 3 deletions lib/Chat/Command/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function exec(Room $room, IComment $message, Command $command, string $ar
$message->setVerb('command');
}

protected function execHelp(Room $room, IComment $message, string $arguments, Participant $participant): ?string {
protected function execHelp(Room $room, IComment $message, string $arguments, Participant $participant): string {
if ($arguments !== '' && $arguments !== 'help') {
return $this->execHelpSingleCommand($room, $message, $arguments);
}
Expand Down Expand Up @@ -160,7 +160,7 @@ protected function execHelp(Room $room, IComment $message, string $arguments, Pa
return implode("\n", $helps);
}

protected function execHelpSingleCommand(Room $room, IComment $message, string $arguments): ?string {
protected function execHelpSingleCommand(Room $room, IComment $message, string $arguments): string {
try {
$input = explode(' ', $arguments, 2);
if (count($input) === 1) {
Expand All @@ -186,7 +186,7 @@ protected function execHelpSingleCommand(Room $room, IComment $message, string $
}
}

protected function execApp(Room $room, IComment $message, Command $command, string $arguments): ?string {
protected function execApp(Room $room, IComment $message, Command $command, string $arguments): string {
$event = $this->createEvent($room, $message, $command, $arguments);
$this->dispatcher->dispatch(self::EVENT_APP_EXECUTE, $event);
return $event->getOutput();
Expand Down
3 changes: 1 addition & 2 deletions lib/Chat/Parser/SystemMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ class SystemMessage {
protected GuestManager $guestManager;
protected IPreviewManager $previewManager;
protected RoomShareProvider $shareProvider;
/** @var PhotoCache */
protected $photoCache;
protected PhotoCache $photoCache;
protected IRootFolder $rootFolder;
protected IURLGenerator $url;
protected ?IL10N $l = null;
Expand Down
2 changes: 1 addition & 1 deletion lib/Chat/ReactionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
class ReactionManager {
private ChatManager $chatManager;
/** @var ICommentsManager|CommentsManager */
private $commentsManager;
private ICommentsManager $commentsManager;
private IL10N $l;
private MessageParser $messageParser;
private Notifier $notifier;
Expand Down
5 changes: 1 addition & 4 deletions lib/Command/ActiveCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@
namespace OCA\Talk\Command;

use OC\Core\Command\Base;
use OCA\Talk\Manager;
use OCA\Talk\Participant;
use OCP\IDBConnection;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class ActiveCalls extends Base {
public IDBConnection $connection;

public Manager $manager;
protected IDBConnection $connection;

public function __construct(IDBConnection $connection) {
parent::__construct();
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/ChatController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ChatController extends AEnvironmentAwareController {

private MessageParser $messageParser;

private \OCP\Collaboration\AutoComplete\IManager $autoCompleteManager;
private IManager $autoCompleteManager;

private IUserStatusManager $statusManager;

Expand Down
4 changes: 2 additions & 2 deletions lib/Events/CommandEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
class CommandEvent extends ChatEvent {
protected Command $command;
protected string $arguments;
protected ?string $output = null;
protected string $output = '';


public function __construct(Room $room, IComment $message, Command $command, string $arguments) {
Expand All @@ -51,7 +51,7 @@ public function setOutput(string $output): void {
$this->output = $output;
}

public function getOutput(): ?string {
public function getOutput(): string {
return $this->output;
}
}
8 changes: 4 additions & 4 deletions lib/Events/EndCallForEveryoneEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
class EndCallForEveryoneEvent extends ModifyRoomEvent {

/** @var string[] */
protected ?array $sessionIds = null;
protected array $sessionIds = [];
/** @var string[] */
protected ?array $userIds = null;
protected array $userIds = [];

public function __construct(Room $room,
?Participant $actor = null) {
Expand All @@ -49,7 +49,7 @@ public function setSessionIds(array $sessionIds): void {
/**
* Only available in the after-event
*/
public function getSessionIds(): ?array {
public function getSessionIds(): array {
return $this->sessionIds;
}

Expand All @@ -64,7 +64,7 @@ public function setUserIds(array $userIds): void {
/**
* Only available in the after-event
*/
public function getUserIds(): ?array {
public function getUserIds(): array {
return $this->userIds;
}
}
3 changes: 1 addition & 2 deletions lib/Federation/CloudFederationProviderTalk.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
class CloudFederationProviderTalk implements ICloudFederationProvider {
private IUserManager $userManager;

/** @var AddressHandler */
private $addressHandler;
private AddressHandler $addressHandler;

private FederationManager $federationManager;

Expand Down
3 changes: 1 addition & 2 deletions lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ class Notifier implements INotifier {
protected ICommentsManager $commentManager;
protected MessageParser $messageParser;
protected Definitions $definitions;
/** @var AddressHandler */
protected $addressHandler;
protected AddressHandler $addressHandler;

/** @var Room[] */
protected array $rooms = [];
Expand Down
3 changes: 1 addition & 2 deletions lib/Signaling/BackendNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ class BackendNotifier {
private ISecureRandom $secureRandom;
private Manager $signalingManager;
private ParticipantService $participantService;
/** @var IUrlGenerator */
private $urlGenerator;
private IURLGenerator $urlGenerator;

public function __construct(Config $config,
LoggerInterface $logger,
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Chat/AutoComplete/SearchPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

namespace OCA\Talk\Tests\php\Chat\AutoComplete;

use Test\TestCase;
use OCA\Talk\Chat\AutoComplete\SearchPlugin;
use OCA\Talk\Files\Util;
use OCA\Talk\GuestManager;
Expand All @@ -36,6 +35,7 @@
use OCP\IUser;
use OCP\IUserManager;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;

class SearchPluginTest extends TestCase {

Expand Down
2 changes: 1 addition & 1 deletion tests/php/Chat/AutoComplete/SorterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

namespace OCA\Talk\Tests\php\Chat;

use Test\TestCase;
use OCA\Talk\Chat\AutoComplete\Sorter;
use OCA\Talk\Chat\CommentsManager;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;

class SorterTest extends TestCase {

Expand Down
2 changes: 0 additions & 2 deletions tests/php/Chat/NotifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ class NotifierTest extends TestCase {
/** @var Util|MockObject */
protected $util;

protected Notifier $notifier;

public function setUp(): void {
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/php/Chat/Parser/UserMentionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

namespace OCA\Talk\Tests\php\Chat\Parser;

use Test\TestCase;
use OCA\Talk\Chat\Parser\UserMention;
use OCA\Talk\Exceptions\ParticipantNotFoundException;
use OCA\Talk\GuestManager;
Expand All @@ -38,6 +37,7 @@
use OCP\IUser;
use OCP\IUserManager;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;

class UserMentionTest extends TestCase {

Expand Down
2 changes: 1 addition & 1 deletion tests/php/Collaboration/Collaborators/RoomPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

namespace OCA\Talk\Tests\php\Collaboration\Collaborators;

use Test\TestCase;
use OCA\Talk\Collaboration\Collaborators\RoomPlugin;
use OCA\Talk\Manager;
use OCA\Talk\Room;
Expand All @@ -34,6 +33,7 @@
use OCP\IUser;
use OCP\IUserSession;
use OCP\Share\IShare;
use Test\TestCase;

class RoomPluginTest extends TestCase {
protected ?Manager $manager = null;
Expand Down
6 changes: 3 additions & 3 deletions tests/php/Controller/SignalingControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

namespace OCA\Talk\Tests\php\Controller;

use Test\TestCase;
use OCP\IRequest;
use OCA\Talk\Chat\CommentsManager;
use OCA\Talk\Config;
use OCA\Talk\Controller\SignalingController;
Expand All @@ -47,12 +45,14 @@
use OCP\IDBConnection;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\IRequest;
use OCP\IUser;
use OCP\IUserManager;
use OCP\Security\IHasher;
use OCP\Security\ISecureRandom;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase;

class CustomInputSignalingController extends SignalingController {
private $inputStream;
Expand Down Expand Up @@ -97,7 +97,7 @@ class SignalingControllerTest extends TestCase {
/** @var LoggerInterface|MockObject */
private $logger;

private ?\OCA\Talk\Tests\php\Controller\CustomInputSignalingController $controller = null;
private ?CustomInputSignalingController $controller = null;

public function setUp(): void {
parent::setUp();
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Notification/NotifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

namespace OCA\Talk\Tests\php\Notifications;

use Test\TestCase;
use OCA\FederatedFileSharing\AddressHandler;
use OCA\Talk\Chat\CommentsManager;
use OCA\Talk\Chat\MessageParser;
Expand All @@ -48,6 +47,7 @@
use OCP\RichObjectStrings\Definitions;
use OCP\Share\IManager as IShareManager;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;

class NotifierTest extends TestCase {

Expand Down
2 changes: 1 addition & 1 deletion tests/php/Settings/Admin/AdminSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

namespace OCA\Talk\Tests\php\Settings\Admin;

use Test\TestCase;
use OCA\Talk\Config;
use OCA\Talk\MatterbridgeManager;
use OCA\Talk\Service\CommandService;
Expand All @@ -36,6 +35,7 @@
use OCP\IUserSession;
use OCP\L10N\IFactory;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;

class AdminSettingsTest extends TestCase {

Expand Down
2 changes: 1 addition & 1 deletion tests/php/Settings/Admin/SectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

namespace OCA\Talk\Tests\php\Settings\Admin;

use Test\TestCase;
use OCA\Talk\Settings\Admin\Section;
use OCP\IL10N;
use OCP\IURLGenerator;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;

class SectionTest extends TestCase {

Expand Down
2 changes: 1 addition & 1 deletion tests/php/Signaling/BackendNotifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

namespace OCA\Talk\Tests\php\Signaling;

use Test\TestCase;
use OCA\Talk\AppInfo\Application;
use OCA\Talk\Chat\CommentsManager;
use OCA\Talk\Config;
Expand Down Expand Up @@ -50,6 +49,7 @@
use OCP\Security\ISecureRandom;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase;

class CustomBackendNotifier extends BackendNotifier {
private array $requests = [];
Expand Down