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>
pull/39271/head
Joas Schilling 6 months ago committed by Benjamin Gaussorgues
parent 272719ed1c
commit aa5f037af7
No known key found for this signature in database
GPG Key ID: 5DAC1CAFAA6DB883

@ -34,7 +34,8 @@ class Action {
public function __construct(
private IAuditLogger $logger,
) {}
) {
}
/**
* Log a single action with a log level of info

@ -27,8 +27,8 @@ declare(strict_types=1);
*/
namespace OCA\AdminAudit\BackgroundJobs;
use OCP\BackgroundJob\TimedJob;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use OCP\IConfig;
use OCP\Log\RotationTrait;

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**

@ -34,8 +34,8 @@ use OCA\Comments\Listener\LoadAdditionalScripts;
use OCA\Comments\Listener\LoadSidebarScripts;
use OCA\Comments\MaxAutoCompleteResultsInitialState;
use OCA\Comments\Notification\Notifier;
use OCA\Comments\Search\LegacyProvider;
use OCA\Comments\Search\CommentsSearchProvider;
use OCA\Comments\Search\LegacyProvider;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Files\Event\LoadSidebar;
use OCP\AppFramework\App;
@ -43,9 +43,9 @@ use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\Comments\CommentsEntityEvent;
use OCP\Comments\ICommentsManager;
use OCP\ISearch;
use OCP\IServerContainer;
use OCP\Comments\ICommentsManager;
class Application extends App implements IBootstrap {
public const APP_ID = 'comments';

@ -25,10 +25,10 @@
namespace OCA\Comments\Controller;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
use OCP\AppFramework\Http\NotFoundResponse;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http;
use OCP\Comments\IComment;
use OCP\Comments\ICommentsManager;
use OCP\Files\IRootFolder;

@ -26,12 +26,12 @@ declare(strict_types=1);
namespace OCA\Comments\Search;
use OCP\Comments\IComment;
use OCP\Comments\ICommentsManager;
use OCP\Files\Folder;
use OCP\Files\Node;
use OCP\Files\NotFoundException;
use OCP\IUser;
use OCP\Search\Provider;
use OCP\Comments\ICommentsManager;
use function count;
class LegacyProvider extends Provider {

@ -38,9 +38,7 @@ use OCP\IL10N;
use OCP\IUserManager;
use Psr\Log\LoggerInterface;
use Sabre\VObject\Component\VCard;
use Sabre\VObject\Reader;
use Sabre\VObject\UUIDUtil;
use Throwable;
class ContactInteractionListener implements IEventListener {

@ -29,25 +29,24 @@ declare(strict_types=1);
namespace OCA\Dashboard\Controller;
use OCA\Dashboard\ResponseDefinitions;
use OCP\AppFramework\OCSController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\Dashboard\IAPIWidget;
use OCP\Dashboard\IAPIWidgetV2;
use OCP\Dashboard\IButtonWidget;
use OCP\Dashboard\IIconWidget;
use OCP\Dashboard\IOptionWidget;
use OCP\Dashboard\IManager;
use OCP\Dashboard\IOptionWidget;
use OCP\Dashboard\IReloadableWidget;
use OCP\Dashboard\IWidget;
use OCP\Dashboard\Model\WidgetButton;
use OCP\Dashboard\Model\WidgetItem;
use OCP\Dashboard\Model\WidgetOptions;
use OCP\IConfig;
use OCP\IRequest;
use OCP\Dashboard\IAPIWidget;
use OCP\Dashboard\IAPIWidgetV2;
use OCP\Dashboard\Model\WidgetItem;
use OCP\Dashboard\Model\WidgetItems;
/**
* @psalm-import-type DashboardWidget from ResponseDefinitions
* @psalm-import-type DashboardWidgetItem from ResponseDefinitions

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**

@ -28,8 +28,8 @@
// Backends
use OC\KnownUser\KnownUserService;
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\Connector\LegacyDAVACL;
use OCA\DAV\CalDAV\CalendarRoot;
use OCA\DAV\Connector\LegacyDAVACL;
use OCA\DAV\Connector\Sabre\Auth;
use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin;
use OCA\DAV\Connector\Sabre\MaintenancePlugin;

@ -69,10 +69,6 @@ use OCA\DAV\Events\CardDeletedEvent;
use OCA\DAV\Events\CardUpdatedEvent;
use OCA\DAV\Events\SubscriptionCreatedEvent;
use OCA\DAV\Events\SubscriptionDeletedEvent;
use OCA\DAV\Listener\OutOfOfficeListener;
use OCP\Accounts\UserUpdatedEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\Events\TrustedServerRemovedEvent;
use OCA\DAV\HookManager;
use OCA\DAV\Listener\ActivityUpdaterListener;
use OCA\DAV\Listener\AddressbookListener;
@ -84,6 +80,7 @@ use OCA\DAV\Listener\CalendarPublicationListener;
use OCA\DAV\Listener\CalendarShareUpdateListener;
use OCA\DAV\Listener\CardListener;
use OCA\DAV\Listener\ClearPhotoCacheListener;
use OCA\DAV\Listener\OutOfOfficeListener;
use OCA\DAV\Listener\SubscriptionListener;
use OCA\DAV\Listener\TrustedServerRemovedListener;
use OCA\DAV\Listener\UserPreferenceListener;
@ -93,6 +90,7 @@ use OCA\DAV\Search\TasksSearchProvider;
use OCA\DAV\SetupChecks\NeedsSystemAddressBookSync;
use OCA\DAV\UserMigration\CalendarMigrator;
use OCA\DAV\UserMigration\ContactsMigrator;
use OCP\Accounts\UserUpdatedEvent;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
@ -102,6 +100,8 @@ use OCP\Calendar\IManager as ICalendarManager;
use OCP\Config\BeforePreferenceDeletedEvent;
use OCP\Config\BeforePreferenceSetEvent;
use OCP\Contacts\IManager as IContactsManager;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\Events\TrustedServerRemovedEvent;
use OCP\Files\AppData\IAppDataFactory;
use OCP\IUser;
use OCP\User\Events\OutOfOfficeChangedEvent;

@ -25,11 +25,11 @@ declare(strict_types=1);
*/
namespace OCA\DAV\BackgroundJob;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use OCA\DAV\AppInfo\Application;
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CardDAV\CardDavBackend;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use OCP\IConfig;
use Psr\Log\LoggerInterface;

@ -32,7 +32,6 @@ use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\TimedJob;
use OCP\Files\Node;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;

@ -23,15 +23,15 @@
namespace OCA\DAV\BulkUpload;
use OCA\DAV\Connector\Sabre\MtimeSanitizer;
use OCP\AppFramework\Http;
use OCP\Files\DavUtil;
use OCP\Files\Folder;
use Psr\Log\LoggerInterface;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use OCP\Files\DavUtil;
use OCP\Files\Folder;
use OCP\AppFramework\Http;
use OCA\DAV\Connector\Sabre\MtimeSanitizer;
class BulkUploadPlugin extends ServerPlugin {
private Folder $userFolder;

@ -22,11 +22,11 @@
namespace OCA\DAV\BulkUpload;
use Sabre\HTTP\RequestInterface;
use OCP\AppFramework\Http;
use Sabre\DAV\Exception;
use Sabre\DAV\Exception\BadRequest;
use Sabre\DAV\Exception\LengthRequired;
use OCP\AppFramework\Http;
use Sabre\HTTP\RequestInterface;
class MultipartRequestParser {

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
@ -25,8 +26,8 @@ declare(strict_types=1);
namespace OCA\DAV\CalDAV\AppCalendar;
use OCA\DAV\CalDAV\Plugin;
use OCA\DAV\CalDAV\Integration\ExternalCalendar;
use OCA\DAV\CalDAV\Plugin;
use OCP\Calendar\ICalendar;
use OCP\Calendar\ICreateFromString;
use OCP\Constants;

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**

@ -33,7 +33,6 @@ use OCA\DAV\CalDAV\InvitationResponse\InvitationResponseServer;
use OCP\Calendar\Exceptions\CalendarException;
use OCP\Calendar\ICreateFromString;
use OCP\Calendar\IHandleImipMessage;
use OCP\Calendar\ISchedulingInformation;
use OCP\Constants;
use Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp;
use Sabre\DAV\Exception\Conflict;

@ -25,15 +25,9 @@ declare(strict_types=1);
*/
namespace OCA\DAV\CalDAV;
use OCA\DAV\AppInfo\Application;
use OCA\DAV\CalDAV\Schedule\IMipService;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IConfig;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VEvent;
use Sabre\VObject\Component\VTimeZone;
use Sabre\VObject\Component\VTodo;
use function max;
class EventComparisonService {

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* *
@ -25,8 +26,6 @@ declare(strict_types=1);
namespace OCA\DAV\CalDAV\FreeBusy;
use DateTimeInterface;
use DateTimeZone;
use Sabre\VObject\Component\VCalendar;
/**

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* DAV App
@ -281,7 +282,8 @@ class IMipService {
$strikethrough = "<span style='text-decoration: line-through'>%s</span>";
$newMeetingWhen = $this->generateWhenString($vEvent);
$newSummary = isset($vEvent->SUMMARY) && (string)$vEvent->SUMMARY !== '' ? (string)$vEvent->SUMMARY : $this->l10n->t('Untitled event');;
$newSummary = isset($vEvent->SUMMARY) && (string)$vEvent->SUMMARY !== '' ? (string)$vEvent->SUMMARY : $this->l10n->t('Untitled event');
;
$newDescription = isset($vEvent->DESCRIPTION) && (string)$vEvent->DESCRIPTION !== '' ? (string)$vEvent->DESCRIPTION : $defaultVal;
$newUrl = isset($vEvent->URL) && (string)$vEvent->URL !== '' ? sprintf('<a href="%1$s">%1$s</a>', $vEvent->URL) : $defaultVal;
$newLocation = isset($vEvent->LOCATION) && (string)$vEvent->LOCATION !== '' ? (string)$vEvent->LOCATION : $defaultVal;

@ -36,7 +36,6 @@ use OCA\DAV\CalDAV\CalendarHome;
use OCP\IConfig;
use Psr\Log\LoggerInterface;
use Sabre\CalDAV\ICalendar;
use Sabre\CalDAV\Schedule\IOutbox;
use Sabre\DAV\INode;
use Sabre\DAV\IProperties;
use Sabre\DAV\PropFind;
@ -45,7 +44,6 @@ use Sabre\DAV\Xml\Property\LocalHref;
use Sabre\DAVACL\IPrincipal;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\VObject;
use Sabre\VObject\Component;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VEvent;

@ -27,7 +27,8 @@ namespace OCA\DAV\CalDAV\Status;
class Status {
public function __construct(private string $status = '', private ?string $message = null, private ?string $customMessage = null){}
public function __construct(private string $status = '', private ?string $message = null, private ?string $customMessage = null) {
}
public function getStatus(): string {
return $this->status;

@ -48,16 +48,13 @@ declare(strict_types=1);
*/
namespace OCA\DAV\CalDAV\Status;
use DateTimeZone;
use OC\Calendar\CalendarQuery;
use OCA\DAV\CalDAV\CalendarImpl;
use OCA\DAV\CalDAV\FreeBusy\FreeBusyGenerator;
use OCA\DAV\CalDAV\InvitationResponse\InvitationResponseServer;
use OCA\DAV\CalDAV\IUser;
use OCA\DAV\CalDAV\Schedule\Plugin as SchedulePlugin;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Calendar\IManager;
use OCP\Calendar\ISchedulingInformation;
use OCP\IL10N;
use OCP\IUser as User;
use OCP\UserStatus\IUserStatus;
@ -66,7 +63,6 @@ use Sabre\DAV\Exception\NotAuthenticated;
use Sabre\DAVACL\Exception\NeedPrivileges;
use Sabre\DAVACL\Plugin as AclPlugin;
use Sabre\VObject\Component;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VEvent;
use Sabre\VObject\Parameter;
use Sabre\VObject\Property;
@ -77,7 +73,8 @@ class StatusService {
private IManager $calendarManager,
private InvitationResponseServer $server,
private IL10N $l10n,
private FreeBusyGenerator $generator){}
private FreeBusyGenerator $generator) {
}
public function processCalendarAvailability(User $user, ?string $availability): ?Status {
$userId = $user->getUID();

@ -46,9 +46,9 @@ use Sabre\DAV\Xml\Property\Href;
use Sabre\VObject\Component;
use Sabre\VObject\DateTimeParser;
use Sabre\VObject\InvalidDataException;
use Sabre\VObject\Recur\NoInstancesException;
use Sabre\VObject\ParseException;
use Sabre\VObject\Reader;
use Sabre\VObject\Recur\NoInstancesException;
use Sabre\VObject\Splitter\ICalendar;
use Sabre\VObject\UUIDUtil;
use function count;

@ -24,8 +24,7 @@ declare(strict_types=1);
*/
namespace OCA\DAV\CardDAV;
class Card extends \Sabre\CardDAV\Card
{
class Card extends \Sabre\CardDAV\Card {
public function getId(): int {
return (int) $this->cardData['id'];
}

@ -35,6 +35,7 @@
*/
namespace OCA\DAV\CardDAV;
use OC\Search\Filter\DateTimeFilter;
use OCA\DAV\Connector\Sabre\Principal;
use OCA\DAV\DAV\Sharing\Backend;
use OCA\DAV\DAV\Sharing\IShareable;
@ -53,7 +54,6 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\IDBConnection;
use OCP\IGroupManager;
use OCP\IUserManager;
use OC\Search\Filter\DateTimeFilter;
use PDO;
use Sabre\CardDAV\Backend\BackendInterface;
use Sabre\CardDAV\Backend\SyncSupport;

@ -29,8 +29,8 @@ namespace OCA\DAV\CardDAV;
use Exception;
use OCP\Accounts\IAccountManager;
use OCP\IURLGenerator;
use OCP\IImage;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserManager;
use Sabre\VObject\Component\VCard;

@ -34,12 +34,12 @@ use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OCP\Files\SimpleFS\ISimpleFile;
use OCP\Files\SimpleFS\ISimpleFolder;
use Psr\Log\LoggerInterface;
use Sabre\CardDAV\Card;
use Sabre\VObject\Document;
use Sabre\VObject\Parameter;
use Sabre\VObject\Property\Binary;
use Sabre\VObject\Reader;
use Psr\Log\LoggerInterface;
class PhotoCache {

@ -30,7 +30,6 @@
*/
namespace OCA\DAV\CardDAV;
use OC\Accounts\AccountManager;
use OCP\AppFramework\Db\TTransactional;
use OCP\AppFramework\Http;
use OCP\IDBConnection;

@ -36,8 +36,8 @@ use OCP\IGroupManager;
use OCP\IL10N;
use OCP\IRequest;
use OCP\IUserSession;
use Sabre\CardDAV\Backend\SyncSupport;
use Sabre\CardDAV\Backend\BackendInterface;
use Sabre\CardDAV\Backend\SyncSupport;
use Sabre\CardDAV\Card;
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Exception\NotFound;

@ -29,8 +29,8 @@ declare(strict_types=1);
namespace OCA\DAV\CardDAV;
use OCA\DAV\AppInfo\PluginManager;
use OCA\DAV\CardDAV\Integration\IAddressBookProvider;
use OCA\DAV\CardDAV\Integration\ExternalAddressBook;
use OCA\DAV\CardDAV\Integration\IAddressBookProvider;
use OCA\Federation\TrustedServers;
use OCP\AppFramework\QueryException;
use OCP\IConfig;
@ -42,10 +42,10 @@ use OCP\IUserSession;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Sabre\CardDAV\Backend;
use Sabre\DAV\Exception\MethodNotAllowed;
use Sabre\CardDAV\IAddressBook;
use function array_map;
use Sabre\DAV\Exception\MethodNotAllowed;
use Sabre\DAV\MkCol;
use function array_map;
class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
/** @var IL10N */

@ -56,8 +56,7 @@ class AppleQuirksPlugin extends ServerPlugin {
*
* @return void
*/
public function initialize(Server $server)
{
public function initialize(Server $server) {
$server->on('beforeMethod:REPORT', [$this, 'beforeReport'], 0);
$server->on('report', [$this, 'report'], 0);
}
@ -67,8 +66,7 @@ class AppleQuirksPlugin extends ServerPlugin {
*
* @return void
*/
public function beforeReport(RequestInterface $request, ResponseInterface $response)
{
public function beforeReport(RequestInterface $request, ResponseInterface $response) {
$userAgent = $request->getRawServerValue('HTTP_USER_AGENT') ?? 'unknown';
$this->isMacOSDavAgent = $this->isMacOSUserAgent($userAgent);
}
@ -82,8 +80,7 @@ class AppleQuirksPlugin extends ServerPlugin {
*
* @return bool
*/
public function report($reportName, $report, $path)
{
public function report($reportName, $report, $path) {
if ($reportName == '{DAV:}principal-property-search' && $this->isMacOSDavAgent) {
/** @var \Sabre\DAVACL\Xml\Request\PrincipalPropertySearchReport $report */
$report->applyToPrincipalCollectionSet = true;
@ -98,8 +95,7 @@ class AppleQuirksPlugin extends ServerPlugin {
*
* @return bool
*/
protected function isMacOSUserAgent(string $userAgent):bool
{
protected function isMacOSUserAgent(string $userAgent):bool {
return str_starts_with(self::OSX_AGENT_PREFIX, $userAgent);
}
@ -110,8 +106,7 @@ class AppleQuirksPlugin extends ServerPlugin {
*
* @return null|array
*/
protected function decodeMacOSAgentString(string $userAgent):?array
{
protected function decodeMacOSAgentString(string $userAgent):?array {
// OSX agent string is like: macOS/13.2.1 (22D68) dataaccessd/1.0
if (preg_match('|^' . self::OSX_AGENT_PREFIX . '/([0-9]+)\\.([0-9]+)\\.([0-9]+)\s+\((\w+)\)\s+([^/]+)/([0-9]+)(?:\\.([0-9]+))?(?:\\.([0-9]+))?$|i', $userAgent, $matches)) {
return [

@ -27,9 +27,9 @@ namespace OCA\DAV\Connector\Sabre;
use OCP\IConfig;
use OCP\IRequest;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use Sabre\HTTP\RequestInterface;
use Sabre\DAV\Server;
/**
* Class BlockLegacyClientPlugin is used to detect old legacy sync clients and

@ -23,10 +23,10 @@ declare(strict_types=1);
namespace OCA\DAV\Connector\Sabre;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\DAV\Server;
class ChecksumUpdatePlugin extends ServerPlugin {
protected ?Server $server = null;

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
@ -29,8 +30,8 @@ namespace OCA\DAV\Connector\Sabre;
use OCP\Comments\ICommentsManager;
use OCP\IUserSession;
use Sabre\DAV\PropFind;
use Sabre\DAV\ServerPlugin;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
class CommentPropertiesPlugin extends ServerPlugin {
public const PROPERTY_NAME_HREF = '{http://owncloud.org/ns}comments-href';

@ -25,9 +25,9 @@
namespace OCA\DAV\Connector\Sabre;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Server;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\DAV\Server;
/**
* Copies the "Etag" header to "OC-Etag" after any request.

@ -49,6 +49,7 @@ use OCP\IRequest;
use OCP\L10N\IFactory;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
use OCP\Share\IManager as IShareManager;
use Psr\Log\LoggerInterface;
use Sabre\DAV\Exception\BadRequest;
use Sabre\DAV\Exception\Locked;
@ -56,7 +57,6 @@ use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Exception\ServiceUnavailable;
use Sabre\DAV\IFile;
use Sabre\DAV\INode;
use OCP\Share\IManager as IShareManager;
class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuota, \Sabre\DAV\IMoveTarget, \Sabre\DAV\ICopyTarget {
/**

@ -26,9 +26,9 @@
*/
namespace OCA\DAV\Connector\Sabre;
use Sabre\DAV\Server;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\DAV\Server;
/**
* Class DummyGetResponsePlugin is a plugin used to not show a "Not implemented"

@ -42,7 +42,6 @@ use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Exception\NotImplemented;
use Sabre\DAV\Exception\PreconditionFailed;
use Sabre\DAV\Exception\RequestedRangeNotSatisfiable;
use Sabre\DAV\Exception\ServiceUnavailable;
class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin {
protected $nonFatalExceptions = [

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Robin Appelman <robin@icewind.nl>
*

@ -31,11 +31,11 @@
*/
namespace OCA\DAV\Connector\Sabre;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Folder;
use OCA\DAV\AppInfo\PluginManager;
use OCA\DAV\DAV\ViewOnlyPlugin;
use OCA\DAV\Files\BrowserErrorPagePlugin;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Folder;
use OCP\Files\Mount\IMountManager;
use OCP\IConfig;
use OCP\IDBConnection;

@ -33,11 +33,11 @@ use OCP\Files\Folder;
use OCP\Files\Node;
use OCP\Files\NotFoundException;
use OCP\IUserSession;
use OCP\Share\IShare;
use OCP\Share\IManager;
use OCP\Share\IShare;
use Sabre\DAV\PropFind;
use Sabre\DAV\Tree;
use Sabre\DAV\Server;
use Sabre\DAV\Tree;
/**
* Sabre Plugin to provide share-related properties

@ -32,11 +32,10 @@ use OCA\DAV\Db\DirectMapper;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\AppFramework\OCS\OCSNotFoundException;
use OCP\AppFramework\OCS\OCSForbiddenException;
use OCP\AppFramework\OCS\OCSNotFoundException;
use OCP\AppFramework\OCSController;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\EventDispatcher\GenericEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Events\BeforeDirectFileDownloadEvent;
use OCP\Files\File;

@ -31,10 +31,10 @@ namespace OCA\DAV\DAV\Sharing;
use OCA\DAV\Connector\Sabre\Principal;
use OCP\AppFramework\Db\TTransactional;
use OCP\Cache\CappedMemoryCache;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\IGroupManager;
use OCP\IUserManager;
use OCP\DB\QueryBuilder\IQueryBuilder;
class Backend {
use TTransactional;

@ -26,10 +26,10 @@ use OCA\DAV\Connector\Sabre\File as DavFile;
use OCA\Files_Versions\Sabre\VersionFile;
use OCP\Files\NotFoundException;
use Psr\Log\LoggerInterface;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use Sabre\HTTP\RequestInterface;
use Sabre\DAV\Exception\NotFound;
/**
* Sabre plugin for restricting file share receiver download:

@ -39,7 +39,6 @@ use OCP\Files\Cache\ICacheEntry;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\Files\Node;
use OCP\Files\Search\ISearchComparison;
use OCP\Files\Search\ISearchOperator;
use OCP\Files\Search\ISearchOrder;
use OCP\Files\Search\ISearchQuery;
@ -372,6 +371,7 @@ class FileSearchBackend implements ISearchBackend {
throw new \InvalidArgumentException('Invalid argument 2 for ' . $trimmedType . ' operation, expected literal');
}
$value = $operator->arguments[1]->value;
// no break
case Operator::OPERATION_IS_DEFINED:
if (!($operator->arguments[0] instanceof SearchPropertyDefinition)) {
throw new \InvalidArgumentException('Invalid argument 1 for ' . $trimmedType . ' operation, expected property');

@ -22,7 +22,6 @@
*/
namespace OCA\DAV\Files;
use Sabre\DAV\INode;
use SearchDAV\Backend\ISearchBackend;
use SearchDAV\Query\Query;

@ -25,8 +25,8 @@ declare(strict_types=1);
*/
namespace OCA\DAV\Listener;
use OCA\DAV\CardDAV\Activity\Provider\Card;
use OCA\DAV\CardDAV\Activity\Backend as ActivityBackend;
use OCA\DAV\CardDAV\Activity\Provider\Card;
use OCA\DAV\Events\CardCreatedEvent;
use OCA\DAV\Events\CardDeletedEvent;
use OCA\DAV\Events\CardUpdatedEvent;

@ -27,8 +27,8 @@ declare(strict_types=1);
*/
namespace OCA\DAV\Migration;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -26,8 +26,8 @@
*/
namespace OCA\DAV\Migration;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -26,8 +26,8 @@
*/
namespace OCA\DAV\Migration;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -29,8 +29,8 @@ declare(strict_types=1);
*/
namespace OCA\DAV\Migration;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -30,8 +30,8 @@ namespace OCA\DAV\Migration;
use Closure;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -29,8 +29,8 @@ declare(strict_types=1);
namespace OCA\DAV\Migration;
use Closure;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -29,8 +29,8 @@ declare(strict_types=1);
namespace OCA\DAV\Migration;
use Closure;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -28,8 +28,8 @@ declare(strict_types=1);
*/
namespace OCA\DAV\Migration;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -29,8 +29,8 @@ declare(strict_types=1);
namespace OCA\DAV\Migration;
use Closure;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -29,8 +29,8 @@ declare(strict_types=1);
*/
namespace OCA\DAV\Migration;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -33,8 +33,6 @@ use OCP\IConfig;
use OCP\IUserManager;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Log\LoggerInterface;
use Throwable;
@ -42,7 +40,8 @@ class Version1027Date20230504122946 extends SimpleMigrationStep {
public function __construct(private SyncService $syncService,
private LoggerInterface $logger,
private IUserManager $userManager,
private IConfig $config) {}
private IConfig $config) {
}
/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure

@ -1,4 +1,6 @@
<?php declare(strict_types = 1);
<?php
declare(strict_types = 1);
/**
* @copyright 2021 Carl Schwan <carl@carlschwan.eu>
*

@ -50,7 +50,6 @@ use OCP\AppFramework\Utility\ITimeFactory;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\IRootFolder;
use OCP\IConfig;
use OCP\IGroupManager;
use Psr\Log\LoggerInterface;
use Sabre\DAV\SimpleCollection;

@ -110,4 +110,3 @@ class AbsenceService {
$this->eventDispatcher->dispatchTyped(new OutOfOfficeClearedEvent($eventData));
}
}

@ -27,8 +27,8 @@ namespace OCA\DAV\Settings;
use OCA\DAV\AppInfo\Application;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\AppFramework\Services\IInitialState;
use OCP\IConfig;
use OCP\IURLGenerator;
use OCP\Settings\IDelegatedSettings;

@ -26,7 +26,6 @@ declare(strict_types=1);
namespace OCA\DAV\UserMigration;
use function substr;
use OCA\DAV\AppInfo\Application;
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CalDAV\ICSExportPlugin\ICSExportPlugin;
@ -53,6 +52,7 @@ use Sabre\VObject\UUIDUtil;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Throwable;
use function substr;
class CalendarMigrator implements IMigrator, ISizeEstimationMigrator {

@ -26,8 +26,6 @@ declare(strict_types=1);
namespace OCA\DAV\UserMigration;
use function sort;
use function substr;
use OCA\DAV\AppInfo\Application;
use OCA\DAV\CardDAV\CardDavBackend;
use OCA\DAV\CardDAV\Plugin as CardDAVPlugin;
@ -49,6 +47,8 @@ use Sabre\VObject\UUIDUtil;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Throwable;
use function sort;
use function substr;
class ContactsMigrator implements IMigrator, ISizeEstimationMigrator {

@ -26,7 +26,6 @@ declare(strict_types=1);
namespace OCA\DAV\Tests\integration\UserMigration;
use function scandir;
use OCA\DAV\AppInfo\Application;
use OCA\DAV\UserMigration\CalendarMigrator;
use OCP\AppFramework\App;
@ -38,6 +37,7 @@ use Sabre\VObject\Reader as VObjectReader;
use Sabre\VObject\UUIDUtil;
use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
use function scandir;
/**
* @group DB

@ -26,7 +26,6 @@ declare(strict_types=1);
namespace OCA\DAV\Tests\integration\UserMigration;
use function scandir;
use OCA\DAV\AppInfo\Application;
use OCA\DAV\UserMigration\ContactsMigrator;
use OCP\AppFramework\App;
@ -38,6 +37,7 @@ use Sabre\VObject\Splitter\VCard as VCardSplitter;
use Sabre\VObject\UUIDUtil;
use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
use function scandir;
/**
* @group DB

@ -27,6 +27,7 @@
*/
namespace OCA\DAV\Tests\unit\CalDAV;
use OC\KnownUser\KnownUserService;
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CalDAV\Proxy\ProxyMapper;
use OCA\DAV\Connector\Sabre\Principal;
@ -40,7 +41,6 @@ use OCP\IUserSession;
use OCP\L10N\IFactory;
use OCP\Security\ISecureRandom;
use OCP\Share\IManager as ShareManager;
use OC\KnownUser\KnownUserService;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet;

@ -9,7 +9,6 @@ use OCP\Calendar\ICreateFromString;
use OCP\Constants;
use PHPUnit\Framework\MockObject\MockObject;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VEvent;
use Test\TestCase;
class CalendarObjectTest extends TestCase {

@ -28,21 +28,17 @@ namespace OCA\DAV\Tests\unit\CalDAV;
use OCA\DAV\CalDAV\EventComparisonService;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VEvent;
use Test\TestCase;
class EventComparisonServiceTest extends TestCase
{
class EventComparisonServiceTest extends TestCase {
/** @var EventComparisonService */
private $eventComparisonService;
protected function setUp(): void
{
protected function setUp(): void {
$this->eventComparisonService = new EventComparisonService();
}
public function testNoModifiedEvent(): void
{
public function testNoModifiedEvent(): void {
$vCalendarOld = new VCalendar();
$vCalendarNew = new VCalendar();
@ -73,8 +69,7 @@ class EventComparisonServiceTest extends TestCase
$this->assertEmpty($result['new']);
}
public function testNewEvent(): void
{
public function testNewEvent(): void {
$vCalendarOld = null;
$vCalendarNew = new VCalendar();
@ -94,8 +89,7 @@ class EventComparisonServiceTest extends TestCase
$this->assertEquals([$vEventNew], $result['new']);
}
public function testModifiedUnmodifiedEvent(): void
{
public function testModifiedUnmodifiedEvent(): void {
$vCalendarOld = new VCalendar();
$vCalendarNew = new VCalendar();

@ -563,7 +563,8 @@ EOD;
$this->timeFactory->expects($this->once())
->method('getDateTime')
->with()
->willReturn(DateTime::createFromFormat(DateTime::ATOM, '2023-02-03T13:28:00+00:00'));;
->willReturn(DateTime::createFromFormat(DateTime::ATOM, '2023-02-03T13:28:00+00:00'));
;
$this->reminderService->onCalendarObjectCreate($objectData);
}

@ -45,7 +45,6 @@ use Psr\Log\LoggerInterface;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VEvent;
use Sabre\VObject\ITip\Message;
use Sabre\VObject\Property;
use Test\TestCase;
use function array_merge;

@ -44,8 +44,7 @@ use Sabre\VObject\Component\VEvent;
use Sabre\VObject\Property\ICalendar\DateTime;
use Test\TestCase;
class IMipServiceTest extends TestCase
{
class IMipServiceTest extends TestCase {
/** @var URLGenerator|MockObject */
private $urlGenerator;
@ -67,8 +66,7 @@ class IMipServiceTest extends TestCase
/** @var IMipService */
private $service;
protected function setUp(): void
{
protected function setUp(): void {
$this->urlGenerator = $this->createMock(URLGenerator::class);
$this->config = $this->createMock(IConfig::class);
$this->db = $this->createMock(IDBConnection::class);
@ -91,8 +89,7 @@ class IMipServiceTest extends TestCase
);
}
public function testGetFrom(): void
{
public function testGetFrom(): void {
$senderName = "Detective McQueen";
$default = "Twin Lakes Police Department - Darkside Division";
$expected = "Detective McQueen via Twin Lakes Police Department - Darkside Division";
@ -105,8 +102,7 @@ class IMipServiceTest extends TestCase
$this->assertEquals($expected, $actual);
}
public function testBuildBodyDataCreated(): void
{
public function testBuildBodyDataCreated(): void {
$vCalendar = new VCalendar();
$oldVevent = null;
$newVevent = new VEvent($vCalendar, 'two', [
@ -132,8 +128,7 @@ class IMipServiceTest extends TestCase
$this->assertEquals($expected, $actual);
}
public function testBuildBodyDataUpdate(): void
{
public function testBuildBodyDataUpdate(): void {
$vCalendar = new VCalendar();
$oldVevent = new VEvent($vCalendar, 'two', [
'UID' => 'uid-1234',
@ -201,8 +196,7 @@ class IMipServiceTest extends TestCase
$this->assertEquals($expected, $actual);
}
public function testGetLastOccurrenceRRULE(): void
{
public function testGetLastOccurrenceRRULE(): void {
$vCalendar = new VCalendar();
$vCalendar->add('VEVENT', [
'UID' => 'uid-1234',
@ -217,8 +211,7 @@ class IMipServiceTest extends TestCase
$this->assertEquals(1454284800, $occurrence);
}
public function testGetLastOccurrenceEndDate(): void
{
public function testGetLastOccurrenceEndDate(): void {
$vCalendar = new VCalendar();
$vCalendar->add('VEVENT', [
'UID' => 'uid-1234',
@ -233,8 +226,7 @@ class IMipServiceTest extends TestCase
$this->assertEquals(1483228800, $occurrence);
}
public function testGetLastOccurrenceDuration(): void
{
public function testGetLastOccurrenceDuration(): void {
$vCalendar = new VCalendar();
$vCalendar->add('VEVENT', [
'UID' => 'uid-1234',
@ -249,8 +241,7 @@ class IMipServiceTest extends TestCase
$this->assertEquals(1458864000, $occurrence);
}
public function testGetLastOccurrenceAllDay(): void
{
public function testGetLastOccurrenceAllDay(): void {
$vCalendar = new VCalendar();
$vEvent = $vCalendar->add('VEVENT', [
'UID' => 'uid-1234',
@ -267,8 +258,7 @@ class IMipServiceTest extends TestCase
$this->assertEquals(1451692800, $occurrence);
}
public function testGetLastOccurrenceFallback(): void
{
public function testGetLastOccurrenceFallback(): void {
$vCalendar = new VCalendar();
$vCalendar->add('VEVENT', [
'UID' => 'uid-1234',

@ -29,7 +29,6 @@ namespace OCA\DAV\Tests\unit\CardDAV;
use OCA\DAV\CardDAV\AddressBook;
use OCA\DAV\CardDAV\Card;
use OCA\DAV\CardDAV\CardDavBackend;
use OCA\DAV\DAV\CustomPropertiesBackend;
use OCP\IL10N;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;

@ -34,8 +34,8 @@ use OCA\DAV\CardDAV\Converter;
use OCP\Accounts\IAccount;
use OCP\Accounts\IAccountManager;
use OCP\Accounts\IAccountProperty;
use OCP\IURLGenerator;
use OCP\IImage;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserManager;
use PHPUnit\Framework\MockObject\MockObject;

@ -31,8 +31,8 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre;
use OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin;
use OCP\IConfig;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
use Sabre\HTTP\RequestInterface;
use Test\TestCase;
/**
* Class BlockLegacyClientPluginTest

@ -28,14 +28,12 @@
*/
namespace OCA\DAV\Tests\unit\Connector\Sabre;
use OC\Log;
use OC\SystemConfig;
use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin;
use OCA\DAV\Exception\ServerMaintenanceMode;
use Psr\Log\LoggerInterface;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Exception\ServiceUnavailable;
use Sabre\DAV\Server;
use Test\TestCase;

@ -39,7 +39,6 @@ use OCP\Files\Cache\ICacheEntry;
use OCP\Files\Mount\IMountPoint;
use OCP\Files\Storage;
use OCP\ICache;
use OCP\Share\IAttributes;
use OCP\Share\IManager;
use OCP\Share\IShare;

@ -20,11 +20,12 @@
*/
namespace OCA\DAV\Tests\unit\DAV;
use OCA\DAV\Connector\Sabre\Exception\Forbidden;
use OCA\DAV\Connector\Sabre\File as DavFile;
use OCA\DAV\DAV\ViewOnlyPlugin;
use OCA\Files_Sharing\SharedStorage;
use OCA\DAV\Connector\Sabre\File as DavFile;
use OCA\Files_Versions\Versions\IVersion;
use OCA\Files_Versions\Sabre\VersionFile;
use OCA\Files_Versions\Versions\IVersion;
use OCP\Files\File;
use OCP\Files\Storage\IStorage;
use OCP\Share\IAttributes;
@ -32,9 +33,8 @@ use OCP\Share\IShare;
use Psr\Log\LoggerInterface;
use Sabre\DAV\Server;
use Sabre\DAV\Tree;
use Test\TestCase;
use Sabre\HTTP\RequestInterface;
use OCA\DAV\Connector\Sabre\Exception\Forbidden;
use Test\TestCase;
class ViewOnlyPluginTest extends TestCase {

@ -30,10 +30,10 @@ namespace OCA\DAV\Tests\Files;
use OC\Files\Search\SearchComparison;
use OC\Files\Search\SearchQuery;
use OC\Files\View;
use OCA\DAV\Connector\Sabre\ObjectTree;
use OCA\DAV\Connector\Sabre\Directory;
use OCA\DAV\Connector\Sabre\File;
use OCA\DAV\Connector\Sabre\FilesPlugin;
use OCA\DAV\Connector\Sabre\ObjectTree;
use OCA\DAV\Files\FileSearchBackend;
use OCP\Files\FileInfo;
use OCP\Files\Folder;

@ -22,8 +22,8 @@
namespace OCA\DAV\Tests\unit\DAV;
use Test\TestCase;
use \OCA\DAV\BulkUpload\MultipartRequestParser;
use Test\TestCase;
class MultipartRequestParserTest extends TestCase {
private function getValidBodyObject() {

@ -27,8 +27,8 @@ namespace OCA\DAV\Tests\Unit\DAV\Settings;
use OCA\DAV\Settings\CalDAVSettings;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\AppFramework\Services\IInitialState;
use OCP\IConfig;
use OCP\IURLGenerator;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;

@ -30,8 +30,8 @@ use OC\Files\View;
use OCP\Encryption\IManager;
use OCP\Files\Config\ICachedMountInfo;
use OCP\Files\Config\IUserMountCache;
use OCP\Files\Folder;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\Files\Node;
use OCP\IUser;

@ -41,8 +41,8 @@ use OCP\Encryption\Exceptions\GenericEncryptionException;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IUserSession;
use Psr\Log\LoggerInterface;
use phpseclib\Crypt\RC4;
use Psr\Log\LoggerInterface;
/**
* Class Crypt provides the encryption implementation of the default Nextcloud

@ -29,8 +29,8 @@ namespace OCA\Encryption\Tests\Crypto;
use OCA\Encryption\Crypto\Crypt;
use OCP\IConfig;
use OCP\IL10N;
use Psr\Log\LoggerInterface;
use OCP\IUserSession;
use Psr\Log\LoggerInterface;
use Test\TestCase;
class CryptTest extends TestCase {

@ -34,11 +34,11 @@ use OCA\Encryption\Recovery;
use OCA\Encryption\Session;
use OCA\Encryption\Users\Setup;
use OCA\Encryption\Util;
use Psr\Log\LoggerInterface;
use OCP\IUser;
use OCP\IUserManager;
use OCP\IUserSession;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase;
/**

@ -41,11 +41,11 @@ use OCP\Encryption\Keys\IStorage;
use OCP\Files\Cache\ICache;
use OCP\Files\Storage;
use OCP\IConfig;
use Psr\Log\LoggerInterface;
use OCP\IUserSession;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase;
class KeyManagerTest extends TestCase {

@ -29,10 +29,10 @@ use OCA\Encryption\Settings\Admin;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IL10N;
use Psr\Log\LoggerInterface;
use OCP\ISession;
use OCP\IUserManager;
use OCP\IUserSession;
use Psr\Log\LoggerInterface;
use Test\TestCase;
class AdminTest extends TestCase {

@ -30,11 +30,11 @@ namespace OCA\FederatedFileSharing\Controller;
use OCA\FederatedFileSharing\AddressHandler;
use OCA\FederatedFileSharing\FederatedShareProvider;
use OCA\FederatedFileSharing\Notifications;
use OCP\App\IAppManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\AppFramework\OCS\OCSException;
use OCP\AppFramework\OCSController;
use OCP\App\IAppManager;
use OCP\Constants;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\Exceptions\ProviderCouldNotAddShareException;

@ -28,8 +28,8 @@ declare(strict_types=1);
namespace OCA\FederatedFileSharing\Migration;
use Closure;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -28,8 +28,8 @@ namespace OCA\FederatedFileSharing\Migration;
use Closure;
use Doctrine\DBAL\Types\Type;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

@ -33,8 +33,8 @@ use OCA\FederatedFileSharing\FederatedShareProvider;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\Defaults;
use OCP\IUserSession;
use OCP\IURLGenerator;
use OCP\IUserSession;
use OCP\Settings\ISettings;
class Personal implements ISettings {

@ -30,11 +30,11 @@ namespace OCA\FederatedFileSharing\Tests;
use OC\Federation\CloudIdManager;
use OCA\FederatedFileSharing\AddressHandler;
use OCP\Contacts\IManager;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\ICacheFactory;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\EventDispatcher\IEventDispatcher;
class AddressHandlerTest extends \Test\TestCase {
/** @var IManager|\PHPUnit\Framework\MockObject\MockObject */

@ -48,8 +48,8 @@ use OCP\IUserManager;
use OCP\IUserSession;
use OCP\Share\IManager;
use OCP\Share\IShare;
use Psr\Log\LoggerInterface;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
class MountPublicLinkControllerTest extends \Test\TestCase {
/** @var IContactsManager|MockObject */

@ -29,12 +29,12 @@ namespace OCA\FederatedFileSharing\Tests;
use OCA\FederatedFileSharing\Controller\RequestHandlerController;
use OCP\AppFramework\Http\DataResponse;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\ICloudFederationFactory;
use OCP\Federation\ICloudFederationProvider;
use OCP\Federation\ICloudFederationProviderManager;
use OCP\Federation\ICloudFederationShare;
use OCP\Federation\ICloudIdManager;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IDBConnection;
use OCP\IRequest;
use OCP\IUserManager;

@ -24,11 +24,11 @@
*/
namespace OCA\Federation\Command;
use OCA\Federation\SyncFederationAddressBooks as SyncService;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use OCA\Federation\SyncFederationAddressBooks as SyncService;
class SyncFederationAddressBooks extends Command {
private SyncService $syncService;

@ -28,10 +28,10 @@
namespace OCA\Federation;
use OC\Files\Filesystem;
use OCP\HintException;
use OCP\IDBConnection;
use OCP\DB\Exception as DBException;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\HintException;
use OCP\IDBConnection;
use OCP\IL10N;
/**

@ -27,8 +27,8 @@ declare(strict_types=1);
namespace OCA\Federation\Migration;
use Closure;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save