diff options
Diffstat (limited to 'apps/dav')
77 files changed, 178 insertions, 178 deletions
diff --git a/apps/dav/appinfo/app.php b/apps/dav/appinfo/app.php index 4127877f5aa..ff5a324946b 100644 --- a/apps/dav/appinfo/app.php +++ b/apps/dav/appinfo/app.php @@ -39,14 +39,14 @@ use Symfony\Component\EventDispatcher\GenericEvent; $app = \OC::$server->query(Application::class); $app->registerHooks(); -\OC::$server->registerService('CardDAVSyncService', function() use ($app) { +\OC::$server->registerService('CardDAVSyncService', function () use ($app) { return $app->getSyncService(); }); $eventDispatcher = \OC::$server->getEventDispatcher(); $eventDispatcher->addListener('OCP\Federation\TrustedServerEvent::remove', - function(GenericEvent $event) use ($app) { + function (GenericEvent $event) use ($app) { /** @var CardDavBackend $cardDavBackend */ $cardDavBackend = $app->getContainer()->query(CardDavBackend::class); $addressBookUri = $event->getSubject(); @@ -58,7 +58,7 @@ $eventDispatcher->addListener('OCP\Federation\TrustedServerEvent::remove', ); $eventDispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::createSubscription', - function(GenericEvent $event) use ($app) { + function (GenericEvent $event) use ($app) { $jobList = $app->getContainer()->getServer()->getJobList(); $subscriptionData = $event->getArgument('subscriptionData'); @@ -77,7 +77,7 @@ $eventDispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::createSubscription ); $eventDispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::deleteSubscription', - function(GenericEvent $event) use ($app) { + function (GenericEvent $event) use ($app) { $jobList = $app->getContainer()->getServer()->getJobList(); $subscriptionData = $event->getArgument('subscriptionData'); @@ -92,7 +92,7 @@ $eventDispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::deleteSubscription } ); -$eventHandler = function() use ($app) { +$eventHandler = function () use ($app) { try { $job = $app->getContainer()->query(\OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob::class); $job->run([]); @@ -106,7 +106,7 @@ $eventDispatcher->addListener('\OCP\Calendar\Resource\ForceRefreshEvent', $event $eventDispatcher->addListener('\OCP\Calendar\Room\ForceRefreshEvent', $eventHandler); $cm = \OC::$server->getContactsManager(); -$cm->register(function() use ($cm, $app) { +$cm->register(function () use ($cm, $app) { $user = \OC::$server->getUserSession()->getUser(); if (!is_null($user)) { $app->setupContactsProvider($cm, $user->getUID()); @@ -116,7 +116,7 @@ $cm->register(function() use ($cm, $app) { }); $calendarManager = \OC::$server->getCalendarManager(); -$calendarManager->register(function() use ($calendarManager, $app) { +$calendarManager->register(function () use ($calendarManager, $app) { $user = \OC::$server->getUserSession()->getUser(); if ($user !== null) { $app->setupCalendarProvider($calendarManager, $user->getUID()); diff --git a/apps/dav/appinfo/v1/webdav.php b/apps/dav/appinfo/v1/webdav.php index e270a6b7d9b..6a6a60b3f09 100644 --- a/apps/dav/appinfo/v1/webdav.php +++ b/apps/dav/appinfo/v1/webdav.php @@ -68,7 +68,7 @@ $authPlugin->addBackend($bearerAuthPlugin); $requestUri = \OC::$server->getRequest()->getRequestUri(); -$server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, function() { +$server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, function () { // use the view for the logged in user return \OC\Files\Filesystem::getView(); }); diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php index 7cee070c6d1..64a1f738a70 100644 --- a/apps/dav/lib/AppInfo/Application.php +++ b/apps/dav/lib/AppInfo/Application.php @@ -65,7 +65,7 @@ class Application extends App { $container = $this->getContainer(); $server = $container->getServer(); - $container->registerService(PhotoCache::class, function(SimpleContainer $s) use ($server) { + $container->registerService(PhotoCache::class, function (SimpleContainer $s) use ($server) { return new PhotoCache( $server->getAppDataDir('dav-photocache'), $server->getLogger() @@ -147,7 +147,7 @@ class Application extends App { } }); - $clearPhotoCache = function($event) { + $clearPhotoCache = function ($event) { if ($event instanceof GenericEvent) { /** @var PhotoCache $p */ $p = $this->getContainer()->query(PhotoCache::class); @@ -160,20 +160,20 @@ class Application extends App { $dispatcher->addListener('\OCA\DAV\CardDAV\CardDavBackend::updateCard', $clearPhotoCache); $dispatcher->addListener('\OCA\DAV\CardDAV\CardDavBackend::deleteCard', $clearPhotoCache); - $dispatcher->addListener('OC\AccountManager::userUpdated', function(GenericEvent $event) { + $dispatcher->addListener('OC\AccountManager::userUpdated', function (GenericEvent $event) { $user = $event->getSubject(); $syncService = $this->getContainer()->query(SyncService::class); $syncService->updateUser($user); }); - $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::createCalendar', function(GenericEvent $event) { + $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::createCalendar', function (GenericEvent $event) { /** @var Backend $backend */ $backend = $this->getContainer()->query(Backend::class); $backend->onCalendarAdd( $event->getArgument('calendarData') ); }); - $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateCalendar', function(GenericEvent $event) { + $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateCalendar', function (GenericEvent $event) { /** @var Backend $backend */ $backend = $this->getContainer()->query(Backend::class); $backend->onCalendarUpdate( @@ -182,7 +182,7 @@ class Application extends App { $event->getArgument('propertyMutations') ); }); - $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::deleteCalendar', function(GenericEvent $event) { + $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::deleteCalendar', function (GenericEvent $event) { /** @var Backend $backend */ $backend = $this->getContainer()->query(Backend::class); $backend->onCalendarDelete( @@ -195,7 +195,7 @@ class Application extends App { $event->getArgument('calendarId') ); }); - $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateShares', function(GenericEvent $event) { + $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateShares', function (GenericEvent $event) { /** @var Backend $backend */ $backend = $this->getContainer()->query(Backend::class); $backend->onCalendarUpdateShares( @@ -208,7 +208,7 @@ class Application extends App { // Here we should recalculate if reminders should be sent to new or old sharees }); - $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::publishCalendar', function(GenericEvent $event) { + $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::publishCalendar', function (GenericEvent $event) { /** @var Backend $backend */ $backend = $this->getContainer()->query(Backend::class); $backend->onCalendarPublication( @@ -217,7 +217,7 @@ class Application extends App { ); }); - $listener = function(GenericEvent $event, $eventName) { + $listener = function (GenericEvent $event, $eventName) { /** @var Backend $backend */ $backend = $this->getContainer()->query(Backend::class); diff --git a/apps/dav/lib/AppInfo/PluginManager.php b/apps/dav/lib/AppInfo/PluginManager.php index db54e057498..21ff40ba6b8 100644 --- a/apps/dav/lib/AppInfo/PluginManager.php +++ b/apps/dav/lib/AppInfo/PluginManager.php @@ -272,7 +272,7 @@ class PluginManager { * @param string[] $plugin */ private function loadSabreAddressBookPluginsFromInfoXml(array $plugins): void { - $providers = array_map(function(string $className): IAddressBookProvider { + $providers = array_map(function (string $className): IAddressBookProvider { $instance = $this->createPluginInstance($className); if (!($instance instanceof IAddressBookProvider)) { throw new \Exception("Sabre address book plugin class '$className' does not implement the \OCA\DAV\CardDAV\Integration\IAddressBookProvider interface"); diff --git a/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php b/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php index 93d3091042f..8396bfb9a5a 100644 --- a/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php +++ b/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php @@ -57,7 +57,7 @@ class RegisterRegenerateBirthdayCalendars extends QueuedJob { * @inheritDoc */ public function run($argument) { - $this->userManager->callForSeenUsers(function(IUser $user) { + $this->userManager->callForSeenUsers(function (IUser $user) { $this->jobList->add(GenerateBirthdayCalendarBackgroundJob::class, [ 'userId' => $user->getUID(), 'purgeBeforeGenerating' => true diff --git a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php index 75a36823620..7fe107e0004 100644 --- a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php +++ b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php @@ -398,7 +398,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { ->where($query->expr()->eq('backend_id', $query->createNamedParameter($backendId))); $stmt = $query->execute(); - return array_map(function($row) { + return array_map(function ($row) { return $row['resource_id']; }, $stmt->fetchAll(\PDO::FETCH_NAMED)); } diff --git a/apps/dav/lib/BackgroundJob/UploadCleanup.php b/apps/dav/lib/BackgroundJob/UploadCleanup.php index cd88ed4ab1e..f5863ddeafe 100644 --- a/apps/dav/lib/BackgroundJob/UploadCleanup.php +++ b/apps/dav/lib/BackgroundJob/UploadCleanup.php @@ -77,7 +77,7 @@ class UploadCleanup extends TimedJob { // The folder has to be more than a day old $initial = $uploadFolder->getMTime() < $time; - $expire = array_reduce($files, function(bool $carry, File $file) use ($time) { + $expire = array_reduce($files, function (bool $carry, File $file) use ($time) { return $carry && $file->getMTime() < $time; }, $initial); diff --git a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php index 0e6436a7b09..a1ebd409f0e 100644 --- a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php +++ b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php @@ -87,7 +87,7 @@ class EnablePlugin extends ServerPlugin { * * @return string */ - public function getPluginName() { + public function getPluginName() { return 'nc-enable-birthday-calendar'; } diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index cf06cb5ab25..f947ea9d01e 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -308,7 +308,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true); $principals = array_merge($principals, $this->principalBackend->getCircleMembership($principalUriOriginal)); - $principals = array_map(function($principal) { + $principals = array_map(function ($principal) { return urldecode($principal); }, $principals); $principals[]= $principalUri; @@ -800,7 +800,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription /** * @suppress SqlInjectionChecker */ - $propPatch->handle($supportedProperties, function($mutations) use ($calendarId) { + $propPatch->handle($supportedProperties, function ($mutations) use ($calendarId) { $newValues = []; foreach ($mutations as $propertyName => $propertyValue) { @@ -1587,7 +1587,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $result = $outerQuery->execute(); $calendarObjects = $result->fetchAll(); - return array_map(function($o) { + return array_map(function ($o) { $calendarData = Reader::read($o['calendardata']); $comps = $calendarData->getComponents(); $objects = []; @@ -1605,10 +1605,10 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription 'type' => $o['componenttype'], 'uid' => $o['uid'], 'uri' => $o['uri'], - 'objects' => array_map(function($c) { + 'objects' => array_map(function ($c) { return $this->transformSearchData($c); }, $objects), - 'timezones' => array_map(function($c) { + 'timezones' => array_map(function ($c) { return $this->transformSearchData($c); }, $timezones), ]; @@ -1624,7 +1624,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription /** @var Component[] $subComponents */ $subComponents = $comp->getComponents(); /** @var Property[] $properties */ - $properties = array_filter($comp->children(), function($c) { + $properties = array_filter($comp->children(), function ($c) { return $c instanceof Property; }); $validationRules = $comp->getValidationRules(); @@ -1993,7 +1993,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription /** * @suppress SqlInjectionChecker */ - $propPatch->handle($supportedProperties, function($mutations) use ($subscriptionId) { + $propPatch->handle($supportedProperties, function ($mutations) use ($subscriptionId) { $newValues = []; diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php index 38598e30ce3..1c7e0106fb6 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -225,7 +225,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { parent::getOwner(), 'principals/system/public' ]; - return array_filter($acl, function($rule) use ($allowedPrincipals) { + return array_filter($acl, function ($rule) use ($allowedPrincipals) { return \in_array($rule['principal'], $allowedPrincipals, true); }); } @@ -246,7 +246,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri']) { $principal = 'principal:' . parent::getOwner(); $shares = $this->caldavBackend->getShares($this->getResourceId()); - $shares = array_filter($shares, function($share) use ($principal){ + $shares = array_filter($shares, function ($share) use ($principal) { return $share['href'] === $principal; }); if (empty($shares)) { diff --git a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php index 28e96e9b1d5..59b97312062 100644 --- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php +++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php @@ -95,7 +95,7 @@ class PublishPlugin extends ServerPlugin { * * @return string */ - public function getPluginName() { + public function getPluginName() { return 'oc-calendar-publishing'; } @@ -128,7 +128,7 @@ class PublishPlugin extends ServerPlugin { } }); - $propFind->handle('{'.self::NS_CALENDARSERVER.'}allowed-sharing-modes', function() use ($node) { + $propFind->handle('{'.self::NS_CALENDARSERVER.'}allowed-sharing-modes', function () use ($node) { $canShare = (!$node->isSubscription() && $node->canWrite()); $canPublish = (!$node->isSubscription() && $node->canWrite()); diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php index fe4153fccf0..39fe4b248cb 100644 --- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php +++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php @@ -727,7 +727,7 @@ class ReminderService { * @return VObject\Component\VEvent[] */ private function getRecurrenceExceptionFromListOfVEvents(array $vevents):array { - return array_values(array_filter($vevents, function(VEvent $vevent) { + return array_values(array_filter($vevents, function (VEvent $vevent) { return $vevent->{'RECURRENCE-ID'} !== null; })); } @@ -737,7 +737,7 @@ class ReminderService { * @return VEvent|null */ private function getMasterItemFromListOfVEvents(array $vevents):?VEvent { - $elements = array_values(array_filter($vevents, function(VEvent $vevent) { + $elements = array_values(array_filter($vevents, function (VEvent $vevent) { return $vevent->{'RECURRENCE-ID'} === null; })); diff --git a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php index 5a25fbaa22e..96b4371bd7c 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php @@ -305,11 +305,11 @@ abstract class AbstractPrincipalBackend implements BackendInterface { default: $rowsByMetadata = $this->searchPrincipalsByMetadataKey($prop, $value); - $filteredRows = array_filter($rowsByMetadata, function($row) use ($usersGroups) { + $filteredRows = array_filter($rowsByMetadata, function ($row) use ($usersGroups) { return $this->isAllowedToAccessResource($row, $usersGroups); }); - $results[] = array_map(function($row) { + $results[] = array_map(function ($row) { return $row['uri']; }, $filteredRows); diff --git a/apps/dav/lib/CalDAV/Schedule/Plugin.php b/apps/dav/lib/CalDAV/Schedule/Plugin.php index 55a7b3ee691..7ad4a3904ed 100644 --- a/apps/dav/lib/CalDAV/Schedule/Plugin.php +++ b/apps/dav/lib/CalDAV/Schedule/Plugin.php @@ -261,7 +261,7 @@ EOF; */ function propFindDefaultCalendarUrl(PropFind $propFind, INode $node) { if ($node instanceof IPrincipal) { - $propFind->handle('{' . self::NS_CALDAV . '}schedule-default-calendar-URL', function() use ($node) { + $propFind->handle('{' . self::NS_CALDAV . '}schedule-default-calendar-URL', function () use ($node) { /** @var \OCA\DAV\CalDAV\Plugin $caldavPlugin */ $caldavPlugin = $this->server->getPlugin('caldav'); $principalUrl = $node->getPrincipalUrl(); diff --git a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php index d25018c1298..d00e0886b61 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php @@ -166,7 +166,7 @@ class RefreshWebcalService { public function getSubscription(string $principalUri, string $uri) { $subscriptions = array_values(array_filter( $this->calDavBackend->getSubscriptionsForUser($principalUri), - function($sub) use ($uri) { + function ($sub) use ($uri) { return $sub['uri'] === $uri; } )); @@ -197,7 +197,7 @@ class RefreshWebcalService { ->withHeader('Accept', 'text/calendar, application/calendar+json, application/calendar+xml') ->withHeader('User-Agent', 'Nextcloud Webcal Crawler'); })); - $handlerStack->push(Middleware::mapResponse(function(ResponseInterface $response) use (&$didBreak301Chain, &$latestLocation) { + $handlerStack->push(Middleware::mapResponse(function (ResponseInterface $response) use (&$didBreak301Chain, &$latestLocation) { if (!$didBreak301Chain) { if ($response->getStatusCode() !== 301) { $didBreak301Chain = true; diff --git a/apps/dav/lib/CardDAV/AddressBook.php b/apps/dav/lib/CardDAV/AddressBook.php index 4fc97ac401f..010e98d18e7 100644 --- a/apps/dav/lib/CardDAV/AddressBook.php +++ b/apps/dav/lib/CardDAV/AddressBook.php @@ -145,7 +145,7 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable { $acl = $this->carddavBackend->applyShareAcl($this->getResourceId(), $acl); $allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/system']; - return array_filter($acl, function($rule) use ($allowedPrincipals) { + return array_filter($acl, function ($rule) use ($allowedPrincipals) { return \in_array($rule['principal'], $allowedPrincipals, true); }); } @@ -183,7 +183,7 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable { if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) { $principal = 'principal:' . parent::getOwner(); $shares = $this->carddavBackend->getShares($this->getResourceId()); - $shares = array_filter($shares, function($share) use ($principal){ + $shares = array_filter($shares, function ($share) use ($principal) { return $share['href'] === $principal; }); if (empty($shares)) { diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index ee9f723be6b..1f44b63a575 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -174,7 +174,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { $principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true); $principals = array_merge($principals, $this->principalBackend->getCircleMembership($principalUriOriginal)); - $principals = array_map(function($principal) { + $principals = array_map(function ($principal) { return urldecode($principal); }, $principals); $principals[]= $principalUri; @@ -363,7 +363,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { /** * @suppress SqlInjectionChecker */ - $propPatch->handle($supportedProperties, function($mutations) use ($addressBookId) { + $propPatch->handle($supportedProperties, function ($mutations) use ($addressBookId) { $updates = []; foreach($mutations as $property=>$newValue) { @@ -939,7 +939,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { $result->closeCursor(); - return array_map(function($array) { + return array_map(function ($array) { $array['carddata'] = $this->readBlob($array['carddata']); return $array; }, $cards); diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php index d163565a7a2..c0241de2076 100644 --- a/apps/dav/lib/CardDAV/SyncService.php +++ b/apps/dav/lib/CardDAV/SyncService.php @@ -322,7 +322,7 @@ class SyncService { public function syncInstance(\Closure $progressCallback = null) { $systemAddressBook = $this->getLocalSystemAddressBook(); - $this->userManager->callForSeenUsers(function($user) use ($systemAddressBook, $progressCallback) { + $this->userManager->callForSeenUsers(function ($user) use ($systemAddressBook, $progressCallback) { $this->updateUser($user); if (!is_null($progressCallback)) { $progressCallback(); diff --git a/apps/dav/lib/CardDAV/UserAddressBooks.php b/apps/dav/lib/CardDAV/UserAddressBooks.php index 4b4ec4e12e9..7ebe3b03d11 100644 --- a/apps/dav/lib/CardDAV/UserAddressBooks.php +++ b/apps/dav/lib/CardDAV/UserAddressBooks.php @@ -72,7 +72,7 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome { $addressBooks = $this->carddavBackend->getAddressBooksForUser($this->principalUri); /** @var IAddressBook[] $objects */ - $objects = array_map(function(array $addressBook) { + $objects = array_map(function (array $addressBook) { if ($addressBook['principaluri'] === 'principals/system/system') { return new SystemAddressbook($this->carddavBackend, $addressBook, $this->l10n, $this->config); } @@ -80,7 +80,7 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome { return new AddressBook($this->carddavBackend, $addressBook, $this->l10n); }, $addressBooks); /** @var IAddressBook[][] $objectsFromPlugins */ - $objectsFromPlugins = array_map(function(IAddressBookProvider $plugin): array { + $objectsFromPlugins = array_map(function (IAddressBookProvider $plugin): array { return $plugin->fetchAllForAddressBookHome($this->principalUri); }, $this->pluginManager->getAddressBookPlugins()); diff --git a/apps/dav/lib/Command/SyncBirthdayCalendar.php b/apps/dav/lib/Command/SyncBirthdayCalendar.php index f11c5784d55..211df745e41 100644 --- a/apps/dav/lib/Command/SyncBirthdayCalendar.php +++ b/apps/dav/lib/Command/SyncBirthdayCalendar.php @@ -96,7 +96,7 @@ class SyncBirthdayCalendar extends Command { $output->writeln("Start birthday calendar sync for all users ..."); $p = new ProgressBar($output); $p->start(); - $this->userManager->callForSeenUsers(function($user) use ($p) { + $this->userManager->callForSeenUsers(function ($user) use ($p) { $p->advance(); $userId = $user->getUID(); @@ -113,7 +113,7 @@ class SyncBirthdayCalendar extends Command { $output->writeln(''); } - protected function verifyEnabled () { + protected function verifyEnabled() { $isEnabled = $this->config->getAppValue('dav', 'generateBirthdayCalendar', 'yes'); if ($isEnabled !== 'yes') { diff --git a/apps/dav/lib/Command/SyncSystemAddressBook.php b/apps/dav/lib/Command/SyncSystemAddressBook.php index 1729ab8f382..f707e733add 100644 --- a/apps/dav/lib/Command/SyncSystemAddressBook.php +++ b/apps/dav/lib/Command/SyncSystemAddressBook.php @@ -56,7 +56,7 @@ class SyncSystemAddressBook extends Command { $output->writeln('Syncing users ...'); $progress = new ProgressBar($output); $progress->start(); - $this->syncService->syncInstance(function() use ($progress) { + $this->syncService->syncInstance(function () use ($progress) { $progress->advance(); }); diff --git a/apps/dav/lib/Comments/CommentNode.php b/apps/dav/lib/Comments/CommentNode.php index a8e4c2885b4..d54f81b7a8e 100644 --- a/apps/dav/lib/Comments/CommentNode.php +++ b/apps/dav/lib/Comments/CommentNode.php @@ -85,7 +85,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { $this->logger = $logger; $methods = get_class_methods($this->comment); - $methods = array_filter($methods, function($name){ + $methods = array_filter($methods, function ($name) { return strpos($name, 'get') === 0; }); foreach($methods as $getter) { @@ -283,7 +283,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { * @return array */ protected function composeMentionsPropertyValue() { - return array_map(function($mention) { + return array_map(function ($mention) { try { $displayName = $this->commentsManager->resolveDisplayName($mention['type'], $mention['id']); } catch (\OutOfBoundsException $e) { diff --git a/apps/dav/lib/Comments/CommentsPlugin.php b/apps/dav/lib/Comments/CommentsPlugin.php index 5fc8666de05..55b0bdd4b40 100644 --- a/apps/dav/lib/Comments/CommentsPlugin.php +++ b/apps/dav/lib/Comments/CommentsPlugin.php @@ -91,7 +91,7 @@ class CommentsPlugin extends ServerPlugin { $this->server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc'; - $this->server->xml->classMap['DateTime'] = function(Writer $writer, \DateTime $value) { + $this->server->xml->classMap['DateTime'] = function (Writer $writer, \DateTime $value) { $writer->write(\Sabre\HTTP\toDate($value)); }; diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php index a479d0ff965..51d453e3f2a 100644 --- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php @@ -99,15 +99,15 @@ class CommentPropertiesPlugin extends ServerPlugin { } } - $propFind->handle(self::PROPERTY_NAME_COUNT, function() use ($node) { + $propFind->handle(self::PROPERTY_NAME_COUNT, function () use ($node) { return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId()); }); - $propFind->handle(self::PROPERTY_NAME_HREF, function() use ($node) { + $propFind->handle(self::PROPERTY_NAME_HREF, function () use ($node) { return $this->getCommentsLink($node); }); - $propFind->handle(self::PROPERTY_NAME_UNREAD, function() use ($node) { + $propFind->handle(self::PROPERTY_NAME_UNREAD, function () use ($node) { if (isset($this->cachedUnreadCount[$node->getId()])) { return $this->cachedUnreadCount[$node->getId()]; } else { diff --git a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php index 7f1a735c7a4..62c9915cc4e 100644 --- a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php @@ -89,10 +89,10 @@ class FakeLockerPlugin extends ServerPlugin { * @return void */ function propFind(PropFind $propFind, INode $node) { - $propFind->handle('{DAV:}supportedlock', function() { + $propFind->handle('{DAV:}supportedlock', function () { return new SupportedLock(true); }); - $propFind->handle('{DAV:}lockdiscovery', function() use ($propFind) { + $propFind->handle('{DAV:}lockdiscovery', function () use ($propFind) { return new LockDiscovery([]); }); } diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 8f94ea9a52e..890e65a7fa5 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -180,7 +180,7 @@ class FilesPlugin extends ServerPlugin { $this->server->on('afterWriteContent', [$this, 'sendFileIdHeader']); $this->server->on('afterMethod:GET', [$this,'httpGet']); $this->server->on('afterMethod:GET', [$this, 'handleDownloadToken']); - $this->server->on('afterResponse', function($request, ResponseInterface $response) { + $this->server->on('afterResponse', function ($request, ResponseInterface $response) { $body = $response->getBody(); if (is_resource($body)) { fclose($body); @@ -305,15 +305,15 @@ class FilesPlugin extends ServerPlugin { * } */ - $propFind->handle(self::FILEID_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::FILEID_PROPERTYNAME, function () use ($node) { return $node->getFileId(); }); - $propFind->handle(self::INTERNAL_FILEID_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::INTERNAL_FILEID_PROPERTYNAME, function () use ($node) { return $node->getInternalFileId(); }); - $propFind->handle(self::PERMISSIONS_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::PERMISSIONS_PROPERTYNAME, function () use ($node) { $perms = $node->getDavPermissions(); if ($this->isPublic) { // remove mount information @@ -322,13 +322,13 @@ class FilesPlugin extends ServerPlugin { return $perms; }); - $propFind->handle(self::SHARE_PERMISSIONS_PROPERTYNAME, function() use ($node, $httpRequest) { + $propFind->handle(self::SHARE_PERMISSIONS_PROPERTYNAME, function () use ($node, $httpRequest) { return $node->getSharePermissions( $httpRequest->getRawServerValue('PHP_AUTH_USER') ); }); - $propFind->handle(self::OCM_SHARE_PERMISSIONS_PROPERTYNAME, function() use ($node, $httpRequest) { + $propFind->handle(self::OCM_SHARE_PERMISSIONS_PROPERTYNAME, function () use ($node, $httpRequest) { $ncPermissions = $node->getSharePermissions( $httpRequest->getRawServerValue('PHP_AUTH_USER') ); @@ -336,11 +336,11 @@ class FilesPlugin extends ServerPlugin { return json_encode($ocmPermissions); }); - $propFind->handle(self::GETETAG_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::GETETAG_PROPERTYNAME, function () use ($node) { return $node->getETag(); }); - $propFind->handle(self::OWNER_ID_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::OWNER_ID_PROPERTYNAME, function () use ($node) { $owner = $node->getOwner(); if (!$owner) { return null; @@ -348,7 +348,7 @@ class FilesPlugin extends ServerPlugin { return $owner->getUID(); } }); - $propFind->handle(self::OWNER_DISPLAY_NAME_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::OWNER_DISPLAY_NAME_PROPERTYNAME, function () use ($node) { $owner = $node->getOwner(); if (!$owner) { return null; @@ -360,14 +360,14 @@ class FilesPlugin extends ServerPlugin { $propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) { return json_encode($this->previewManager->isAvailable($node->getFileInfo())); }); - $propFind->handle(self::SIZE_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::SIZE_PROPERTYNAME, function () use ($node) { return $node->getSize(); }); $propFind->handle(self::MOUNT_TYPE_PROPERTYNAME, function () use ($node) { return $node->getFileInfo()->getMountPoint()->getMountType(); }); - $propFind->handle(self::SHARE_NOTE, function() use ($node, $httpRequest) { + $propFind->handle(self::SHARE_NOTE, function () use ($node, $httpRequest) { return $node->getNoteFromShare( $httpRequest->getRawServerValue('PHP_AUTH_USER') ); @@ -375,13 +375,13 @@ class FilesPlugin extends ServerPlugin { } if ($node instanceof \OCA\DAV\Connector\Sabre\Node) { - $propFind->handle(self::DATA_FINGERPRINT_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::DATA_FINGERPRINT_PROPERTYNAME, function () use ($node) { return $this->config->getSystemValue('data-fingerprint', ''); }); } if ($node instanceof \OCA\DAV\Connector\Sabre\File) { - $propFind->handle(self::DOWNLOADURL_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::DOWNLOADURL_PROPERTYNAME, function () use ($node) { /** @var $node \OCA\DAV\Connector\Sabre\File */ try { $directDownloadUrl = $node->getDirectDownload(); @@ -396,7 +396,7 @@ class FilesPlugin extends ServerPlugin { return false; }); - $propFind->handle(self::CHECKSUMS_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::CHECKSUMS_PROPERTYNAME, function () use ($node) { $checksum = $node->getChecksum(); if ($checksum === null || $checksum === '') { return null; @@ -405,22 +405,22 @@ class FilesPlugin extends ServerPlugin { return new ChecksumList($checksum); }); - $propFind->handle(self::CREATION_TIME_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::CREATION_TIME_PROPERTYNAME, function () use ($node) { return $node->getFileInfo()->getCreationTime(); }); - $propFind->handle(self::UPLOAD_TIME_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::UPLOAD_TIME_PROPERTYNAME, function () use ($node) { return $node->getFileInfo()->getUploadTime(); }); } if ($node instanceof \OCA\DAV\Connector\Sabre\Directory) { - $propFind->handle(self::SIZE_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::SIZE_PROPERTYNAME, function () use ($node) { return $node->getSize(); }); - $propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function () use ($node) { return $node->getFileInfo()->isEncrypted() ? '1' : '0'; }); } @@ -467,14 +467,14 @@ class FilesPlugin extends ServerPlugin { return; } - $propPatch->handle(self::LASTMODIFIED_PROPERTYNAME, function($time) use ($node) { + $propPatch->handle(self::LASTMODIFIED_PROPERTYNAME, function ($time) use ($node) { if (empty($time)) { return false; } $node->touch($time); return true; }); - $propPatch->handle(self::GETETAG_PROPERTYNAME, function($etag) use ($node) { + $propPatch->handle(self::GETETAG_PROPERTYNAME, function ($etag) use ($node) { if (empty($etag)) { return false; } @@ -483,7 +483,7 @@ class FilesPlugin extends ServerPlugin { } return false; }); - $propPatch->handle(self::CREATION_TIME_PROPERTYNAME, function($time) use ($node) { + $propPatch->handle(self::CREATION_TIME_PROPERTYNAME, function ($time) use ($node) { if (empty($time)) { return false; } diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php index 2fa01c0315d..73ebabdc48f 100644 --- a/apps/dav/lib/Connector/Sabre/Principal.php +++ b/apps/dav/lib/Connector/Sabre/Principal.php @@ -273,7 +273,7 @@ class Principal implements BackendInterface { $users = $this->userManager->getByEmail($value); if (!$allowEnumeration) { - $users = \array_filter($users, static function(IUser $user) use ($value) { + $users = \array_filter($users, static function (IUser $user) use ($value) { return $user->getEMailAddress() === $value; }); } @@ -287,7 +287,7 @@ class Principal implements BackendInterface { }); } - $results[] = array_reduce($users, function(array $carry, IUser $user) use ($restrictGroups) { + $results[] = array_reduce($users, function (array $carry, IUser $user) use ($restrictGroups) { // is sharing restricted to groups only? if ($restrictGroups !== false) { $userGroups = $this->groupManager->getUserGroupIds($user); @@ -305,7 +305,7 @@ class Principal implements BackendInterface { $users = $this->userManager->searchDisplayName($value); if (!$allowEnumeration) { - $users = \array_filter($users, static function(IUser $user) use ($value) { + $users = \array_filter($users, static function (IUser $user) use ($value) { return $user->getDisplayName() === $value; }); } @@ -319,7 +319,7 @@ class Principal implements BackendInterface { }); } - $results[] = array_reduce($users, function(array $carry, IUser $user) use ($restrictGroups) { + $results[] = array_reduce($users, function (array $carry, IUser $user) use ($restrictGroups) { // is sharing restricted to groups only? if ($restrictGroups !== false) { $userGroups = $this->groupManager->getUserGroupIds($user); @@ -518,7 +518,7 @@ class Principal implements BackendInterface { $circles = \OCA\Circles\Api\v1\Circles::joinedCircles($name, true); - $circles = array_map(function($circle) { + $circles = array_map(function ($circle) { /** @var \OCA\Circles\Model\Circle $circle */ return 'principals/circles/' . urlencode($circle->getUniqueId()); }, $circles); diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php index 8b811226734..ef1e7236c9b 100644 --- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php @@ -200,14 +200,14 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin { $propFind->handle(self::SHARETYPES_PROPERTYNAME, function () use ($sabreNode) { $shares = $this->getShares($sabreNode); - $shareTypes = array_unique(array_map(function(IShare $share) { + $shareTypes = array_unique(array_map(function (IShare $share) { return $share->getShareType(); }, $shares)); return new ShareTypeList($shareTypes); }); - $propFind->handle(self::SHAREES_PROPERTYNAME, function() use ($sabreNode) { + $propFind->handle(self::SHAREES_PROPERTYNAME, function () use ($sabreNode) { $shares = $this->getShares($sabreNode); return new ShareeList($shares); diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php index 9cefe682de9..83995a31e57 100644 --- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php +++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php @@ -246,12 +246,12 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin $isFav = null; - $propFind->handle(self::TAGS_PROPERTYNAME, function() use (&$isFav, $node) { + $propFind->handle(self::TAGS_PROPERTYNAME, function () use (&$isFav, $node) { list($tags, $isFav) = $this->getTagsAndFav($node->getId()); return new TagList($tags); }); - $propFind->handle(self::FAVORITE_PROPERTYNAME, function() use ($isFav, $node) { + $propFind->handle(self::FAVORITE_PROPERTYNAME, function () use ($isFav, $node) { if (is_null($isFav)) { list(, $isFav) = $this->getTagsAndFav($node->getId()); } @@ -277,12 +277,12 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin return; } - $propPatch->handle(self::TAGS_PROPERTYNAME, function($tagList) use ($node) { + $propPatch->handle(self::TAGS_PROPERTYNAME, function ($tagList) use ($node) { $this->updateTags($node->getId(), $tagList->getTags()); return true; }); - $propPatch->handle(self::FAVORITE_PROPERTYNAME, function($favState) use ($node) { + $propPatch->handle(self::FAVORITE_PROPERTYNAME, function ($favState) use ($node) { if ((int)$favState === 1 || $favState === 'true') { $this->getTagger()->tagAs($node->getId(), self::TAG_FAVORITE); } else { diff --git a/apps/dav/lib/Controller/BirthdayCalendarController.php b/apps/dav/lib/Controller/BirthdayCalendarController.php index 6eb014985d5..3be7b28c51b 100644 --- a/apps/dav/lib/Controller/BirthdayCalendarController.php +++ b/apps/dav/lib/Controller/BirthdayCalendarController.php @@ -78,7 +78,7 @@ class BirthdayCalendarController extends Controller { IDBConnection $db, IConfig $config, IJobList $jobList, IUserManager $userManager, - CalDavBackend $calDavBackend){ + CalDavBackend $calDavBackend) { parent::__construct($appName, $request); $this->db = $db; $this->config = $config; @@ -94,7 +94,7 @@ class BirthdayCalendarController extends Controller { $this->config->setAppValue($this->appName, 'generateBirthdayCalendar', 'yes'); // add background job for each user - $this->userManager->callForSeenUsers(function(IUser $user) { + $this->userManager->callForSeenUsers(function (IUser $user) { $this->jobList->add(GenerateBirthdayCalendarBackgroundJob::class, [ 'userId' => $user->getUID(), ]); diff --git a/apps/dav/lib/DAV/GroupPrincipalBackend.php b/apps/dav/lib/DAV/GroupPrincipalBackend.php index b610420faae..04fe0223607 100644 --- a/apps/dav/lib/DAV/GroupPrincipalBackend.php +++ b/apps/dav/lib/DAV/GroupPrincipalBackend.php @@ -134,7 +134,7 @@ class GroupPrincipalBackend implements BackendInterface { return []; } - return array_map(function($user) { + return array_map(function ($user) { return $this->userToPrincipal($user); }, $group->getUsers()); } @@ -210,7 +210,7 @@ class GroupPrincipalBackend implements BackendInterface { case '{DAV:}displayname': $groups = $this->groupManager->search($value); - $results[] = array_reduce($groups, function(array $carry, IGroup $group) use ($restrictGroups) { + $results[] = array_reduce($groups, function (array $carry, IGroup $group) use ($restrictGroups) { $gid = $group->getGID(); // is sharing restricted to groups only? if ($restrictGroups !== false) { diff --git a/apps/dav/lib/DAV/Sharing/Plugin.php b/apps/dav/lib/DAV/Sharing/Plugin.php index 2723dcf8bf7..fec26f145ad 100644 --- a/apps/dav/lib/DAV/Sharing/Plugin.php +++ b/apps/dav/lib/DAV/Sharing/Plugin.php @@ -192,7 +192,7 @@ class Plugin extends ServerPlugin { function propFind(PropFind $propFind, INode $node) { if ($node instanceof IShareable) { - $propFind->handle('{' . Plugin::NS_OWNCLOUD . '}invite', function() use ($node) { + $propFind->handle('{' . Plugin::NS_OWNCLOUD . '}invite', function () use ($node) { return new Invite( $node->getShares() ); diff --git a/apps/dav/lib/Files/Sharing/FilesDropPlugin.php b/apps/dav/lib/Files/Sharing/FilesDropPlugin.php index 57c81ba15f6..6dbdeaa6fd9 100644 --- a/apps/dav/lib/Files/Sharing/FilesDropPlugin.php +++ b/apps/dav/lib/Files/Sharing/FilesDropPlugin.php @@ -66,7 +66,7 @@ class FilesDropPlugin extends ServerPlugin { $this->enabled = false; } - public function beforeMethod(RequestInterface $request, ResponseInterface $response){ + public function beforeMethod(RequestInterface $request, ResponseInterface $response) { if (!$this->enabled) { return; diff --git a/apps/dav/lib/Files/Sharing/PublicLinkCheckPlugin.php b/apps/dav/lib/Files/Sharing/PublicLinkCheckPlugin.php index eaa3d78b66d..60e11884765 100644 --- a/apps/dav/lib/Files/Sharing/PublicLinkCheckPlugin.php +++ b/apps/dav/lib/Files/Sharing/PublicLinkCheckPlugin.php @@ -56,7 +56,7 @@ class PublicLinkCheckPlugin extends ServerPlugin { $server->on('beforeMethod:*', [$this, 'beforeMethod']); } - public function beforeMethod(RequestInterface $request, ResponseInterface $response){ + public function beforeMethod(RequestInterface $request, ResponseInterface $response) { // verify that the owner didn't have his share permissions revoked if ($this->fileInfo && !$this->fileInfo->isShareable()) { throw new NotFound(); diff --git a/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php b/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php index 99f45640560..e4feaf5d42f 100644 --- a/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php +++ b/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php @@ -156,7 +156,7 @@ class AppleProvisioningPlugin extends ServerPlugin { $filename = $userId . '-' . AppleProvisioningNode::FILENAME; $xmlSkeleton = $this->getTemplate(); - $body = vsprintf($xmlSkeleton, array_map(function($v) { + $body = vsprintf($xmlSkeleton, array_map(function ($v) { return \htmlspecialchars($v, ENT_XML1, 'UTF-8'); }, [ $description, diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php index 230e72fd277..1a432008a3a 100644 --- a/apps/dav/lib/Server.php +++ b/apps/dav/lib/Server.php @@ -295,7 +295,7 @@ class Server { \OC::$server->getThemingDefaults(), \OC::$server->getRequest(), \OC::$server->getL10N('dav'), - function() { + function () { return UUIDUtil::getUUID(); } )); diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php index 6d1668acf06..4ca7b041884 100644 --- a/apps/dav/lib/SystemTag/SystemTagPlugin.php +++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php @@ -226,29 +226,29 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { return; } - $propFind->handle(self::ID_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::ID_PROPERTYNAME, function () use ($node) { return $node->getSystemTag()->getId(); }); - $propFind->handle(self::DISPLAYNAME_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::DISPLAYNAME_PROPERTYNAME, function () use ($node) { return $node->getSystemTag()->getName(); }); - $propFind->handle(self::USERVISIBLE_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::USERVISIBLE_PROPERTYNAME, function () use ($node) { return $node->getSystemTag()->isUserVisible() ? 'true' : 'false'; }); - $propFind->handle(self::USERASSIGNABLE_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::USERASSIGNABLE_PROPERTYNAME, function () use ($node) { // this is the tag's inherent property "is user assignable" return $node->getSystemTag()->isUserAssignable() ? 'true' : 'false'; }); - $propFind->handle(self::CANASSIGN_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::CANASSIGN_PROPERTYNAME, function () use ($node) { // this is the effective permission for the current user return $this->tagManager->canUserAssignTag($node->getSystemTag(), $this->userSession->getUser()) ? 'true' : 'false'; }); - $propFind->handle(self::GROUPS_PROPERTYNAME, function() use ($node) { + $propFind->handle(self::GROUPS_PROPERTYNAME, function () use ($node) { if (!$this->groupManager->isAdmin($this->userSession->getUser()->getUID())) { // property only available for admins throw new Forbidden(); @@ -281,7 +281,7 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { self::USERVISIBLE_PROPERTYNAME, self::USERASSIGNABLE_PROPERTYNAME, self::GROUPS_PROPERTYNAME, - ], function($props) use ($node) { + ], function ($props) use ($node) { $tag = $node->getSystemTag(); $name = $tag->getName(); $userVisible = $tag->isUserVisible(); diff --git a/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php b/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php index c033b1ce139..e44150aaabe 100644 --- a/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php @@ -122,7 +122,7 @@ class SystemTagsByIdCollection implements ICollection { } $tags = $this->tagManager->getAllTags($visibilityFilter); - return array_map(function($tag) { + return array_map(function ($tag) { return $this->makeNode($tag); }, $tags); } diff --git a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php index 88c6f5a4648..712a18d5dbc 100644 --- a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php @@ -138,11 +138,11 @@ class SystemTagsObjectMappingCollection implements ICollection { $tags = $this->tagManager->getTagsByIds($tagIds); // filter out non-visible tags - $tags = array_filter($tags, function($tag) { + $tags = array_filter($tags, function ($tag) { return $this->tagManager->canUserSeeTag($tag, $this->user); }); - return array_values(array_map(function($tag) { + return array_values(array_map(function ($tag) { return $this->makeNode($tag); }, $tags)); } diff --git a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php index 45fc3c14291..e85480d4a2f 100644 --- a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php @@ -60,7 +60,7 @@ class SystemTagsRelationsCollection extends SimpleCollection { $tagMapper, $userSession, $groupManager, - function($name) { + function ($name) { $nodes = \OC::$server->getUserFolder()->getById((int)$name); return !empty($nodes); } diff --git a/apps/dav/lib/Traits/PrincipalProxyTrait.php b/apps/dav/lib/Traits/PrincipalProxyTrait.php index d8f06a69f8e..ee8ac58e3c6 100644 --- a/apps/dav/lib/Traits/PrincipalProxyTrait.php +++ b/apps/dav/lib/Traits/PrincipalProxyTrait.php @@ -150,7 +150,7 @@ trait PrincipalProxyTrait { $proxy->setPermissions($proxy->getPermissions() | $permission); $this->proxyMapper->update($proxy); - $proxies = array_filter($proxies, function(Proxy $p) use ($proxy) { + $proxies = array_filter($proxies, function (Proxy $p) use ($proxy) { return $p->getId() !== $proxy->getId(); }); break; diff --git a/apps/dav/lib/Upload/FutureFile.php b/apps/dav/lib/Upload/FutureFile.php index 923376c8eab..34a5981bda2 100644 --- a/apps/dav/lib/Upload/FutureFile.php +++ b/apps/dav/lib/Upload/FutureFile.php @@ -86,7 +86,7 @@ class FutureFile implements \Sabre\DAV\IFile { */ function getSize() { $children = $this->root->getChildren(); - $sizes = array_map(function($node) { + $sizes = array_map(function ($node) { /** @var IFile $node */ return $node->getSize(); }, $children); diff --git a/apps/dav/lib/Upload/UploadHome.php b/apps/dav/lib/Upload/UploadHome.php index 77a5043b3a4..8bc96d8cf1f 100644 --- a/apps/dav/lib/Upload/UploadHome.php +++ b/apps/dav/lib/Upload/UploadHome.php @@ -59,7 +59,7 @@ class UploadHome implements ICollection { } public function getChildren(): array { - return array_map(function($node) { + return array_map(function ($node) { return new UploadFolder($node, $this->cleanupService); }, $this->impl()->getChildren()); } diff --git a/apps/dav/tests/unit/BackgroundJob/RegisterRegenerateBirthdayCalendarsTest.php b/apps/dav/tests/unit/BackgroundJob/RegisterRegenerateBirthdayCalendarsTest.php index e4db329393a..b7d907e5ce5 100644 --- a/apps/dav/tests/unit/BackgroundJob/RegisterRegenerateBirthdayCalendarsTest.php +++ b/apps/dav/tests/unit/BackgroundJob/RegisterRegenerateBirthdayCalendarsTest.php @@ -66,7 +66,7 @@ class RegisterRegenerateBirthdayCalendarsTest extends TestCase { public function testRun() { $this->userManager->expects($this->once()) ->method('callForSeenUsers') - ->willReturnCallback(function($closure) { + ->willReturnCallback(function ($closure) { $user1 = $this->createMock(IUser::class); $user1->method('getUID')->willReturn('uid1'); $user2 = $this->createMock(IUser::class); diff --git a/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php b/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php index 002a3fd94b0..d260ed352e6 100644 --- a/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php +++ b/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php @@ -146,7 +146,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase { $res6->method('getBackend')->willReturn($backend3); $res6->method('getAllAvailableMetadataKeys')->willReturn(['meta99', 'meta123']); - $res6->method('getMetadataForKey')->willReturnCallback(function($key) { + $res6->method('getMetadataForKey')->willReturnCallback(function ($key) { switch($key) { case 'meta99': return 'value99-new'; @@ -165,7 +165,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase { $res7->method('getEMail')->willReturn('res7@foo.bar'); $res7->method('getBackend')->willReturn($backend3); $res7->method('getAllAvailableMetadataKeys')->willReturn(['meta1']); - $res7->method('getMetadataForKey')->willReturnCallback(function($key) { + $res7->method('getMetadataForKey')->willReturnCallback(function ($key) { switch($key) { case 'meta1': return 'value1'; @@ -181,7 +181,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase { $res8->method('getEMail')->willReturn('res8@foo.bar'); $res8->method('getBackend')->willReturn($backend4); $res8->method('getAllAvailableMetadataKeys')->willReturn(['meta2']); - $res8->method('getMetadataForKey')->willReturnCallback(function($key) { + $res8->method('getMetadataForKey')->willReturnCallback(function ($key) { switch($key) { case 'meta2': return 'value2'; diff --git a/apps/dav/tests/unit/CalDAV/Activity/BackendTest.php b/apps/dav/tests/unit/CalDAV/Activity/BackendTest.php index 9e09cda936c..f4179c60665 100644 --- a/apps/dav/tests/unit/CalDAV/Activity/BackendTest.php +++ b/apps/dav/tests/unit/CalDAV/Activity/BackendTest.php @@ -97,7 +97,7 @@ class BackendTest extends TestCase { $backend = $this->getBackend(['triggerCalendarActivity']); $backend->expects($this->once()) ->method('triggerCalendarActivity') - ->willReturnCallback(function() use($expectedPayload, $expectedSubject) { + ->willReturnCallback(function () use ($expectedPayload, $expectedSubject) { $arguments = func_get_args(); $this->assertSame($expectedSubject, array_shift($arguments)); $this->assertEquals($expectedPayload, $arguments); diff --git a/apps/dav/tests/unit/CalDAV/Activity/Filter/CalendarTest.php b/apps/dav/tests/unit/CalDAV/Activity/Filter/CalendarTest.php index 018c0540be3..04ed3a47e05 100644 --- a/apps/dav/tests/unit/CalDAV/Activity/Filter/CalendarTest.php +++ b/apps/dav/tests/unit/CalDAV/Activity/Filter/CalendarTest.php @@ -45,7 +45,7 @@ class CalendarTest extends TestCase { $l = $this->createMock(IL10N::class); $l->expects($this->any()) ->method('t') - ->willReturnCallback(function($string, $args) { + ->willReturnCallback(function ($string, $args) { return vsprintf($string, $args); }); diff --git a/apps/dav/tests/unit/CalDAV/Activity/Filter/TodoTest.php b/apps/dav/tests/unit/CalDAV/Activity/Filter/TodoTest.php index d013845345d..cc450283d9e 100644 --- a/apps/dav/tests/unit/CalDAV/Activity/Filter/TodoTest.php +++ b/apps/dav/tests/unit/CalDAV/Activity/Filter/TodoTest.php @@ -44,7 +44,7 @@ class TodoTest extends TestCase { $l = $this->createMock(IL10N::class); $l->expects($this->any()) ->method('t') - ->willReturnCallback(function($string, $args) { + ->willReturnCallback(function ($string, $args) { return vsprintf($string, $args); }); diff --git a/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php b/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php index d2a9cd5e536..eb0ac34c15a 100644 --- a/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php +++ b/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php @@ -141,7 +141,7 @@ class BaseTest extends TestCase { $l = $this->createMock(IL10N::class); $l->expects($this->any()) ->method('t') - ->willReturnCallback(function($string, $args) { + ->willReturnCallback(function ($string, $args) { return 't(' . vsprintf($string, $args) . ')'; }); diff --git a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php index 345fd9cbe11..645eaa8b2f8 100644 --- a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php +++ b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php @@ -129,7 +129,7 @@ class EnablePluginTest extends TestCase { $this->server->xml->expects($this->once()) ->method('parse') - ->willReturnCallback(function($requestBody, $url, &$documentType) { + ->willReturnCallback(function ($requestBody, $url, &$documentType) { $documentType = '{http://nextcloud.com/ns}disable-birthday-calendar'; }); @@ -167,7 +167,7 @@ class EnablePluginTest extends TestCase { $this->server->xml->expects($this->once()) ->method('parse') - ->willReturnCallback(function($requestBody, $url, &$documentType) { + ->willReturnCallback(function ($requestBody, $url, &$documentType) { $documentType = '{http://nextcloud.com/ns}enable-birthday-calendar'; }); diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php index 761ed734906..8cb6b9fbf10 100644 --- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php @@ -401,7 +401,7 @@ EOD; $this->assertArrayHasKey('classification', $card); } - usort($calendarObjects, function($a, $b) { + usort($calendarObjects, function ($a, $b) { return $a['id'] - $b['id']; }); @@ -442,7 +442,7 @@ EOD; 'comp-filters' => $compFilter ]); - $expectedEventsInResult = array_map(function($index) use($events) { + $expectedEventsInResult = array_map(function ($index) use ($events) { return $events[$index]; }, $expectedEventsInResult); $this->assertEquals($expectedEventsInResult, $result, '', 0.0, 10, true); diff --git a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php index 94cb169648b..b4095990e50 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php @@ -70,7 +70,7 @@ class CalendarManagerTest extends \Test\TestCase { $calendarManager = $this->createMock(Manager::class); $calendarManager->expects($this->at(0)) ->method('registerCalendar') - ->willReturnCallback(function() { + ->willReturnCallback(function () { $parameter = func_get_arg(0); $this->assertInstanceOf(CalendarImpl::class, $parameter); $this->assertEquals(123, $parameter->getKey()); @@ -78,7 +78,7 @@ class CalendarManagerTest extends \Test\TestCase { $calendarManager->expects($this->at(1)) ->method('registerCalendar') - ->willReturnCallback(function() { + ->willReturnCallback(function () { $parameter = func_get_arg(0); $this->assertInstanceOf(CalendarImpl::class, $parameter); $this->assertEquals(456, $parameter->getKey()); diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php index 80ab0ff5af1..534661af6c6 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php @@ -569,7 +569,7 @@ EOD; $backend->expects($this->any()) ->method('getCalendarObject') - ->willReturnCallback(function($cId, $uri) use($publicObject, $confidentialObject) { + ->willReturnCallback(function ($cId, $uri) use ($publicObject, $confidentialObject) { switch($uri) { case 'event-0': return $publicObject; diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php index 9257fe56e63..69c34d76b09 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php @@ -80,7 +80,7 @@ class PushProviderTest extends AbstractNotificationProviderTest { ); } - public function testNotificationType():void { + public function testNotificationType():void { $this->assertEquals(PushProvider::NOTIFICATION_TYPE, 'DISPLAY'); } diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php index f0bd91bf002..2900e24119c 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php @@ -56,7 +56,7 @@ class NotificationProviderManagerTest extends TestCase { * @throws ProviderNotAvailableException * @throws NotificationTypeDoesNotExistException */ - public function testGetProviderForUnknownType(): void{ + public function testGetProviderForUnknownType(): void { $this->expectException(\OCA\DAV\CalDAV\Reminder\NotificationTypeDoesNotExistException::class); $this->expectExceptionMessage('Type NOT EXISTENT is not an accepted type of notification'); @@ -67,19 +67,19 @@ class NotificationProviderManagerTest extends TestCase { * @throws NotificationTypeDoesNotExistException * @throws ProviderNotAvailableException */ - public function testGetProviderForUnRegisteredType(): void{ + public function testGetProviderForUnRegisteredType(): void { $this->expectException(\OCA\DAV\CalDAV\Reminder\NotificationProvider\ProviderNotAvailableException::class); $this->expectExceptionMessage('No notification provider for type AUDIO available'); $this->providerManager->getProvider('AUDIO'); } - public function testGetProvider(): void{ + public function testGetProvider(): void { $provider = $this->providerManager->getProvider('EMAIL'); $this->assertInstanceOf(EmailProvider::class, $provider); } - public function testRegisterProvider(): void{ + public function testRegisterProvider(): void { $this->providerManager->registerProvider(PushProvider::class); $provider = $this->providerManager->getProvider('DISPLAY'); $this->assertInstanceOf(PushProvider::class, $provider); @@ -88,7 +88,7 @@ class NotificationProviderManagerTest extends TestCase { /** * @throws \OCP\AppFramework\QueryException */ - public function testRegisterBadProvider(): void{ + public function testRegisterBadProvider(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid notification provider registered'); diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php index 38240182275..568a65b77d3 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php @@ -61,18 +61,18 @@ class NotifierTest extends TestCase { $this->l10n = $this->createMock(IL10N::class); $this->l10n->expects($this->any()) ->method('t') - ->willReturnCallback(function($string, $args) { + ->willReturnCallback(function ($string, $args) { return vsprintf($string, $args); }); $this->l10n->expects($this->any()) ->method('l') - ->willReturnCallback(function($string, $args) { + ->willReturnCallback(function ($string, $args) { /** \DateTime $args */ return $args->format(\DateTime::ATOM); }); $this->l10n->expects($this->any()) ->method('n') - ->willReturnCallback(function($textSingular, $textPlural, $count, $args) { + ->willReturnCallback(function ($textSingular, $textPlural, $count, $args) { $text = $count === 1 ? $textSingular : $textPlural; $text = str_replace('%n', (string)$count, $text); return vsprintf($text, $args); diff --git a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php index 11ecdbc354b..03e953f5c27 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php @@ -501,7 +501,7 @@ EOD; $provider1->expects($this->once()) ->method('send') - ->with($this->callback(function($vevent) { + ->with($this->callback(function ($vevent) { if ($vevent->DTSTART->getDateTime()->format(\DateTime::ATOM) !== '2016-06-09T00:00:00+00:00') { return false; } @@ -509,7 +509,7 @@ EOD; }, 'Displayname 123', $user)); $provider2->expects($this->once()) ->method('send') - ->with($this->callback(function($vevent) { + ->with($this->callback(function ($vevent) { if ($vevent->DTSTART->getDateTime()->format(\DateTime::ATOM) !== '2016-06-09T00:00:00+00:00') { return false; } @@ -517,7 +517,7 @@ EOD; }, 'Displayname 123', $user)); $provider3->expects($this->once()) ->method('send') - ->with($this->callback(function($vevent) { + ->with($this->callback(function ($vevent) { if ($vevent->DTSTART->getDateTime()->format(\DateTime::ATOM) !== '2016-06-09T00:00:00+00:00') { return false; } @@ -525,7 +525,7 @@ EOD; }, 'Displayname 123', $user)); $provider4->expects($this->once()) ->method('send') - ->with($this->callback(function($vevent) { + ->with($this->callback(function ($vevent) { if ($vevent->DTSTART->getDateTime()->format(\DateTime::ATOM) !== '2016-06-30T00:00:00+00:00') { return false; } @@ -533,7 +533,7 @@ EOD; }, 'Displayname 123', $user)); $provider5->expects($this->once()) ->method('send') - ->with($this->callback(function($vevent) { + ->with($this->callback(function ($vevent) { if ($vevent->DTSTART->getDateTime()->format(\DateTime::ATOM) !== '2016-07-07T00:00:00+00:00') { return false; } diff --git a/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php b/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php index b2fdc7f0a81..1dbd45ea4ca 100644 --- a/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php @@ -236,7 +236,7 @@ abstract class AbstractPrincipalBackendTest extends TestCase { $this->proxyMapper->expects($this->at(1)) ->method('insert') - ->with($this->callback(function($proxy) { + ->with($this->callback(function ($proxy) { /** @var Proxy $proxy */ if ($proxy->getOwnerId() !== $this->principalPrefix . '/backend1-res1') { return false; @@ -252,7 +252,7 @@ abstract class AbstractPrincipalBackendTest extends TestCase { })); $this->proxyMapper->expects($this->at(2)) ->method('insert') - ->with($this->callback(function($proxy) { + ->with($this->callback(function ($proxy) { /** @var Proxy $proxy */ if ($proxy->getOwnerId() !== $this->principalPrefix . '/backend1-res1') { return false; diff --git a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php index ebe5beb7275..53e1b8d0c8f 100644 --- a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php +++ b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php @@ -107,7 +107,7 @@ class IMipPluginTest extends TestCase { $l10n = $this->createMock(IL10N::class); $l10n->method('t') - ->willReturnCallback(function($text, $parameters = []) { + ->willReturnCallback(function ($text, $parameters = []) { return vsprintf($text, $parameters); }); $l10nFactory = $this->createMock(IFactory::class); @@ -223,7 +223,7 @@ class IMipPluginTest extends TestCase { /** * @dataProvider dataIncludeResponseButtons */ - public function testIncludeResponseButtons(string $config_setting, string $recipient, bool $has_buttons ) { + public function testIncludeResponseButtons(string $config_setting, string $recipient, bool $has_buttons) { $message = $this->_testMessage([],$recipient); $this->_expectSend($recipient, true, $has_buttons); @@ -264,7 +264,7 @@ class IMipPluginTest extends TestCase { $this->assertEquals('1.1', $message->getScheduleStatus()); } - private function _testMessage(array $attrs = [], string $recipient = 'frodo@hobb.it' ) { + private function _testMessage(array $attrs = [], string $recipient = 'frodo@hobb.it') { $message = new Message(); $message->method = 'REQUEST'; $message->message = new VCalendar(); diff --git a/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php b/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php index c5af8952b99..8de32ad8c35 100644 --- a/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php +++ b/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php @@ -116,7 +116,7 @@ class RefreshWebcalServiceTest extends TestCase { $client->expects($this->once()) ->method('get') - ->with('https://foo.bar/bla2', $this->callback(function($obj) { + ->with('https://foo.bar/bla2', $this->callback(function ($obj) { return $obj['allow_redirects']['redirects'] === 10 && $obj['handler'] instanceof HandlerStack; })) ->willReturn($response); diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php index aa4f4e8443c..326e77a58be 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php @@ -280,7 +280,7 @@ class AddressBookImplTest extends TestCase { // simulate that 'uid0' already exists, so the second uid will be returned $this->backend->expects($this->exactly(2))->method('getContact') ->willReturnCallback( - function($id, $uid) { + function ($id, $uid) { return ($uid === 'uid0.vcf'); } ); diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php index e132f082556..e6ba0f5ef02 100644 --- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php @@ -66,7 +66,7 @@ class BirthdayServiceTest extends TestCase { $this->l10n->expects($this->any()) ->method('t') - ->willReturnCallback(function($string, $args) { + ->willReturnCallback(function ($string, $args) { return vsprintf($string, $args); }); @@ -392,7 +392,7 @@ class BirthdayServiceTest extends TestCase { ]; } - public function providesCardChanges(){ + public function providesCardChanges() { return[ ['delete'], ['create'], diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php index 5efce1c23be..9d23280f607 100644 --- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php +++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php @@ -258,7 +258,7 @@ class CardDavBackendTest extends TestCase { // Expect event $this->dispatcher->expects($this->at(0)) ->method('dispatch') - ->with('\OCA\DAV\CardDAV\CardDavBackend::createCard', $this->callback(function(GenericEvent $e) use ($bookId, $uri) { + ->with('\OCA\DAV\CardDAV\CardDavBackend::createCard', $this->callback(function (GenericEvent $e) use ($bookId, $uri) { return $e->getArgument('addressBookId') === $bookId && $e->getArgument('cardUri') === $uri && $e->getArgument('cardData') === $this->vcardTest0; @@ -285,7 +285,7 @@ class CardDavBackendTest extends TestCase { // Expect event $this->dispatcher->expects($this->at(0)) ->method('dispatch') - ->with('\OCA\DAV\CardDAV\CardDavBackend::updateCard', $this->callback(function(GenericEvent $e) use ($bookId, $uri) { + ->with('\OCA\DAV\CardDAV\CardDavBackend::updateCard', $this->callback(function (GenericEvent $e) use ($bookId, $uri) { return $e->getArgument('addressBookId') === $bookId && $e->getArgument('cardUri') === $uri && $e->getArgument('cardData') === $this->vcardTest0; @@ -299,7 +299,7 @@ class CardDavBackendTest extends TestCase { // Expect event $this->dispatcher->expects($this->at(0)) ->method('dispatch') - ->with('\OCA\DAV\CardDAV\CardDavBackend::deleteCard', $this->callback(function(GenericEvent $e) use ($bookId, $uri) { + ->with('\OCA\DAV\CardDAV\CardDavBackend::deleteCard', $this->callback(function (GenericEvent $e) use ($bookId, $uri) { return $e->getArgument('addressBookId') === $bookId && $e->getArgument('cardUri') === $uri; })); diff --git a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php index 0f16259d337..4ef1f1bdda1 100644 --- a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php +++ b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php @@ -140,7 +140,7 @@ class ImageExportPluginTest extends TestCase { ->willReturn(1); $this->tree->method('getNodeForPath') - ->willReturnCallback(function($path) use ($card, $book) { + ->willReturnCallback(function ($path) use ($card, $book) { if ($path === 'user/book/card') { return $card; } else if ($path === 'user/book') { diff --git a/apps/dav/tests/unit/Comments/RootCollectionTest.php b/apps/dav/tests/unit/Comments/RootCollectionTest.php index 5191c735a67..f039c0d6ea3 100644 --- a/apps/dav/tests/unit/Comments/RootCollectionTest.php +++ b/apps/dav/tests/unit/Comments/RootCollectionTest.php @@ -100,8 +100,8 @@ class RootCollectionTest extends \Test\TestCase { ->method('getUser') ->willReturn($this->user); - $this->dispatcher->addListener(CommentsEntityEvent::EVENT_ENTITY, function(CommentsEntityEvent $event) { - $event->addEntityCollection('files', function() { + $this->dispatcher->addListener(CommentsEntityEvent::EVENT_ENTITY, function (CommentsEntityEvent $event) { + $event->addEntityCollection('files', function () { return true; }); }); diff --git a/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php index 95bab8cad5b..ff9fac3ff18 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php @@ -62,7 +62,7 @@ class ExceptionLoggerPluginTest extends TestCase { $config = $this->createMock(SystemConfig::class); $config->expects($this->any()) ->method('getValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { switch ($key) { case 'loglevel': return 0; diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php index 870f3709a58..bc49fb442a2 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php @@ -283,7 +283,7 @@ class ObjectTreeTest extends \Test\TestCase { ->getMock(); $view->expects($this->once()) ->method('resolvePath') - ->willReturnCallback(function($path) use ($storage){ + ->willReturnCallback(function ($path) use ($storage) { return [$storage, ltrim($path, '/')]; }); diff --git a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php index cb4104044b7..93cae17d539 100644 --- a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php @@ -392,7 +392,7 @@ class PrincipalTest extends TestCase { $this->proxyMapper->expects($this->at(1)) ->method('insert') - ->with($this->callback(function($proxy) { + ->with($this->callback(function ($proxy) { /** @var Proxy $proxy */ if ($proxy->getOwnerId() !== 'principals/users/foo') { return false; diff --git a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php index e7a1d5073ed..e83aec4d198 100644 --- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php @@ -125,7 +125,7 @@ class SharesPluginTest extends \Test\TestCase { $this->equalTo(false), $this->equalTo(-1) ) - ->willReturnCallback(function($userId, $requestedShareType, $node, $flag, $limit) use ($shareTypes){ + ->willReturnCallback(function ($userId, $requestedShareType, $node, $flag, $limit) use ($shareTypes) { if (in_array($requestedShareType, $shareTypes)) { $share = $this->createMock(IShare::class); $share->method('getShareType') @@ -191,7 +191,7 @@ class SharesPluginTest extends \Test\TestCase { ->with('/subdir') ->willReturn($node); - $dummyShares = array_map(function($type) { + $dummyShares = array_map(function ($type) { $share = $this->getMockBuilder(IShare::class)->getMock(); $share->expects($this->any()) ->method('getShareType') @@ -208,7 +208,7 @@ class SharesPluginTest extends \Test\TestCase { $this->equalTo(false), $this->equalTo(-1) ) - ->willReturnCallback(function($userId, $requestedShareType, $node, $flag, $limit) use ($shareTypes, $dummyShares){ + ->willReturnCallback(function ($userId, $requestedShareType, $node, $flag, $limit) use ($shareTypes, $dummyShares) { if ($node->getId() === 111 && in_array($requestedShareType, $shareTypes)) { foreach ($dummyShares as $dummyShare) { if ($dummyShare->getShareType() === $requestedShareType) { diff --git a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php index b3b21d2f32a..18f73d9685e 100644 --- a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php +++ b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php @@ -82,7 +82,7 @@ class BirthdayCalendarControllerTest extends TestCase { $this->userManager->expects($this->once()) ->method('callForSeenUsers') - ->willReturnCallback(function($closure) { + ->willReturnCallback(function ($closure) { $user1 = $this->createMock(IUser::class); $user1->method('getUID')->willReturn('uid1'); $user2 = $this->createMock(IUser::class); diff --git a/apps/dav/tests/unit/Controller/DirectControllerTest.php b/apps/dav/tests/unit/Controller/DirectControllerTest.php index c24243e81e3..20e5888dfb0 100644 --- a/apps/dav/tests/unit/Controller/DirectControllerTest.php +++ b/apps/dav/tests/unit/Controller/DirectControllerTest.php @@ -143,7 +143,7 @@ class DirectControllerTest extends TestCase { }); $this->urlGenerator->method('getAbsoluteURL') - ->willReturnCallback(function(string $url) { + ->willReturnCallback(function (string $url) { return 'https://my.nextcloud/'.$url; }); diff --git a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php index b703ef930e2..6e3a562e801 100644 --- a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php +++ b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php @@ -108,7 +108,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function (Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -164,7 +164,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function (Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -221,7 +221,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function (Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -304,7 +304,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function (Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -382,7 +382,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function (Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); diff --git a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php index 9dcf39d70f3..721c2c4b074 100644 --- a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php +++ b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php @@ -37,7 +37,7 @@ class AnonymousOptionsTest extends TestCase { private function sendRequest($method, $path, $userAgent = '') { $server = new Server(); $server->addPlugin(new AnonymousOptionsPlugin()); - $server->addPlugin(new Plugin(new BasicCallBack(function() { + $server->addPlugin(new Plugin(new BasicCallBack(function () { return false; }))); diff --git a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php index ef2634403e5..1143fd8192d 100644 --- a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php +++ b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php @@ -124,7 +124,7 @@ class FilesDropPluginTest extends TestCase { ->willReturn('https://example.com'); $this->view->method('file_exists') - ->willReturnCallback(function($path) { + ->willReturnCallback(function ($path) { if ($path === 'file.txt' || $path === '/file.txt') { return true; } else { @@ -165,7 +165,7 @@ class FilesDropPluginTest extends TestCase { ->willReturn('https://example.com'); $this->view->method('file_exists') - ->willReturnCallback(function($path) { + ->willReturnCallback(function ($path) { if ($path === 'file.txt' || $path === '/file.txt') { return true; } else { diff --git a/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php b/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php index 8d1b36f46cc..1b09c96c940 100644 --- a/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php +++ b/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php @@ -78,7 +78,7 @@ class AppleProvisioningPluginTest extends TestCase { $this->themingDefaults, $this->request, $this->l10n, - function() { + function () { return 'generated-uuid'; } ); @@ -92,7 +92,7 @@ class AppleProvisioningPluginTest extends TestCase { $plugin = new AppleProvisioningPlugin($this->userSession, $this->urlGenerator, $this->themingDefaults, $this->request, $this->l10n, - function() {}); + function () {}); $server->expects($this->at(0)) ->method('on') diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php index 58779c0dd46..35a81a03d31 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php @@ -251,7 +251,7 @@ class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { $this->tagManager->expects($this->exactly(3)) ->method('canUserSeeTag') - ->willReturnCallback(function($tag) { + ->willReturnCallback(function ($tag) { return $tag->isUserVisible(); }); diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php index b2af8024084..4e4612001d6 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php @@ -84,7 +84,7 @@ class SystemTagsObjectTypeCollectionTest extends \Test\TestCase { ->getMock(); $userFolder = $this->userFolder; - $closure = function($name) use ($userFolder) { + $closure = function ($name) use ($userFolder) { $nodes = $userFolder->getById(intval($name)); return !empty($nodes); }; |