diff options
author | provokateurin <kate@provokateurin.de> | 2024-09-19 11:10:31 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-09-19 14:21:20 +0200 |
commit | 9836e9b16484582d309c8437ab46d82e34956941 (patch) | |
tree | d3da87bb7dfd1a8877ed25072ecf609def844089 | |
parent | 8c60ffa0f21414e6e671c567d664a9b9e5253e26 (diff) | |
download | nextcloud-server-9836e9b16484582d309c8437ab46d82e34956941.tar.gz nextcloud-server-9836e9b16484582d309c8437ab46d82e34956941.zip |
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
595 files changed, 1655 insertions, 1524 deletions
diff --git a/apps/admin_audit/lib/Actions/Action.php b/apps/admin_audit/lib/Actions/Action.php index 5d06cf4fbf5..2566025a8ce 100644 --- a/apps/admin_audit/lib/Actions/Action.php +++ b/apps/admin_audit/lib/Actions/Action.php @@ -32,13 +32,13 @@ class Action { if (!isset($params[$element])) { if ($obfuscateParameters) { $this->logger->critical( - '$params["'.$element.'"] was missing.', + '$params["' . $element . '"] was missing.', ['app' => 'admin_audit'] ); } else { $this->logger->critical( sprintf( - '$params["'.$element.'"] was missing. Transferred value: %s', + '$params["' . $element . '"] was missing. Transferred value: %s', print_r($params, true) ), ['app' => 'admin_audit'] diff --git a/apps/admin_audit/lib/Actions/Files.php b/apps/admin_audit/lib/Actions/Files.php index 5c08640d2d2..86eba871ea7 100644 --- a/apps/admin_audit/lib/Actions/Files.php +++ b/apps/admin_audit/lib/Actions/Files.php @@ -42,7 +42,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - 'Exception thrown in file read: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file read: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -64,7 +64,7 @@ class Files extends Action { $this->renamedNodes[$source->getId()] = $source; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - 'Exception thrown in file rename: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file rename: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -86,7 +86,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - 'Exception thrown in file rename: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file rename: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -112,7 +112,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - 'Exception thrown in file create: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file create: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -141,7 +141,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - 'Exception thrown in file copy: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file copy: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -166,7 +166,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - 'Exception thrown in file write: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file write: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -194,7 +194,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - 'Exception thrown in file update: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file update: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -218,7 +218,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - 'Exception thrown in file delete: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file delete: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } diff --git a/apps/admin_audit/lib/Listener/FileEventListener.php b/apps/admin_audit/lib/Listener/FileEventListener.php index 74bb2ac836c..369f97239d7 100644 --- a/apps/admin_audit/lib/Listener/FileEventListener.php +++ b/apps/admin_audit/lib/Listener/FileEventListener.php @@ -48,7 +48,7 @@ class FileEventListener extends Action implements IEventListener { ); } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - 'Exception thrown in file preview: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file preview: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } diff --git a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php index a49d70b6930..733f02434cd 100644 --- a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php +++ b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php @@ -50,7 +50,7 @@ class RequestHandlerController extends Controller { private ICloudFederationProviderManager $cloudFederationProviderManager, private Config $config, private ICloudFederationFactory $factory, - private ICloudIdManager $cloudIdManager + private ICloudIdManager $cloudIdManager, ) { parent::__construct($appName, $request); } diff --git a/apps/comments/lib/Controller/NotificationsController.php b/apps/comments/lib/Controller/NotificationsController.php index a3228247884..2dc94b2e663 100644 --- a/apps/comments/lib/Controller/NotificationsController.php +++ b/apps/comments/lib/Controller/NotificationsController.php @@ -33,7 +33,7 @@ class NotificationsController extends Controller { protected IRootFolder $rootFolder, protected IURLGenerator $urlGenerator, protected IManager $notificationManager, - protected IUserSession $userSession + protected IUserSession $userSession, ) { parent::__construct($appName, $request); } diff --git a/apps/comments/lib/Notification/Listener.php b/apps/comments/lib/Notification/Listener.php index 44fb8fe3f4c..43922f85e59 100644 --- a/apps/comments/lib/Notification/Listener.php +++ b/apps/comments/lib/Notification/Listener.php @@ -16,7 +16,7 @@ use OCP\Notification\INotification; class Listener { public function __construct( protected IManager $notificationManager, - protected IUserManager $userManager + protected IUserManager $userManager, ) { } diff --git a/apps/comments/lib/Notification/Notifier.php b/apps/comments/lib/Notification/Notifier.php index d5563ef7d85..62562bf42aa 100644 --- a/apps/comments/lib/Notification/Notifier.php +++ b/apps/comments/lib/Notification/Notifier.php @@ -25,7 +25,7 @@ class Notifier implements INotifier { protected IRootFolder $rootFolder, protected ICommentsManager $commentsManager, protected IURLGenerator $url, - protected IUserManager $userManager + protected IUserManager $userManager, ) { } diff --git a/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php index c214f8950cb..abf12f7d587 100644 --- a/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php +++ b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php @@ -56,7 +56,7 @@ class BuildReminderIndexBackgroundJob extends QueuedJob { $offset = (int)$argument['offset']; $stopAt = (int)$argument['stopAt']; - $this->logger->info('Building calendar reminder index (' . $offset .'/' . $stopAt . ')'); + $this->logger->info('Building calendar reminder index (' . $offset . '/' . $stopAt . ')'); $offset = $this->buildIndex($offset, $stopAt); diff --git a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php index f9c4d8dcd74..7cc56698a9f 100644 --- a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php +++ b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php @@ -28,14 +28,16 @@ use Sabre\VObject\Reader; use Sabre\VObject\Recur\RRuleIterator; class UserStatusAutomation extends TimedJob { - public function __construct(private ITimeFactory $timeFactory, + public function __construct( + private ITimeFactory $timeFactory, private IDBConnection $connection, private IJobList $jobList, private LoggerInterface $logger, private IManager $manager, private IConfig $config, private IAvailabilityCoordinator $coordinator, - private IUserManager $userManager) { + private IUserManager $userManager, + ) { parent::__construct($timeFactory); // Interval 0 might look weird, but the last_checked is always moved diff --git a/apps/dav/lib/BulkUpload/BulkUploadPlugin.php b/apps/dav/lib/BulkUpload/BulkUploadPlugin.php index 8a99beaec6a..381f6aa9e33 100644 --- a/apps/dav/lib/BulkUpload/BulkUploadPlugin.php +++ b/apps/dav/lib/BulkUpload/BulkUploadPlugin.php @@ -22,7 +22,7 @@ class BulkUploadPlugin extends ServerPlugin { public function __construct( Folder $userFolder, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->userFolder = $userFolder; $this->logger = $logger; diff --git a/apps/dav/lib/BulkUpload/MultipartRequestParser.php b/apps/dav/lib/BulkUpload/MultipartRequestParser.php index 97aa0597b34..107c67ea691 100644 --- a/apps/dav/lib/BulkUpload/MultipartRequestParser.php +++ b/apps/dav/lib/BulkUpload/MultipartRequestParser.php @@ -45,8 +45,8 @@ class MultipartRequestParser { $this->stream = $stream; $boundary = $this->parseBoundaryFromHeaders($contentType); - $this->boundary = '--'.$boundary."\r\n"; - $this->lastBoundary = '--'.$boundary."--\r\n"; + $this->boundary = '--' . $boundary . "\r\n"; + $this->lastBoundary = '--' . $boundary . "--\r\n"; } /** diff --git a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php index de5b1139880..933679436d4 100644 --- a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php +++ b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php @@ -110,7 +110,7 @@ class EnablePlugin extends ServerPlugin { $requestBody = $request->getBodyAsString(); $this->server->xml->parse($requestBody, $request->getUrl(), $documentType); - if ($documentType !== '{'.self::NS_Nextcloud.'}enable-birthday-calendar') { + if ($documentType !== '{' . self::NS_Nextcloud . '}enable-birthday-calendar') { return; } diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index a10d73c4aa0..9a717b96d63 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -108,7 +108,7 @@ class BirthdayService { $calendar = $this->ensureCalendarExists($principalUri); foreach (['', '-death', '-anniversary'] as $tag) { - $objectUri = $book['uri'] . '-' . $cardUri . $tag .'.ics'; + $objectUri = $book['uri'] . '-' . $cardUri . $tag . '.ics'; $this->calDavBackEnd->deleteCalendarObject($calendar['id'], $objectUri, CalDavBackend::CALENDAR_TYPE_CALENDAR, true); } } @@ -264,7 +264,7 @@ class BirthdayService { * @param string $user */ public function resetForUser(string $user):void { - $principal = 'principals/users/'.$user; + $principal = 'principals/users/' . $user; $calendar = $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI); if (!$calendar) { return; // The user's birthday calendar doesn't exist, no need to purge it @@ -281,7 +281,7 @@ class BirthdayService { * @throws \Sabre\DAV\Exception\BadRequest */ public function syncUser(string $user):void { - $principal = 'principals/users/'.$user; + $principal = 'principals/users/' . $user; $this->ensureCalendarExists($principal); $books = $this->cardDavBackEnd->getAddressBooksForUser($principal); foreach ($books as $book) { diff --git a/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php b/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php index 17e6f4389cc..1301fdb6000 100644 --- a/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php +++ b/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php @@ -20,7 +20,7 @@ class CachedSubscriptionImpl implements ICalendar { public function __construct( CachedSubscription $calendar, array $calendarInfo, - CalDavBackend $backend + CalDavBackend $backend, ) { $this->calendar = $calendar; $this->calendarInfo = $calendarInfo; diff --git a/apps/dav/lib/CalDAV/CachedSubscriptionProvider.php b/apps/dav/lib/CalDAV/CachedSubscriptionProvider.php index 73fde0b71a0..d64f039d05b 100644 --- a/apps/dav/lib/CalDAV/CachedSubscriptionProvider.php +++ b/apps/dav/lib/CalDAV/CachedSubscriptionProvider.php @@ -13,7 +13,7 @@ use OCP\Calendar\ICalendarProvider; class CachedSubscriptionProvider implements ICalendarProvider { public function __construct( - private CalDavBackend $calDavBackend + private CalDavBackend $calDavBackend, ) { } diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 8b619712b82..b8dfe762e35 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -354,7 +354,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $fields = array_column($this->propertyMap, 0); $fields = array_map(function (string $field) { - return 'a.'.$field; + return 'a.' . $field; }, $fields); $fields[] = 'a.id'; $fields[] = 'a.uri'; @@ -1713,19 +1713,19 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription try { $matches = $this->validateFilterForObject($row, $filters); } catch (ParseException $ex) { - $this->logger->error('Caught parsing exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$calendarId.' uri:'.$row['uri'], [ + $this->logger->error('Caught parsing exception for calendar data. This usually indicates invalid calendar data. calendar-id:' . $calendarId . ' uri:' . $row['uri'], [ 'app' => 'dav', 'exception' => $ex, ]); continue; } catch (InvalidDataException $ex) { - $this->logger->error('Caught invalid data exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$calendarId.' uri:'.$row['uri'], [ + $this->logger->error('Caught invalid data exception for calendar data. This usually indicates invalid calendar data. calendar-id:' . $calendarId . ' uri:' . $row['uri'], [ 'app' => 'dav', 'exception' => $ex, ]); continue; } catch (MaxInstancesExceededException $ex) { - $this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: '.$row['uri'], [ + $this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: ' . $row['uri'], [ 'app' => 'dav', 'exception' => $ex, ]); @@ -1848,7 +1848,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription ->andWhere($compExpr) ->andWhere($propParamExpr) ->andWhere($query->expr()->iLike('i.value', - $query->createNamedParameter('%'.$this->db->escapeLikeParameter($filters['search-term']).'%'))) + $query->createNamedParameter('%' . $this->db->escapeLikeParameter($filters['search-term']) . '%'))) ->andWhere($query->expr()->isNull('deleted_at')); if ($offset) { @@ -1890,7 +1890,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription array $searchProperties, array $options, $limit, - $offset + $offset, ) { $outerQuery = $this->db->getQueryBuilder(); $innerQuery = $this->db->getQueryBuilder(); @@ -2066,7 +2066,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription return $calendarObjects; } - private function searchCalendarObjects(IQueryBuilder $query, DateTimeInterface|null $start, DateTimeInterface|null $end): array { + private function searchCalendarObjects(IQueryBuilder $query, ?DateTimeInterface $start, ?DateTimeInterface $end): array { $calendarObjects = []; $filterByTimeRange = ($start instanceof DateTimeInterface) || ($end instanceof DateTimeInterface); @@ -2099,7 +2099,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription 'time-range' => null, ]); } catch (MaxInstancesExceededException $ex) { - $this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: '.$row['uri'], [ + $this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: ' . $row['uri'], [ 'app' => 'dav', 'exception' => $ex, ]); @@ -2196,7 +2196,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription array $componentTypes, array $searchProperties, array $searchParameters, - array $options = [] + array $options = [], ): array { return $this->atomic(function () use ($principalUri, $pattern, $componentTypes, $searchProperties, $searchParameters, $options) { $escapePattern = !\array_key_exists('escape_like_param', $options) || $options['escape_like_param'] !== false; diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php index 28267921a6f..d3e0b3b2226 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -189,8 +189,8 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IRestorable, IShareable $acl = $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl); $allowedPrincipals = [ $this->getOwner(), - $this->getOwner(). '/calendar-proxy-read', - $this->getOwner(). '/calendar-proxy-write', + $this->getOwner() . '/calendar-proxy-read', + $this->getOwner() . '/calendar-proxy-write', parent::getOwner(), 'principals/system/public' ]; diff --git a/apps/dav/lib/CalDAV/CalendarHome.php b/apps/dav/lib/CalDAV/CalendarHome.php index 59a976ca6bc..4ac00578969 100644 --- a/apps/dav/lib/CalDAV/CalendarHome.php +++ b/apps/dav/lib/CalDAV/CalendarHome.php @@ -42,7 +42,7 @@ class CalendarHome extends \Sabre\CalDAV\CalendarHome { BackendInterface $caldavBackend, array $principalInfo, LoggerInterface $logger, - private bool $returnCachedSubscriptions + private bool $returnCachedSubscriptions, ) { parent::__construct($caldavBackend, $principalInfo); $this->l10n = \OC::$server->getL10N('dav'); diff --git a/apps/dav/lib/CalDAV/CalendarRoot.php b/apps/dav/lib/CalDAV/CalendarRoot.php index 7e57b70c481..9ab3a4dd43f 100644 --- a/apps/dav/lib/CalDAV/CalendarRoot.php +++ b/apps/dav/lib/CalDAV/CalendarRoot.php @@ -20,7 +20,7 @@ class CalendarRoot extends \Sabre\CalDAV\CalendarRoot { PrincipalBackend\BackendInterface $principalBackend, Backend\BackendInterface $caldavBackend, $principalPrefix, - LoggerInterface $logger + LoggerInterface $logger, ) { parent::__construct($principalBackend, $caldavBackend, $principalPrefix); $this->logger = $logger; diff --git a/apps/dav/lib/CalDAV/EventReader.php b/apps/dav/lib/CalDAV/EventReader.php index bdceb184fb0..6e845c596ae 100644 --- a/apps/dav/lib/CalDAV/EventReader.php +++ b/apps/dav/lib/CalDAV/EventReader.php @@ -89,7 +89,7 @@ class EventReader { $events = $input->getByUID($uid); // evaluate if any event where found if (count($events) === 0) { - throw new InvalidArgumentException('This VCALENDAR did not have an event with UID: '.$uid); + throw new InvalidArgumentException('This VCALENDAR did not have an event with UID: ' . $uid); } // extract calendar timezone if (isset($input->VTIMEZONE) && isset($input->VTIMEZONE->TZID)) { @@ -297,7 +297,7 @@ class EventReader { * * @return string|null R - Relative or A - Absolute */ - public function recurringPattern(): string|null { + public function recurringPattern(): ?string { if ($this->rruleIterator === null && $this->rdateIterator === null) { return null; } @@ -314,7 +314,7 @@ class EventReader { * * @return string|null daily, weekly, monthly, yearly, fixed */ - public function recurringPrecision(): string|null { + public function recurringPrecision(): ?string { if ($this->rruleIterator !== null) { return $this->rruleIterator->precision(); } @@ -331,7 +331,7 @@ class EventReader { * * @return int|null */ - public function recurringInterval(): int|null { + public function recurringInterval(): ?int { return $this->rruleIterator?->interval(); } @@ -374,7 +374,7 @@ class EventReader { * * @return int|null */ - public function recurringConcludesAfter(): int|null { + public function recurringConcludesAfter(): ?int { // construct count place holder $count = 0; @@ -399,7 +399,7 @@ class EventReader { * * @return DateTime|null */ - public function recurringConcludesOn(): DateTime|null { + public function recurringConcludesOn(): ?DateTime { if ($this->rruleIterator !== null) { // retrieve rrule conclusion date @@ -626,7 +626,7 @@ class EventReader { * * @return DateTime */ - public function recurrenceDate(): DateTime|null { + public function recurrenceDate(): ?DateTime { if ($this->recurrenceCurrentDate !== null) { return DateTime::createFromInterface($this->recurrenceCurrentDate); } else { diff --git a/apps/dav/lib/CalDAV/EventReaderRDate.php b/apps/dav/lib/CalDAV/EventReaderRDate.php index 9d9669dc0f3..20234d06c00 100644 --- a/apps/dav/lib/CalDAV/EventReaderRDate.php +++ b/apps/dav/lib/CalDAV/EventReaderRDate.php @@ -13,15 +13,15 @@ use DateTime; class EventReaderRDate extends \Sabre\VObject\Recur\RDateIterator { - public function concludes(): DateTime|null { + public function concludes(): ?DateTime { return $this->concludesOn(); } - public function concludesAfter(): int|null { + public function concludesAfter(): ?int { return !empty($this->dates) ? count($this->dates) : null; } - public function concludesOn(): DateTime|null { + public function concludesOn(): ?DateTime { if (count($this->dates) > 0) { return new DateTime( $this->dates[array_key_last($this->dates)], diff --git a/apps/dav/lib/CalDAV/EventReaderRRule.php b/apps/dav/lib/CalDAV/EventReaderRRule.php index fc229ddcd44..d2b4968c479 100644 --- a/apps/dav/lib/CalDAV/EventReaderRRule.php +++ b/apps/dav/lib/CalDAV/EventReaderRRule.php @@ -22,7 +22,7 @@ class EventReaderRRule extends \Sabre\VObject\Recur\RRuleIterator { return $this->interval; } - public function concludes(): DateTime|null { + public function concludes(): ?DateTime { // evaluate if until value is a date if ($this->until instanceof DateTimeInterface) { return DateTime::createFromInterface($this->until); @@ -48,11 +48,11 @@ class EventReaderRRule extends \Sabre\VObject\Recur\RRuleIterator { return null; } - public function concludesAfter(): int|null { + public function concludesAfter(): ?int { return !empty($this->count) ? $this->count : null; } - public function concludesOn(): DateTime|null { + public function concludesOn(): ?DateTime { return isset($this->until) ? DateTime::createFromInterface($this->until) : null; } diff --git a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php index 1b30884cf12..6f8746283d1 100644 --- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php +++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php @@ -97,17 +97,17 @@ class PublishPlugin extends ServerPlugin { public function propFind(PropFind $propFind, INode $node) { if ($node instanceof Calendar) { - $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node) { + $propFind->handle('{' . self::NS_CALENDARSERVER . '}publish-url', function () use ($node) { if ($node->getPublishStatus()) { // We return the publish-url only if the calendar is published. $token = $node->getPublishStatus(); - $publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri().'public-calendars/').$token; + $publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri() . 'public-calendars/') . $token; return new Publisher($publishUrl, true); } }); - $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()); @@ -160,7 +160,7 @@ class PublishPlugin extends ServerPlugin { switch ($documentType) { - case '{'.self::NS_CALENDARSERVER.'}publish-calendar': + case '{' . self::NS_CALENDARSERVER . '}publish-calendar': // We can only deal with IShareableCalendar objects if (!$node instanceof Calendar) { @@ -195,7 +195,7 @@ class PublishPlugin extends ServerPlugin { // Breaking the event chain return false; - case '{'.self::NS_CALENDARSERVER.'}unpublish-calendar': + case '{' . self::NS_CALENDARSERVER . '}unpublish-calendar': // We can only deal with IShareableCalendar objects if (!$node instanceof Calendar) { diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php index b6032e733d9..293ce6a8788 100644 --- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php +++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php @@ -446,7 +446,7 @@ class ReminderService { private function writeRemindersToDatabase(array $reminders): void { $uniqueReminders = []; foreach ($reminders as $reminder) { - $key = $reminder['notification_date']. $reminder['event_hash'].$reminder['type']; + $key = $reminder['notification_date'] . $reminder['event_hash'] . $reminder['type']; if (!isset($uniqueReminders[$key])) { $uniqueReminders[$key] = $reminder; } diff --git a/apps/dav/lib/CalDAV/Sharing/Backend.php b/apps/dav/lib/CalDAV/Sharing/Backend.php index 40fb7e03e5f..fc5d65b5994 100644 --- a/apps/dav/lib/CalDAV/Sharing/Backend.php +++ b/apps/dav/lib/CalDAV/Sharing/Backend.php @@ -17,7 +17,8 @@ use Psr\Log\LoggerInterface; class Backend extends SharingBackend { - public function __construct(private IUserManager $userManager, + public function __construct( + private IUserManager $userManager, private IGroupManager $groupManager, private Principal $principalBackend, private ICacheFactory $cacheFactory, diff --git a/apps/dav/lib/CalDAV/Sharing/Service.php b/apps/dav/lib/CalDAV/Sharing/Service.php index 7867b8d1adb..4f0554f09bd 100644 --- a/apps/dav/lib/CalDAV/Sharing/Service.php +++ b/apps/dav/lib/CalDAV/Sharing/Service.php @@ -13,7 +13,9 @@ use OCA\DAV\DAV\Sharing\SharingService; class Service extends SharingService { protected string $resourceType = 'calendar'; - public function __construct(protected SharingMapper $mapper) { + public function __construct( + protected SharingMapper $mapper, + ) { parent::__construct($mapper); } } diff --git a/apps/dav/lib/CalDAV/Status/StatusService.php b/apps/dav/lib/CalDAV/Status/StatusService.php index 56eec5007b8..de19174de58 100644 --- a/apps/dav/lib/CalDAV/Status/StatusService.php +++ b/apps/dav/lib/CalDAV/Status/StatusService.php @@ -27,13 +27,15 @@ use Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp; class StatusService { private ICache $cache; - public function __construct(private ITimeFactory $timeFactory, + public function __construct( + private ITimeFactory $timeFactory, private IManager $calendarManager, private IUserManager $userManager, private UserStatusService $userStatusService, private IAvailabilityCoordinator $availabilityCoordinator, private ICacheFactory $cacheFactory, - private LoggerInterface $logger) { + private LoggerInterface $logger, + ) { $this->cache = $cacheFactory->createLocal('CalendarStatusService'); } diff --git a/apps/dav/lib/CalDAV/TimezoneService.php b/apps/dav/lib/CalDAV/TimezoneService.php index 93f19be1b55..a7709bde0f9 100644 --- a/apps/dav/lib/CalDAV/TimezoneService.php +++ b/apps/dav/lib/CalDAV/TimezoneService.php @@ -20,9 +20,11 @@ use function array_reduce; class TimezoneService { - public function __construct(private IConfig $config, + public function __construct( + private IConfig $config, private PropertyMapper $propertyMapper, - private IManager $calendarManager) { + private IManager $calendarManager, + ) { } public function getUserTimezone(string $userId): ?string { diff --git a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php index 1326a42399b..06f4a153bf9 100644 --- a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php +++ b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php @@ -72,7 +72,7 @@ class DeletedCalendarObject implements IACL, ICalendarObject, IRestorable { public function getContentType() { $mime = 'text/calendar; charset=utf-8'; if (isset($this->objectData['component']) && $this->objectData['component']) { - $mime .= '; component='.$this->objectData['component']; + $mime .= '; component=' . $this->objectData['component']; } return $mime; diff --git a/apps/dav/lib/CalDAV/UpcomingEvent.php b/apps/dav/lib/CalDAV/UpcomingEvent.php index 26760ffedd5..e8b604f460a 100644 --- a/apps/dav/lib/CalDAV/UpcomingEvent.php +++ b/apps/dav/lib/CalDAV/UpcomingEvent.php @@ -13,13 +13,15 @@ use JsonSerializable; use OCA\DAV\ResponseDefinitions; class UpcomingEvent implements JsonSerializable { - public function __construct(private string $uri, + public function __construct( + private string $uri, private ?int $recurrenceId, private string $calendarUri, private ?int $start, private ?string $summary, private ?string $location, - private ?string $calendarAppUrl) { + private ?string $calendarAppUrl, + ) { } public function getUri(): string { diff --git a/apps/dav/lib/CalDAV/UpcomingEventsService.php b/apps/dav/lib/CalDAV/UpcomingEventsService.php index 04ab1be19b4..9c054deb4e0 100644 --- a/apps/dav/lib/CalDAV/UpcomingEventsService.php +++ b/apps/dav/lib/CalDAV/UpcomingEventsService.php @@ -17,11 +17,13 @@ use OCP\IUserManager; use function array_map; class UpcomingEventsService { - public function __construct(private IManager $calendarManager, + public function __construct( + private IManager $calendarManager, private ITimeFactory $timeFactory, private IUserManager $userManager, private IAppManager $appManager, - private IURLGenerator $urlGenerator) { + private IURLGenerator $urlGenerator, + ) { } /** diff --git a/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php b/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php index 4a9721d00ec..b647e63e67b 100644 --- a/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php +++ b/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php @@ -19,7 +19,7 @@ use Sabre\HTTP\ResponseInterface; class CalDavValidatePlugin extends ServerPlugin { public function __construct( - private IAppConfig $config + private IAppConfig $config, ) { } diff --git a/apps/dav/lib/CalDAV/WebcalCaching/Connection.php b/apps/dav/lib/CalDAV/WebcalCaching/Connection.php index 9d626f2db6d..51d8cff2ed3 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/Connection.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/Connection.php @@ -21,9 +21,11 @@ use Sabre\DAV\Xml\Property\Href; use Sabre\VObject\Reader; class Connection { - public function __construct(private IClientService $clientService, + public function __construct( + private IClientService $clientService, private IAppConfig $config, - private LoggerInterface $logger) { + private LoggerInterface $logger, + ) { } /** diff --git a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php index 47fd785d632..348a4e5ddbd 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php @@ -30,10 +30,12 @@ class RefreshWebcalService { public const STRIP_ATTACHMENTS = '{http://calendarserver.org/ns/}subscribed-strip-attachments'; public const STRIP_TODOS = '{http://calendarserver.org/ns/}subscribed-strip-todos'; - public function __construct(private CalDavBackend $calDavBackend, + public function __construct( + private CalDavBackend $calDavBackend, private LoggerInterface $logger, private Connection $connection, - private ITimeFactory $time) { + private ITimeFactory $time, + ) { } public function refreshSubscription(string $principalUri, string $uri) { diff --git a/apps/dav/lib/CardDAV/Security/CardDavRateLimitingPlugin.php b/apps/dav/lib/CardDAV/Security/CardDavRateLimitingPlugin.php index 7f0f1e28623..256d8481ee3 100644 --- a/apps/dav/lib/CardDAV/Security/CardDavRateLimitingPlugin.php +++ b/apps/dav/lib/CardDAV/Security/CardDavRateLimitingPlugin.php @@ -25,12 +25,14 @@ use function explode; class CardDavRateLimitingPlugin extends ServerPlugin { private ?string $userId; - public function __construct(private Limiter $limiter, + public function __construct( + private Limiter $limiter, private IUserManager $userManager, private CardDavBackend $cardDavBackend, private LoggerInterface $logger, private IAppConfig $config, - ?string $userId) { + ?string $userId, + ) { $this->limiter = $limiter; $this->userManager = $userManager; $this->cardDavBackend = $cardDavBackend; diff --git a/apps/dav/lib/CardDAV/Sharing/Backend.php b/apps/dav/lib/CardDAV/Sharing/Backend.php index 5e03f7699fa..557115762fc 100644 --- a/apps/dav/lib/CardDAV/Sharing/Backend.php +++ b/apps/dav/lib/CardDAV/Sharing/Backend.php @@ -16,7 +16,8 @@ use OCP\IUserManager; use Psr\Log\LoggerInterface; class Backend extends SharingBackend { - public function __construct(private IUserManager $userManager, + public function __construct( + private IUserManager $userManager, private IGroupManager $groupManager, private Principal $principalBackend, private ICacheFactory $cacheFactory, diff --git a/apps/dav/lib/CardDAV/Sharing/Service.php b/apps/dav/lib/CardDAV/Sharing/Service.php index 69bcecde227..1ab208f7ec3 100644 --- a/apps/dav/lib/CardDAV/Sharing/Service.php +++ b/apps/dav/lib/CardDAV/Sharing/Service.php @@ -13,7 +13,9 @@ use OCA\DAV\DAV\Sharing\SharingService; class Service extends SharingService { protected string $resourceType = 'addressbook'; - public function __construct(protected SharingMapper $mapper) { + public function __construct( + protected SharingMapper $mapper, + ) { parent::__construct($mapper); } } diff --git a/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php b/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php index 7e76b9dac92..a5fd80ec124 100644 --- a/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php +++ b/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php @@ -19,7 +19,7 @@ use Sabre\HTTP\ResponseInterface; class CardDavValidatePlugin extends ServerPlugin { public function __construct( - private IAppConfig $config + private IAppConfig $config, ) { } diff --git a/apps/dav/lib/Command/DeleteCalendar.php b/apps/dav/lib/Command/DeleteCalendar.php index 53cabcfc5ce..f6dbed856e6 100644 --- a/apps/dav/lib/Command/DeleteCalendar.php +++ b/apps/dav/lib/Command/DeleteCalendar.php @@ -54,7 +54,7 @@ class DeleteCalendar extends Command { protected function execute( InputInterface $input, - OutputInterface $output + OutputInterface $output, ): int { /** @var string $user */ $user = $input->getArgument('uid'); diff --git a/apps/dav/lib/Command/FixCalendarSyncCommand.php b/apps/dav/lib/Command/FixCalendarSyncCommand.php index e94e1dc9c4a..c10ee7e3da6 100644 --- a/apps/dav/lib/Command/FixCalendarSyncCommand.php +++ b/apps/dav/lib/Command/FixCalendarSyncCommand.php @@ -20,8 +20,10 @@ use Symfony\Component\Console\Output\OutputInterface; class FixCalendarSyncCommand extends Command { - public function __construct(private IUserManager $userManager, - private CalDavBackend $calDavBackend) { + public function __construct( + private IUserManager $userManager, + private CalDavBackend $calDavBackend, + ) { parent::__construct('dav:fix-missing-caldav-changes'); } diff --git a/apps/dav/lib/Comments/CommentNode.php b/apps/dav/lib/Comments/CommentNode.php index a257611dd15..d0f0d585888 100644 --- a/apps/dav/lib/Comments/CommentNode.php +++ b/apps/dav/lib/Comments/CommentNode.php @@ -55,7 +55,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { IComment $comment, IUserManager $userManager, IUserSession $userSession, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->commentsManager = $commentsManager; $this->comment = $comment; @@ -69,7 +69,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { if ($getter === 'getMentions') { continue; // special treatment } - $name = '{'.self::NS_OWNCLOUD.'}' . lcfirst(substr($getter, 3)); + $name = '{' . self::NS_OWNCLOUD . '}' . lcfirst(substr($getter, 3)); $this->properties[$name] = $getter; } $this->userManager = $userManager; diff --git a/apps/dav/lib/Comments/CommentsPlugin.php b/apps/dav/lib/Comments/CommentsPlugin.php index 3be87460d21..52e48ec0ed1 100644 --- a/apps/dav/lib/Comments/CommentsPlugin.php +++ b/apps/dav/lib/Comments/CommentsPlugin.php @@ -216,7 +216,7 @@ class CommentsPlugin extends ServerPlugin { } } if (is_null($actorId)) { - throw new BadRequest('Invalid actor "' . $actorType .'"'); + throw new BadRequest('Invalid actor "' . $actorType . '"'); } try { diff --git a/apps/dav/lib/Comments/EntityCollection.php b/apps/dav/lib/Comments/EntityCollection.php index 19af2d9c234..3135449641c 100644 --- a/apps/dav/lib/Comments/EntityCollection.php +++ b/apps/dav/lib/Comments/EntityCollection.php @@ -46,7 +46,7 @@ class EntityCollection extends RootCollection implements IProperties { ICommentsManager $commentsManager, IUserManager $userManager, IUserSession $userSession, - LoggerInterface $logger + LoggerInterface $logger, ) { foreach (['id', 'name'] as $property) { $$property = trim($$property); diff --git a/apps/dav/lib/Comments/EntityTypeCollection.php b/apps/dav/lib/Comments/EntityTypeCollection.php index da5a18e78c8..b326805542d 100644 --- a/apps/dav/lib/Comments/EntityTypeCollection.php +++ b/apps/dav/lib/Comments/EntityTypeCollection.php @@ -38,7 +38,7 @@ class EntityTypeCollection extends RootCollection { IUserManager $userManager, IUserSession $userSession, LoggerInterface $logger, - \Closure $childExistsFunction + \Closure $childExistsFunction, ) { $name = trim($name); if (empty($name)) { diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php index f2da3782def..65e77cea285 100644 --- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php @@ -80,7 +80,7 @@ class CommentPropertiesPlugin extends ServerPlugin { */ public function handleGetProperties( PropFind $propFind, - \Sabre\DAV\INode $node + \Sabre\DAV\INode $node, ) { if (!($node instanceof File) && !($node instanceof Directory)) { return; diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php index 581adfa4184..b82fee957bc 100644 --- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php @@ -106,7 +106,7 @@ class FilesReportPlugin extends ServerPlugin { IUserSession $userSession, IGroupManager $groupManager, Folder $userFolder, - IAppManager $appManager + IAppManager $appManager, ) { $this->tree = $tree; $this->fileView = $view; diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php index 3ca542fee73..ac5514e11e1 100644 --- a/apps/dav/lib/Connector/Sabre/Node.php +++ b/apps/dav/lib/Connector/Sabre/Node.php @@ -79,7 +79,7 @@ abstract class Node implements \Sabre\DAV\INode { protected function refreshInfo(): void { $info = $this->fileView->getFileInfo($this->path); if ($info === false) { - throw new \Sabre\DAV\Exception('Failed to get fileinfo for '. $this->path); + throw new \Sabre\DAV\Exception('Failed to get fileinfo for ' . $this->path); } $this->info = $info; $root = \OC::$server->get(IRootFolder::class); @@ -131,7 +131,7 @@ abstract class Node implements \Sabre\DAV\INode { $this->verifyPath($newPath); if (!$this->fileView->rename($this->path, $newPath)) { - throw new \Sabre\DAV\Exception('Failed to rename '. $this->path . ' to ' . $newPath); + throw new \Sabre\DAV\Exception('Failed to rename ' . $this->path . ' to ' . $newPath); } $this->path = $newPath; diff --git a/apps/dav/lib/Connector/Sabre/ServerFactory.php b/apps/dav/lib/Connector/Sabre/ServerFactory.php index 42d3ce1818a..106b425b121 100644 --- a/apps/dav/lib/Connector/Sabre/ServerFactory.php +++ b/apps/dav/lib/Connector/Sabre/ServerFactory.php @@ -49,7 +49,7 @@ class ServerFactory { IRequest $request, IPreview $previewManager, IEventDispatcher $eventDispatcher, - IL10N $l10n + IL10N $l10n, ) { $this->config = $config; $this->logger = $logger; diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php index 20e94e9aede..088cf33d85f 100644 --- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php @@ -164,7 +164,7 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin { */ public function handleGetProperties( PropFind $propFind, - \Sabre\DAV\INode $sabreNode + \Sabre\DAV\INode $sabreNode, ) { if (!($sabreNode instanceof DavNode)) { return; diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php index 3f5268f5137..a3f2847ee1a 100644 --- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php +++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php @@ -189,7 +189,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin { */ public function handleGetProperties( PropFind $propFind, - \Sabre\DAV\INode $node + \Sabre\DAV\INode $node, ) { if (!($node instanceof \OCA\DAV\Connector\Sabre\Node)) { return; diff --git a/apps/dav/lib/Controller/DirectController.php b/apps/dav/lib/Controller/DirectController.php index 77f5b8f5419..80e00e93ca7 100644 --- a/apps/dav/lib/Controller/DirectController.php +++ b/apps/dav/lib/Controller/DirectController.php @@ -117,7 +117,7 @@ class DirectController extends OCSController { $this->mapper->insert($direct); - $url = $this->urlGenerator->getAbsoluteURL('remote.php/direct/'.$token); + $url = $this->urlGenerator->getAbsoluteURL('remote.php/direct/' . $token); return new DataResponse([ 'url' => $url, diff --git a/apps/dav/lib/Controller/OutOfOfficeController.php b/apps/dav/lib/Controller/OutOfOfficeController.php index 4978fb87737..e8698992949 100644 --- a/apps/dav/lib/Controller/OutOfOfficeController.php +++ b/apps/dav/lib/Controller/OutOfOfficeController.php @@ -121,7 +121,7 @@ class OutOfOfficeController extends OCSController { string $status, string $message, ?string $replacementUserId, - ?string $replacementUserDisplayName + ?string $replacementUserDisplayName, ): DataResponse { $user = $this->userSession?->getUser(); diff --git a/apps/dav/lib/DAV/GroupPrincipalBackend.php b/apps/dav/lib/DAV/GroupPrincipalBackend.php index 7ccc3f02594..887f3b2d7e9 100644 --- a/apps/dav/lib/DAV/GroupPrincipalBackend.php +++ b/apps/dav/lib/DAV/GroupPrincipalBackend.php @@ -40,7 +40,7 @@ class GroupPrincipalBackend implements BackendInterface { IGroupManager $IGroupManager, IUserSession $userSession, IShareManager $shareManager, - IConfig $config + IConfig $config, ) { $this->groupManager = $IGroupManager; $this->userSession = $userSession; diff --git a/apps/dav/lib/DAV/Sharing/Backend.php b/apps/dav/lib/DAV/Sharing/Backend.php index 5630336df42..06a082628d3 100644 --- a/apps/dav/lib/DAV/Sharing/Backend.php +++ b/apps/dav/lib/DAV/Sharing/Backend.php @@ -27,7 +27,8 @@ abstract class Backend { private ICache $shareCache; - public function __construct(private IUserManager $userManager, + public function __construct( + private IUserManager $userManager, private IGroupManager $groupManager, private Principal $principalBackend, private ICacheFactory $cacheFactory, diff --git a/apps/dav/lib/DAV/Sharing/SharingMapper.php b/apps/dav/lib/DAV/Sharing/SharingMapper.php index 59483ac9471..0aec5b7fe81 100644 --- a/apps/dav/lib/DAV/Sharing/SharingMapper.php +++ b/apps/dav/lib/DAV/Sharing/SharingMapper.php @@ -11,7 +11,9 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; class SharingMapper { - public function __construct(private IDBConnection $db) { + public function __construct( + private IDBConnection $db, + ) { } protected function getSharesForIdByAccess(int $resourceId, string $resourceType, bool $sharesWithAccess): array { diff --git a/apps/dav/lib/DAV/Sharing/SharingService.php b/apps/dav/lib/DAV/Sharing/SharingService.php index de280d2c347..b9ac36ea066 100644 --- a/apps/dav/lib/DAV/Sharing/SharingService.php +++ b/apps/dav/lib/DAV/Sharing/SharingService.php @@ -9,7 +9,9 @@ namespace OCA\DAV\DAV\Sharing; abstract class SharingService { protected string $resourceType = ''; - public function __construct(protected SharingMapper $mapper) { + public function __construct( + protected SharingMapper $mapper, + ) { } public function getResourceType(): string { diff --git a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php index ca9602fb8c2..aa3a880df6b 100644 --- a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php +++ b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php @@ -29,7 +29,7 @@ class ShareRequest implements XmlDeserializable { public static function xmlDeserialize(Reader $reader) { $elements = $reader->parseInnerTree([ - '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', + '{' . Plugin::NS_OWNCLOUD . '}set' => 'Sabre\\Xml\\Element\\KeyValue', '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', ]); diff --git a/apps/dav/lib/Direct/DirectHome.php b/apps/dav/lib/Direct/DirectHome.php index 36ff8b213cb..66fe6f0f3d4 100644 --- a/apps/dav/lib/Direct/DirectHome.php +++ b/apps/dav/lib/Direct/DirectHome.php @@ -46,7 +46,7 @@ class DirectHome implements ICollection { ITimeFactory $timeFactory, IThrottler $throttler, IRequest $request, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { $this->rootFolder = $rootFolder; $this->mapper = $mapper; diff --git a/apps/dav/lib/Listener/OutOfOfficeListener.php b/apps/dav/lib/Listener/OutOfOfficeListener.php index e0997e8182b..45728aa35d3 100644 --- a/apps/dav/lib/Listener/OutOfOfficeListener.php +++ b/apps/dav/lib/Listener/OutOfOfficeListener.php @@ -39,7 +39,7 @@ class OutOfOfficeListener implements IEventListener { private ServerFactory $serverFactory, private IConfig $appConfig, private TimezoneService $timezoneService, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php index 4c87e25c698..da8f31e7d3d 100644 --- a/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php @@ -21,7 +21,7 @@ class BuildCalendarSearchIndexBackgroundJob extends QueuedJob { private CalDavBackend $calDavBackend, private LoggerInterface $logger, private IJobList $jobList, - ITimeFactory $timeFactory + ITimeFactory $timeFactory, ) { parent::__construct($timeFactory); } @@ -30,7 +30,7 @@ class BuildCalendarSearchIndexBackgroundJob extends QueuedJob { $offset = (int)$arguments['offset']; $stopAt = (int)$arguments['stopAt']; - $this->logger->info('Building calendar index (' . $offset .'/' . $stopAt . ')'); + $this->logger->info('Building calendar index (' . $offset . '/' . $stopAt . ')'); $startTime = $this->time->getTime(); while (($this->time->getTime() - $startTime) < 15) { diff --git a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php index 138f764f1e6..072a4feacc6 100644 --- a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php @@ -31,7 +31,7 @@ class BuildSocialSearchIndexBackgroundJob extends QueuedJob { $offset = $arguments['offset']; $stopAt = $arguments['stopAt']; - $this->logger->info('Indexing social profile data (' . $offset .'/' . $stopAt . ')'); + $this->logger->info('Indexing social profile data (' . $offset . '/' . $stopAt . ')'); $offset = $this->buildIndex($offset, $stopAt); diff --git a/apps/dav/lib/Migration/DeleteSchedulingObjects.php b/apps/dav/lib/Migration/DeleteSchedulingObjects.php index 3919236788b..3cb3c9c9b10 100644 --- a/apps/dav/lib/Migration/DeleteSchedulingObjects.php +++ b/apps/dav/lib/Migration/DeleteSchedulingObjects.php @@ -16,9 +16,10 @@ use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; class DeleteSchedulingObjects implements IRepairStep { - public function __construct(private IJobList $jobList, + public function __construct( + private IJobList $jobList, private ITimeFactory $time, - private CalDavBackend $calDavBackend + private CalDavBackend $calDavBackend, ) { } diff --git a/apps/dav/lib/Migration/Version1027Date20230504122946.php b/apps/dav/lib/Migration/Version1027Date20230504122946.php index 9e1d1701934..f294cf192c2 100644 --- a/apps/dav/lib/Migration/Version1027Date20230504122946.php +++ b/apps/dav/lib/Migration/Version1027Date20230504122946.php @@ -20,10 +20,12 @@ use Psr\Log\LoggerInterface; use Throwable; class Version1027Date20230504122946 extends SimpleMigrationStep { - public function __construct(private SyncService $syncService, + public function __construct( + private SyncService $syncService, private LoggerInterface $logger, private IUserManager $userManager, - private IConfig $config) { + private IConfig $config, + ) { } /** * @param IOutput $output diff --git a/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php b/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php index 54818a890f3..1a02457d653 100644 --- a/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php +++ b/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php @@ -59,7 +59,7 @@ class AppleProvisioningPlugin extends ServerPlugin { \OC_Defaults $themingDefaults, IRequest $request, IL10N $l10n, - \Closure $uuidClosure + \Closure $uuidClosure, ) { $this->userSession = $userSession; $this->urlGenerator = $urlGenerator; diff --git a/apps/dav/lib/Search/EventsSearchProvider.php b/apps/dav/lib/Search/EventsSearchProvider.php index 4747635bd7e..55fba40918a 100644 --- a/apps/dav/lib/Search/EventsSearchProvider.php +++ b/apps/dav/lib/Search/EventsSearchProvider.php @@ -194,7 +194,7 @@ class EventsSearchProvider extends ACalendarSearchProvider implements IFiltering protected function getDavUrlForCalendarObject( string $principalUri, string $calendarUri, - string $calendarObjectUri + string $calendarObjectUri, ): string { [,, $principalId] = explode('/', $principalUri, 3); diff --git a/apps/dav/lib/Settings/AvailabilitySettings.php b/apps/dav/lib/Settings/AvailabilitySettings.php index dba4662a5ce..6afb03bda8d 100644 --- a/apps/dav/lib/Settings/AvailabilitySettings.php +++ b/apps/dav/lib/Settings/AvailabilitySettings.php @@ -24,12 +24,14 @@ class AvailabilitySettings implements ISettings { protected IInitialState $initialState; protected ?string $userId; - public function __construct(IConfig $config, + public function __construct( + IConfig $config, IInitialState $initialState, ?string $userId, private LoggerInterface $logger, private IAvailabilityCoordinator $coordinator, - private AbsenceMapper $absenceMapper) { + private AbsenceMapper $absenceMapper, + ) { $this->config = $config; $this->initialState = $initialState; $this->userId = $userId; diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php index ec2014163b3..bf7e5e00053 100644 --- a/apps/dav/lib/SystemTag/SystemTagPlugin.php +++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php @@ -216,7 +216,7 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { */ public function handleGetProperties( PropFind $propFind, - \Sabre\DAV\INode $node + \Sabre\DAV\INode $node, ) { if ($node instanceof Node) { $this->propfindForFile($propFind, $node); diff --git a/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php b/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php index c591001179f..13e79c99b65 100644 --- a/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php @@ -44,7 +44,7 @@ class SystemTagsByIdCollection implements ICollection { public function __construct( ISystemTagManager $tagManager, IUserSession $userSession, - IGroupManager $groupManager + IGroupManager $groupManager, ) { $this->tagManager = $tagManager; $this->userSession = $userSession; diff --git a/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php b/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php index fbe393a7d97..0431acc553a 100644 --- a/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php @@ -33,7 +33,7 @@ class SystemTagsInUseCollection extends SimpleCollection { IRootFolder $rootFolder, ISystemTagManager $systemTagManager, SystemTagsInFilesDetector $systemTagsInFilesDetector, - string $mediaType = '' + string $mediaType = '', ) { $this->userSession = $userSession; $this->rootFolder = $rootFolder; diff --git a/apps/dav/lib/UserMigration/CalendarMigrator.php b/apps/dav/lib/UserMigration/CalendarMigrator.php index 80b564e24ee..7e5bdcd7890 100644 --- a/apps/dav/lib/UserMigration/CalendarMigrator.php +++ b/apps/dav/lib/UserMigration/CalendarMigrator.php @@ -67,7 +67,7 @@ class CalendarMigrator implements IMigrator, ISizeEstimationMigrator { ICalendarManager $calendarManager, ICSExportPlugin $icsExportPlugin, Defaults $defaults, - IL10N $l10n + IL10N $l10n, ) { $this->calDavBackend = $calDavBackend; $this->calendarManager = $calendarManager; diff --git a/apps/dav/lib/UserMigration/ContactsMigrator.php b/apps/dav/lib/UserMigration/ContactsMigrator.php index a14d3bc5e1c..50787dc4e5d 100644 --- a/apps/dav/lib/UserMigration/ContactsMigrator.php +++ b/apps/dav/lib/UserMigration/ContactsMigrator.php @@ -55,7 +55,7 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator { public function __construct( CardDavBackend $cardDavBackend, - IL10N $l10n + IL10N $l10n, ) { $this->cardDavBackend = $cardDavBackend; $this->l10n = $l10n; diff --git a/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php b/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php index 8d98a765fc1..06261ca6fa5 100644 --- a/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php +++ b/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php @@ -380,7 +380,7 @@ class PluginTest extends TestCase { $this->server->expects($this->once()) ->method('getPropertiesForPath') - ->with($calendarHome .'/' . $calendarUri, [], 1) + ->with($calendarHome . '/' . $calendarUri, [], 1) ->willReturn($properties); $this->plugin->propFindDefaultCalendarUrl($propFind, $node); @@ -392,7 +392,7 @@ class PluginTest extends TestCase { /** @var LocalHref $result */ $result = $propFind->get(Plugin::SCHEDULE_DEFAULT_CALENDAR_URL); - $this->assertEquals('/remote.php/dav/'. $calendarHome . '/' . $calendarUri, $result->getHref()); + $this->assertEquals('/remote.php/dav/' . $calendarHome . '/' . $calendarUri, $result->getHref()); } /** diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php index 91d7cc5f49e..96968909d1c 100644 --- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php +++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php @@ -72,35 +72,35 @@ class CardDavBackendTest extends TestCase { public const UNIT_TEST_USER1 = 'principals/users/carddav-unit-test1'; public const UNIT_TEST_GROUP = 'principals/groups/carddav-unit-test-group'; - private $vcardTest0 = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'UID:Test'.PHP_EOL. - 'FN:Test'.PHP_EOL. - 'N:Test;;;;'.PHP_EOL. + private $vcardTest0 = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'UID:Test' . PHP_EOL . + 'FN:Test' . PHP_EOL . + 'N:Test;;;;' . PHP_EOL . 'END:VCARD'; - private $vcardTest1 = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'UID:Test2'.PHP_EOL. - 'FN:Test2'.PHP_EOL. - 'N:Test2;;;;'.PHP_EOL. + private $vcardTest1 = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'UID:Test2' . PHP_EOL . + 'FN:Test2' . PHP_EOL . + 'N:Test2;;;;' . PHP_EOL . 'END:VCARD'; - private $vcardTest2 = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'UID:Test3'.PHP_EOL. - 'FN:Test3'.PHP_EOL. - 'N:Test3;;;;'.PHP_EOL. + private $vcardTest2 = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'UID:Test3' . PHP_EOL . + 'FN:Test3' . PHP_EOL . + 'N:Test3;;;;' . PHP_EOL . 'END:VCARD'; - private $vcardTestNoUID = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'FN:TestNoUID'.PHP_EOL. - 'N:TestNoUID;;;;'.PHP_EOL. + private $vcardTestNoUID = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'FN:TestNoUID' . PHP_EOL . + 'N:TestNoUID;;;;' . PHP_EOL . 'END:VCARD'; protected function setUp(): void { @@ -332,7 +332,7 @@ class CardDavBackendTest extends TestCase { $this->assertArrayHasKey('lastmodified', $card); $this->assertArrayHasKey('etag', $card); $this->assertArrayHasKey('size', $card); - $this->assertEquals($this->{ 'vcardTest'.($index + 1) }, $card['carddata']); + $this->assertEquals($this->{ 'vcardTest' . ($index + 1) }, $card['carddata']); } // delete the card diff --git a/apps/dav/tests/unit/Command/DeleteCalendarTest.php b/apps/dav/tests/unit/Command/DeleteCalendarTest.php index 583673c9d30..b621e6737d5 100644 --- a/apps/dav/tests/unit/Command/DeleteCalendarTest.php +++ b/apps/dav/tests/unit/Command/DeleteCalendarTest.php @@ -100,7 +100,7 @@ class DeleteCalendarTest extends TestCase { public function testInvalidCalendar(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage( - 'User <' . self::USER . '> has no calendar named <' . self::NAME . '>.'); + 'User <' . self::USER . '> has no calendar named <' . self::NAME . '>.'); $this->userManager->expects($this->once()) ->method('userExists') diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php index 5010f7698b5..4f2e5174325 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php @@ -127,7 +127,7 @@ class ObjectTreeTest extends \Test\TestCase { $inputFileName, $fileInfoQueryPath, $outputFileName, - $type + $type, ): void { $rootNode = $this->getMockBuilder(Directory::class) ->disableOriginalConstructor() diff --git a/apps/dav/tests/unit/Controller/DirectControllerTest.php b/apps/dav/tests/unit/Controller/DirectControllerTest.php index 2476681251c..faaf67d266b 100644 --- a/apps/dav/tests/unit/Controller/DirectControllerTest.php +++ b/apps/dav/tests/unit/Controller/DirectControllerTest.php @@ -136,7 +136,7 @@ class DirectControllerTest extends TestCase { $this->urlGenerator->method('getAbsoluteURL') ->willReturnCallback(function (string $url) { - return 'https://my.nextcloud/'.$url; + return 'https://my.nextcloud/' . $url; }); $result = $this->controller->getUrl(101); diff --git a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php index 92c89fc62f8..bfc4c5b2493 100644 --- a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php +++ b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php @@ -349,7 +349,7 @@ class GroupPrincipalTest extends \Test\TestCase { $fooGroup ->expects($this->exactly(1)) ->method('getDisplayName') - ->willReturn('Group '.$gid); + ->willReturn('Group ' . $gid); return $fooGroup; } } diff --git a/apps/dav/tests/unit/Files/MultipartRequestParserTest.php b/apps/dav/tests/unit/Files/MultipartRequestParserTest.php index ebe2a0b172e..e6325ab8ad1 100644 --- a/apps/dav/tests/unit/Files/MultipartRequestParserTest.php +++ b/apps/dav/tests/unit/Files/MultipartRequestParserTest.php @@ -36,7 +36,7 @@ class MultipartRequestParserTest extends TestCase { ->disableOriginalConstructor() ->getMock(); - $headers = array_merge(['Content-Type' => 'multipart/related; boundary='.$boundary], $headers); + $headers = array_merge(['Content-Type' => 'multipart/related; boundary=' . $boundary], $headers); $request->expects($this->any()) ->method('getHeader') ->willReturnCallback(function (string $key) use (&$headers) { @@ -45,17 +45,17 @@ class MultipartRequestParserTest extends TestCase { $body = ''; foreach ($parts as $part) { - $body .= '--'.$boundary."\r\n"; + $body .= '--' . $boundary . "\r\n"; foreach ($part['headers'] as $headerKey => $headerPart) { - $body .= $headerKey.': '.$headerPart."\r\n"; + $body .= $headerKey . ': ' . $headerPart . "\r\n"; } $body .= "\r\n"; - $body .= $part['content']."\r\n"; + $body .= $part['content'] . "\r\n"; } - $body .= '--'.$boundary.'--'; + $body .= '--' . $boundary . '--'; $stream = fopen('php://temp', 'r+'); fwrite($stream, $body); diff --git a/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php b/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php index bfc57dc61d7..0a83d238f0f 100644 --- a/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php @@ -37,22 +37,22 @@ class ContactsSearchProviderTest extends TestCase { /** @var ContactsSearchProvider */ private $provider; - private $vcardTest0 = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'UID:Test'.PHP_EOL. - 'FN:FN of Test'.PHP_EOL. - 'N:Test;;;;'.PHP_EOL. - 'EMAIL:forrestgump@example.com'.PHP_EOL. + private $vcardTest0 = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'UID:Test' . PHP_EOL . + 'FN:FN of Test' . PHP_EOL . + 'N:Test;;;;' . PHP_EOL . + 'EMAIL:forrestgump@example.com' . PHP_EOL . 'END:VCARD'; - private $vcardTest1 = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'PHOTO;ENCODING=b;TYPE=image/jpeg:'.PHP_EOL. - 'UID:Test2'.PHP_EOL. - 'FN:FN of Test2'.PHP_EOL. - 'N:Test2;;;;'.PHP_EOL. + private $vcardTest1 = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'PHOTO;ENCODING=b;TYPE=image/jpeg:' . PHP_EOL . + 'UID:Test2' . PHP_EOL . + 'FN:FN of Test2' . PHP_EOL . + 'N:Test2;;;;' . PHP_EOL . 'END:VCARD'; protected function setUp(): void { diff --git a/apps/dav/tests/unit/Search/EventsSearchProviderTest.php b/apps/dav/tests/unit/Search/EventsSearchProviderTest.php index d194b7fa7c6..0eafe0782e5 100644 --- a/apps/dav/tests/unit/Search/EventsSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/EventsSearchProviderTest.php @@ -38,183 +38,183 @@ class EventsSearchProviderTest extends TestCase { private $provider; // NO SUMMARY - private $vEvent0 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20161004T144433Z'.PHP_EOL. - 'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL. - 'DTEND;VALUE=DATE:20161008'.PHP_EOL. - 'TRANSP:TRANSPARENT'.PHP_EOL. - 'DTSTART;VALUE=DATE:20161005'.PHP_EOL. - 'DTSTAMP:20161004T144437Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent0 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20161004T144433Z' . PHP_EOL . + 'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL . + 'DTEND;VALUE=DATE:20161008' . PHP_EOL . + 'TRANSP:TRANSPARENT' . PHP_EOL . + 'DTSTART;VALUE=DATE:20161005' . PHP_EOL . + 'DTSTAMP:20161004T144437Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // TIMED SAME DAY - private $vEvent1 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Tests//'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VTIMEZONE'.PHP_EOL. - 'TZID:Europe/Berlin'.PHP_EOL. - 'BEGIN:DAYLIGHT'.PHP_EOL. - 'TZOFFSETFROM:+0100'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19810329T020000'.PHP_EOL. - 'TZNAME:GMT+2'.PHP_EOL. - 'TZOFFSETTO:+0200'.PHP_EOL. - 'END:DAYLIGHT'.PHP_EOL. - 'BEGIN:STANDARD'.PHP_EOL. - 'TZOFFSETFROM:+0200'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19961027T030000'.PHP_EOL. - 'TZNAME:GMT+1'.PHP_EOL. - 'TZOFFSETTO:+0100'.PHP_EOL. - 'END:STANDARD'.PHP_EOL. - 'END:VTIMEZONE'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20160809T163629Z'.PHP_EOL. - 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02'.PHP_EOL. - 'DTEND;TZID=Europe/Berlin:20160816T100000'.PHP_EOL. - 'TRANSP:OPAQUE'.PHP_EOL. - 'SUMMARY:Test Europe Berlin'.PHP_EOL. - 'DTSTART;TZID=Europe/Berlin:20160816T090000'.PHP_EOL. - 'DTSTAMP:20160809T163632Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent1 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Tests//' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VTIMEZONE' . PHP_EOL . + 'TZID:Europe/Berlin' . PHP_EOL . + 'BEGIN:DAYLIGHT' . PHP_EOL . + 'TZOFFSETFROM:+0100' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19810329T020000' . PHP_EOL . + 'TZNAME:GMT+2' . PHP_EOL . + 'TZOFFSETTO:+0200' . PHP_EOL . + 'END:DAYLIGHT' . PHP_EOL . + 'BEGIN:STANDARD' . PHP_EOL . + 'TZOFFSETFROM:+0200' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19961027T030000' . PHP_EOL . + 'TZNAME:GMT+1' . PHP_EOL . + 'TZOFFSETTO:+0100' . PHP_EOL . + 'END:STANDARD' . PHP_EOL . + 'END:VTIMEZONE' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20160809T163629Z' . PHP_EOL . + 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02' . PHP_EOL . + 'DTEND;TZID=Europe/Berlin:20160816T100000' . PHP_EOL . + 'TRANSP:OPAQUE' . PHP_EOL . + 'SUMMARY:Test Europe Berlin' . PHP_EOL . + 'DTSTART;TZID=Europe/Berlin:20160816T090000' . PHP_EOL . + 'DTSTAMP:20160809T163632Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // TIMED DIFFERENT DAY - private $vEvent2 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Tests//'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VTIMEZONE'.PHP_EOL. - 'TZID:Europe/Berlin'.PHP_EOL. - 'BEGIN:DAYLIGHT'.PHP_EOL. - 'TZOFFSETFROM:+0100'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19810329T020000'.PHP_EOL. - 'TZNAME:GMT+2'.PHP_EOL. - 'TZOFFSETTO:+0200'.PHP_EOL. - 'END:DAYLIGHT'.PHP_EOL. - 'BEGIN:STANDARD'.PHP_EOL. - 'TZOFFSETFROM:+0200'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19961027T030000'.PHP_EOL. - 'TZNAME:GMT+1'.PHP_EOL. - 'TZOFFSETTO:+0100'.PHP_EOL. - 'END:STANDARD'.PHP_EOL. - 'END:VTIMEZONE'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20160809T163629Z'.PHP_EOL. - 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02'.PHP_EOL. - 'DTEND;TZID=Europe/Berlin:20160817T100000'.PHP_EOL. - 'TRANSP:OPAQUE'.PHP_EOL. - 'SUMMARY:Test Europe Berlin'.PHP_EOL. - 'DTSTART;TZID=Europe/Berlin:20160816T090000'.PHP_EOL. - 'DTSTAMP:20160809T163632Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent2 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Tests//' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VTIMEZONE' . PHP_EOL . + 'TZID:Europe/Berlin' . PHP_EOL . + 'BEGIN:DAYLIGHT' . PHP_EOL . + 'TZOFFSETFROM:+0100' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19810329T020000' . PHP_EOL . + 'TZNAME:GMT+2' . PHP_EOL . + 'TZOFFSETTO:+0200' . PHP_EOL . + 'END:DAYLIGHT' . PHP_EOL . + 'BEGIN:STANDARD' . PHP_EOL . + 'TZOFFSETFROM:+0200' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19961027T030000' . PHP_EOL . + 'TZNAME:GMT+1' . PHP_EOL . + 'TZOFFSETTO:+0100' . PHP_EOL . + 'END:STANDARD' . PHP_EOL . + 'END:VTIMEZONE' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20160809T163629Z' . PHP_EOL . + 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02' . PHP_EOL . + 'DTEND;TZID=Europe/Berlin:20160817T100000' . PHP_EOL . + 'TRANSP:OPAQUE' . PHP_EOL . + 'SUMMARY:Test Europe Berlin' . PHP_EOL . + 'DTSTART;TZID=Europe/Berlin:20160816T090000' . PHP_EOL . + 'DTSTAMP:20160809T163632Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // ALL-DAY ONE-DAY - private $vEvent3 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20161004T144433Z'.PHP_EOL. - 'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL. - 'DTEND;VALUE=DATE:20161006'.PHP_EOL. - 'TRANSP:TRANSPARENT'.PHP_EOL. - 'DTSTART;VALUE=DATE:20161005'.PHP_EOL. - 'DTSTAMP:20161004T144437Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent3 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20161004T144433Z' . PHP_EOL . + 'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL . + 'DTEND;VALUE=DATE:20161006' . PHP_EOL . + 'TRANSP:TRANSPARENT' . PHP_EOL . + 'DTSTART;VALUE=DATE:20161005' . PHP_EOL . + 'DTSTAMP:20161004T144437Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // ALL-DAY MULTIPLE DAYS - private $vEvent4 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20161004T144433Z'.PHP_EOL. - 'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL. - 'DTEND;VALUE=DATE:20161008'.PHP_EOL. - 'TRANSP:TRANSPARENT'.PHP_EOL. - 'DTSTART;VALUE=DATE:20161005'.PHP_EOL. - 'DTSTAMP:20161004T144437Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent4 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20161004T144433Z' . PHP_EOL . + 'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL . + 'DTEND;VALUE=DATE:20161008' . PHP_EOL . + 'TRANSP:TRANSPARENT' . PHP_EOL . + 'DTSTART;VALUE=DATE:20161005' . PHP_EOL . + 'DTSTAMP:20161004T144437Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // DURATION - private $vEvent5 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20161004T144433Z'.PHP_EOL. - 'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL. - 'DURATION:P5D'.PHP_EOL. - 'TRANSP:TRANSPARENT'.PHP_EOL. - 'DTSTART;VALUE=DATE:20161005'.PHP_EOL. - 'DTSTAMP:20161004T144437Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent5 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20161004T144433Z' . PHP_EOL . + 'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL . + 'DURATION:P5D' . PHP_EOL . + 'TRANSP:TRANSPARENT' . PHP_EOL . + 'DTSTART;VALUE=DATE:20161005' . PHP_EOL . + 'DTSTAMP:20161004T144437Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // NO DTEND - DATE - private $vEvent6 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20161004T144433Z'.PHP_EOL. - 'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL. - 'TRANSP:TRANSPARENT'.PHP_EOL. - 'DTSTART;VALUE=DATE:20161005'.PHP_EOL. - 'DTSTAMP:20161004T144437Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent6 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20161004T144433Z' . PHP_EOL . + 'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL . + 'TRANSP:TRANSPARENT' . PHP_EOL . + 'DTSTART;VALUE=DATE:20161005' . PHP_EOL . + 'DTSTAMP:20161004T144437Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // NO DTEND - DATE-TIME - private $vEvent7 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Tests//'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VTIMEZONE'.PHP_EOL. - 'TZID:Europe/Berlin'.PHP_EOL. - 'BEGIN:DAYLIGHT'.PHP_EOL. - 'TZOFFSETFROM:+0100'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19810329T020000'.PHP_EOL. - 'TZNAME:GMT+2'.PHP_EOL. - 'TZOFFSETTO:+0200'.PHP_EOL. - 'END:DAYLIGHT'.PHP_EOL. - 'BEGIN:STANDARD'.PHP_EOL. - 'TZOFFSETFROM:+0200'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19961027T030000'.PHP_EOL. - 'TZNAME:GMT+1'.PHP_EOL. - 'TZOFFSETTO:+0100'.PHP_EOL. - 'END:STANDARD'.PHP_EOL. - 'END:VTIMEZONE'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20160809T163629Z'.PHP_EOL. - 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02'.PHP_EOL. - 'TRANSP:OPAQUE'.PHP_EOL. - 'SUMMARY:Test Europe Berlin'.PHP_EOL. - 'DTSTART;TZID=Europe/Berlin:20160816T090000'.PHP_EOL. - 'DTSTAMP:20160809T163632Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent7 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Tests//' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VTIMEZONE' . PHP_EOL . + 'TZID:Europe/Berlin' . PHP_EOL . + 'BEGIN:DAYLIGHT' . PHP_EOL . + 'TZOFFSETFROM:+0100' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19810329T020000' . PHP_EOL . + 'TZNAME:GMT+2' . PHP_EOL . + 'TZOFFSETTO:+0200' . PHP_EOL . + 'END:DAYLIGHT' . PHP_EOL . + 'BEGIN:STANDARD' . PHP_EOL . + 'TZOFFSETFROM:+0200' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19961027T030000' . PHP_EOL . + 'TZNAME:GMT+1' . PHP_EOL . + 'TZOFFSETTO:+0100' . PHP_EOL . + 'END:STANDARD' . PHP_EOL . + 'END:VTIMEZONE' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20160809T163629Z' . PHP_EOL . + 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02' . PHP_EOL . + 'TRANSP:OPAQUE' . PHP_EOL . + 'SUMMARY:Test Europe Berlin' . PHP_EOL . + 'DTSTART;TZID=Europe/Berlin:20160816T090000' . PHP_EOL . + 'DTSTAMP:20160809T163632Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; protected function setUp(): void { diff --git a/apps/dav/tests/unit/Search/TasksSearchProviderTest.php b/apps/dav/tests/unit/Search/TasksSearchProviderTest.php index 18b6f0a5930..0b1bf1ba0d7 100644 --- a/apps/dav/tests/unit/Search/TasksSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/TasksSearchProviderTest.php @@ -38,67 +38,67 @@ class TasksSearchProviderTest extends TestCase { private $provider; // NO DUE NOR COMPLETED NOR SUMMARY - private $vTodo0 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'PRODID:TEST'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'BEGIN:VTODO'.PHP_EOL. - 'UID:20070313T123432Z-456553@example.com'.PHP_EOL. - 'DTSTAMP:20070313T123432Z'.PHP_EOL. - 'STATUS:NEEDS-ACTION'.PHP_EOL. - 'END:VTODO'.PHP_EOL. + private $vTodo0 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'PRODID:TEST' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'BEGIN:VTODO' . PHP_EOL . + 'UID:20070313T123432Z-456553@example.com' . PHP_EOL . + 'DTSTAMP:20070313T123432Z' . PHP_EOL . + 'STATUS:NEEDS-ACTION' . PHP_EOL . + 'END:VTODO' . PHP_EOL . 'END:VCALENDAR'; // DUE AND COMPLETED - private $vTodo1 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'PRODID:TEST'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'BEGIN:VTODO'.PHP_EOL. - 'UID:20070313T123432Z-456553@example.com'.PHP_EOL. - 'DTSTAMP:20070313T123432Z'.PHP_EOL. - 'COMPLETED:20070707T100000Z'.PHP_EOL. - 'DUE;VALUE=DATE:20070501'.PHP_EOL. - 'SUMMARY:Task title'.PHP_EOL. - 'STATUS:NEEDS-ACTION'.PHP_EOL. - 'END:VTODO'.PHP_EOL. + private $vTodo1 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'PRODID:TEST' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'BEGIN:VTODO' . PHP_EOL . + 'UID:20070313T123432Z-456553@example.com' . PHP_EOL . + 'DTSTAMP:20070313T123432Z' . PHP_EOL . + 'COMPLETED:20070707T100000Z' . PHP_EOL . + 'DUE;VALUE=DATE:20070501' . PHP_EOL . + 'SUMMARY:Task title' . PHP_EOL . + 'STATUS:NEEDS-ACTION' . PHP_EOL . + 'END:VTODO' . PHP_EOL . 'END:VCALENDAR'; // COMPLETED ONLY - private $vTodo2 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'PRODID:TEST'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'BEGIN:VTODO'.PHP_EOL. - 'UID:20070313T123432Z-456553@example.com'.PHP_EOL. - 'DTSTAMP:20070313T123432Z'.PHP_EOL. - 'COMPLETED:20070707T100000Z'.PHP_EOL. - 'SUMMARY:Task title'.PHP_EOL. - 'STATUS:NEEDS-ACTION'.PHP_EOL. - 'END:VTODO'.PHP_EOL. + private $vTodo2 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'PRODID:TEST' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'BEGIN:VTODO' . PHP_EOL . + 'UID:20070313T123432Z-456553@example.com' . PHP_EOL . + 'DTSTAMP:20070313T123432Z' . PHP_EOL . + 'COMPLETED:20070707T100000Z' . PHP_EOL . + 'SUMMARY:Task title' . PHP_EOL . + 'STATUS:NEEDS-ACTION' . PHP_EOL . + 'END:VTODO' . PHP_EOL . 'END:VCALENDAR'; // DUE DATE - private $vTodo3 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'PRODID:TEST'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'BEGIN:VTODO'.PHP_EOL. - 'UID:20070313T123432Z-456553@example.com'.PHP_EOL. - 'DTSTAMP:20070313T123432Z'.PHP_EOL. - 'DUE;VALUE=DATE:20070501'.PHP_EOL. - 'SUMMARY:Task title'.PHP_EOL. - 'STATUS:NEEDS-ACTION'.PHP_EOL. - 'END:VTODO'.PHP_EOL. + private $vTodo3 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'PRODID:TEST' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'BEGIN:VTODO' . PHP_EOL . + 'UID:20070313T123432Z-456553@example.com' . PHP_EOL . + 'DTSTAMP:20070313T123432Z' . PHP_EOL . + 'DUE;VALUE=DATE:20070501' . PHP_EOL . + 'SUMMARY:Task title' . PHP_EOL . + 'STATUS:NEEDS-ACTION' . PHP_EOL . + 'END:VTODO' . PHP_EOL . 'END:VCALENDAR'; // DUE DATETIME - private $vTodo4 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'PRODID:TEST'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'BEGIN:VTODO'.PHP_EOL. - 'UID:20070313T123432Z-456553@example.com'.PHP_EOL. - 'DTSTAMP:20070313T123432Z'.PHP_EOL. - 'DUE:20070709T130000Z'.PHP_EOL. - 'SUMMARY:Task title'.PHP_EOL. - 'STATUS:NEEDS-ACTION'.PHP_EOL. - 'END:VTODO'.PHP_EOL. + private $vTodo4 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'PRODID:TEST' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'BEGIN:VTODO' . PHP_EOL . + 'UID:20070313T123432Z-456553@example.com' . PHP_EOL . + 'DTSTAMP:20070313T123432Z' . PHP_EOL . + 'DUE:20070709T130000Z' . PHP_EOL . + 'SUMMARY:Task title' . PHP_EOL . + 'STATUS:NEEDS-ACTION' . PHP_EOL . + 'END:VTODO' . PHP_EOL . 'END:VCALENDAR'; protected function setUp(): void { diff --git a/apps/dav/tests/unit/bootstrap.php b/apps/dav/tests/unit/bootstrap.php index 61dbda35ae2..886a7f0b859 100644 --- a/apps/dav/tests/unit/bootstrap.php +++ b/apps/dav/tests/unit/bootstrap.php @@ -9,7 +9,7 @@ if (!defined('PHPUNIT_RUN')) { define('PHPUNIT_RUN', 1); } -require_once __DIR__.'/../../../../lib/base.php'; +require_once __DIR__ . '/../../../../lib/base.php'; \OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true); diff --git a/apps/encryption/lib/Command/DropLegacyFileKey.php b/apps/encryption/lib/Command/DropLegacyFileKey.php index 03c24fe8a22..a9add1ad93b 100644 --- a/apps/encryption/lib/Command/DropLegacyFileKey.php +++ b/apps/encryption/lib/Command/DropLegacyFileKey.php @@ -114,10 +114,10 @@ class DropLegacyFileKey extends Command { $copyResource = $this->rootView->fopen($target, 'r'); $sourceResource = $this->rootView->fopen($source, 'w'); if ($copyResource === false || $sourceResource === false) { - throw new DecryptionFailedException('Failed to open '.$source.' or '.$target); + throw new DecryptionFailedException('Failed to open ' . $source . ' or ' . $target); } if (stream_copy_to_stream($copyResource, $sourceResource) === false) { - $output->writeln('<error>Failed to copy '.$target.' data into '.$source.'</error>'); + $output->writeln('<error>Failed to copy ' . $target . ' data into ' . $source . '</error>'); $output->writeln('<error>Leaving both files in there to avoid data loss</error>'); return; } diff --git a/apps/encryption/lib/Controller/SettingsController.php b/apps/encryption/lib/Controller/SettingsController.php index 251f385127a..df896e52fa5 100644 --- a/apps/encryption/lib/Controller/SettingsController.php +++ b/apps/encryption/lib/Controller/SettingsController.php @@ -69,7 +69,7 @@ class SettingsController extends Controller { Crypt $crypt, Session $session, ISession $ocSession, - Util $util + Util $util, ) { parent::__construct($AppName, $request); $this->l = $l10n; diff --git a/apps/encryption/lib/Controller/StatusController.php b/apps/encryption/lib/Controller/StatusController.php index b5b54ee2f6d..5c6a950d0a3 100644 --- a/apps/encryption/lib/Controller/StatusController.php +++ b/apps/encryption/lib/Controller/StatusController.php @@ -37,7 +37,7 @@ class StatusController extends Controller { IRequest $request, IL10N $l10n, Session $session, - IManager $encryptionManager + IManager $encryptionManager, ) { parent::__construct($AppName, $request); $this->l = $l10n; diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php index 92d6ed6a443..b38734dd061 100644 --- a/apps/encryption/lib/Crypto/Crypt.php +++ b/apps/encryption/lib/Crypto/Crypt.php @@ -155,7 +155,7 @@ class Crypt { $this->getCipher()); // Create a signature based on the key as well as the current version - $sig = $this->createSignature($encryptedContent, $passPhrase.'_'.$version.'_'.$position); + $sig = $this->createSignature($encryptedContent, $passPhrase . '_' . $version . '_' . $position); // combine content to encrypt the IV identifier and actual IV $catFile = $this->concatIV($encryptedContent, $iv); @@ -760,7 +760,7 @@ class Crypt { $result = (strlen($output) === strlen($data)); } } else { - throw new DecryptionFailedException('Unsupported cipher '.$cipher_algo); + throw new DecryptionFailedException('Unsupported cipher ' . $cipher_algo); } return $result; @@ -807,7 +807,7 @@ class Crypt { } } } else { - throw new EncryptionFailedException('Unsupported cipher '.$cipher_algo); + throw new EncryptionFailedException('Unsupported cipher ' . $cipher_algo); } return $result; diff --git a/apps/encryption/lib/Crypto/DecryptAll.php b/apps/encryption/lib/Crypto/DecryptAll.php index 80c187571b7..e153712fb99 100644 --- a/apps/encryption/lib/Crypto/DecryptAll.php +++ b/apps/encryption/lib/Crypto/DecryptAll.php @@ -45,7 +45,7 @@ class DecryptAll { KeyManager $keyManager, Crypt $crypt, Session $session, - QuestionHelper $questionHelper + QuestionHelper $questionHelper, ) { $this->util = $util; $this->keyManager = $keyManager; diff --git a/apps/encryption/lib/Crypto/EncryptAll.php b/apps/encryption/lib/Crypto/EncryptAll.php index 310f37aba83..e9db5034baa 100644 --- a/apps/encryption/lib/Crypto/EncryptAll.php +++ b/apps/encryption/lib/Crypto/EncryptAll.php @@ -82,7 +82,7 @@ class EncryptAll { IL10N $l, IFactory $l10nFactory, QuestionHelper $questionHelper, - ISecureRandom $secureRandom + ISecureRandom $secureRandom, ) { $this->userSetup = $userSetup; $this->userManager = $userManager; diff --git a/apps/encryption/lib/KeyManager.php b/apps/encryption/lib/KeyManager.php index 9fd6c7655af..0c9c02760a8 100644 --- a/apps/encryption/lib/KeyManager.php +++ b/apps/encryption/lib/KeyManager.php @@ -211,7 +211,7 @@ class KeyManager { */ public function setRecoveryKey($password, $keyPair) { // Save Public Key - $this->keyStorage->setSystemUserKey($this->getRecoveryKeyId(). + $this->keyStorage->setSystemUserKey($this->getRecoveryKeyId() . '.' . $this->publicKeyId, $keyPair['publicKey'], Encryption::ID); diff --git a/apps/encryption/lib/Settings/Admin.php b/apps/encryption/lib/Settings/Admin.php index 4f695f61b1b..e8290b778ad 100644 --- a/apps/encryption/lib/Settings/Admin.php +++ b/apps/encryption/lib/Settings/Admin.php @@ -25,7 +25,7 @@ class Admin implements ISettings { private IUserSession $userSession, private IConfig $config, private IUserManager $userManager, - private ISession $session + private ISession $session, ) { } diff --git a/apps/encryption/tests/Command/FixEncryptedVersionTest.php b/apps/encryption/tests/Command/FixEncryptedVersionTest.php index fd6e27e030b..e5079b9a8af 100644 --- a/apps/encryption/tests/Command/FixEncryptedVersionTest.php +++ b/apps/encryption/tests/Command/FixEncryptedVersionTest.php @@ -251,7 +251,7 @@ Fixed the file: \"/$this->userId/files/world.txt\" with version 4", $output); $cacheInfo = ['encryptedVersion' => 1, 'encrypted' => 1]; $cache1->put($fileCache1->getPath(), $cacheInfo); - $absPath = $storage1->getSourcePath('').$fileInfo1->getInternalPath(); + $absPath = $storage1->getSourcePath('') . $fileInfo1->getInternalPath(); // create unencrypted file on disk, the version stays file_put_contents($absPath, 'hello contents'); diff --git a/apps/federatedfilesharing/lib/AddressHandler.php b/apps/federatedfilesharing/lib/AddressHandler.php index 320f65c2b42..d96c956eb11 100644 --- a/apps/federatedfilesharing/lib/AddressHandler.php +++ b/apps/federatedfilesharing/lib/AddressHandler.php @@ -38,7 +38,7 @@ class AddressHandler { public function __construct( IURLGenerator $urlGenerator, IL10N $il10n, - ICloudIdManager $cloudIdManager + ICloudIdManager $cloudIdManager, ) { $this->l = $il10n; $this->urlGenerator = $urlGenerator; diff --git a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php index 71661efa384..8d4f6fd3af8 100644 --- a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php +++ b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php @@ -84,7 +84,7 @@ class RequestHandlerController extends OCSController { LoggerInterface $logger, ICloudFederationFactory $cloudFederationFactory, ICloudFederationProviderManager $cloudFederationProviderManager, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { parent::__construct($appName, $request); diff --git a/apps/federatedfilesharing/lib/Settings/Admin.php b/apps/federatedfilesharing/lib/Settings/Admin.php index 90ee9a8c748..a7bdc545413 100644 --- a/apps/federatedfilesharing/lib/Settings/Admin.php +++ b/apps/federatedfilesharing/lib/Settings/Admin.php @@ -28,7 +28,7 @@ class Admin implements IDelegatedSettings { IConfig $globalScaleConfig, IL10N $l, IURLGenerator $urlGenerator, - IInitialState $initialState + IInitialState $initialState, ) { $this->fedShareProvider = $fedShareProvider; $this->gsConfig = $globalScaleConfig; diff --git a/apps/federatedfilesharing/lib/Settings/Personal.php b/apps/federatedfilesharing/lib/Settings/Personal.php index bee6cc538c6..93ca36ab420 100644 --- a/apps/federatedfilesharing/lib/Settings/Personal.php +++ b/apps/federatedfilesharing/lib/Settings/Personal.php @@ -28,7 +28,7 @@ class Personal implements ISettings { IUserSession $userSession, Defaults $defaults, IInitialState $initialState, - IURLGenerator $urlGenerator + IURLGenerator $urlGenerator, ) { $this->federatedShareProvider = $federatedShareProvider; $this->userSession = $userSession; diff --git a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php index 6eb7ce30274..9caafb35bb3 100644 --- a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php +++ b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php @@ -129,7 +129,7 @@ class MountPublicLinkControllerTest extends \Test\TestCase { $validToken, $createSuccessful, $expectedReturnData, - $permissions + $permissions, ): void { $this->federatedShareProvider->expects($this->any()) ->method('isOutgoingServer2serverShareEnabled') diff --git a/apps/federatedfilesharing/tests/NotificationsTest.php b/apps/federatedfilesharing/tests/NotificationsTest.php index 868591cb4dd..7ac4e964362 100644 --- a/apps/federatedfilesharing/tests/NotificationsTest.php +++ b/apps/federatedfilesharing/tests/NotificationsTest.php @@ -113,7 +113,7 @@ class NotificationsTest extends \Test\TestCase { $instance->expects($this->any())->method('getTimestamp')->willReturn($timestamp); $instance->expects($this->once())->method('tryHttpPostToShareEndpoint') - ->with($remote, '/'.$id.'/unshare', ['token' => $token, 'data1Key' => 'data1Value', 'remoteId' => $id], $action) + ->with($remote, '/' . $id . '/unshare', ['token' => $token, 'data1Key' => 'data1Value', 'remoteId' => $id], $action) ->willReturn($httpRequestResult); // only add background job on first try diff --git a/apps/federation/lib/BackgroundJob/GetSharedSecret.php b/apps/federation/lib/BackgroundJob/GetSharedSecret.php index 1a23d58a7d1..92196e68e01 100644 --- a/apps/federation/lib/BackgroundJob/GetSharedSecret.php +++ b/apps/federation/lib/BackgroundJob/GetSharedSecret.php @@ -47,7 +47,7 @@ class GetSharedSecret extends Job { TrustedServers $trustedServers, LoggerInterface $logger, IDiscoveryService $ocsDiscoveryService, - ITimeFactory $timeFactory + ITimeFactory $timeFactory, ) { parent::__construct($timeFactory); $this->logger = $logger; diff --git a/apps/federation/lib/Controller/OCSAuthAPIController.php b/apps/federation/lib/Controller/OCSAuthAPIController.php index 8412868da42..221a9321cd7 100644 --- a/apps/federation/lib/Controller/OCSAuthAPIController.php +++ b/apps/federation/lib/Controller/OCSAuthAPIController.php @@ -50,7 +50,7 @@ class OCSAuthAPIController extends OCSController { DbHandler $dbHandler, LoggerInterface $logger, ITimeFactory $timeFactory, - IThrottler $throttler + IThrottler $throttler, ) { parent::__construct($appName, $request); @@ -165,7 +165,7 @@ class OCSAuthAPIController extends OCSController { $this->throttler->registerAttempt('federationSharedSecret', $this->request->getRemoteAddress()); $expectedToken = $this->dbHandler->getToken($url); $this->logger->error( - 'remote server (' . $url . ') didn\'t send a valid token (got "' . $token . '" but expected "'. $expectedToken . '") while getting shared secret', + 'remote server (' . $url . ') didn\'t send a valid token (got "' . $token . '" but expected "' . $expectedToken . '") while getting shared secret', ['app' => 'federation'] ); throw new OCSForbiddenException(); diff --git a/apps/federation/lib/Controller/SettingsController.php b/apps/federation/lib/Controller/SettingsController.php index f5131581d94..18ebc516cb8 100644 --- a/apps/federation/lib/Controller/SettingsController.php +++ b/apps/federation/lib/Controller/SettingsController.php @@ -23,7 +23,7 @@ class SettingsController extends Controller { public function __construct(string $AppName, IRequest $request, IL10N $l10n, - TrustedServers $trustedServers + TrustedServers $trustedServers, ) { parent::__construct($AppName, $request); $this->l = $l10n; diff --git a/apps/federation/lib/DbHandler.php b/apps/federation/lib/DbHandler.php index 8a189dc56f7..4b7fc1a8da1 100644 --- a/apps/federation/lib/DbHandler.php +++ b/apps/federation/lib/DbHandler.php @@ -31,7 +31,7 @@ class DbHandler { public function __construct( IDBConnection $connection, - IL10N $il10n + IL10N $il10n, ) { $this->connection = $connection; $this->IL10N = $il10n; diff --git a/apps/federation/lib/SyncFederationAddressBooks.php b/apps/federation/lib/SyncFederationAddressBooks.php index aaed6ca9d94..8060a78ada7 100644 --- a/apps/federation/lib/SyncFederationAddressBooks.php +++ b/apps/federation/lib/SyncFederationAddressBooks.php @@ -22,7 +22,7 @@ class SyncFederationAddressBooks { public function __construct(DbHandler $dbHandler, SyncService $syncService, IDiscoveryService $ocsDiscoveryService, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->syncService = $syncService; $this->dbHandler = $dbHandler; diff --git a/apps/federation/lib/TrustedServers.php b/apps/federation/lib/TrustedServers.php index 48cffd2d274..e59f281df0b 100644 --- a/apps/federation/lib/TrustedServers.php +++ b/apps/federation/lib/TrustedServers.php @@ -51,7 +51,7 @@ class TrustedServers { ISecureRandom $secureRandom, IConfig $config, IEventDispatcher $dispatcher, - ITimeFactory $timeFactory + ITimeFactory $timeFactory, ) { $this->dbHandler = $dbHandler; $this->httpClientService = $httpClientService; diff --git a/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php b/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php index 81f3d229bc0..ce2de9a74bb 100644 --- a/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php +++ b/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php @@ -22,7 +22,7 @@ class DeleteExpiredOpenLocalEditor extends TimedJob { public function __construct( ITimeFactory $time, - OpenLocalEditorMapper $mapper + OpenLocalEditorMapper $mapper, ) { parent::__construct($time); $this->mapper = $mapper; diff --git a/apps/files/lib/BackgroundJob/ScanFiles.php b/apps/files/lib/BackgroundJob/ScanFiles.php index b7e6e8db10e..88b45033255 100644 --- a/apps/files/lib/BackgroundJob/ScanFiles.php +++ b/apps/files/lib/BackgroundJob/ScanFiles.php @@ -37,7 +37,7 @@ class ScanFiles extends TimedJob { IEventDispatcher $dispatcher, LoggerInterface $logger, IDBConnection $connection, - ITimeFactory $time + ITimeFactory $time, ) { parent::__construct($time); // Run once per 10 minutes diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php index 5360d38bdb6..22de2f6d19f 100644 --- a/apps/files/lib/Command/ScanAppData.php +++ b/apps/files/lib/Command/ScanAppData.php @@ -238,6 +238,6 @@ class ScanAppData extends Base { throw new NotFoundException(); } - return $this->rootFolder->get('appdata_'.$instanceId); + return $this->rootFolder->get('appdata_' . $instanceId); } } diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index 62ae4e6b0f0..0ca4a1efd4b 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -47,7 +47,8 @@ use Throwable; * @package OCA\Files\Controller */ class ApiController extends Controller { - public function __construct(string $appName, + public function __construct( + string $appName, IRequest $request, private IUserSession $userSession, private TagService $tagService, diff --git a/apps/files/lib/Controller/DirectEditingController.php b/apps/files/lib/Controller/DirectEditingController.php index 693587f9c8a..63f29d3ba2a 100644 --- a/apps/files/lib/Controller/DirectEditingController.php +++ b/apps/files/lib/Controller/DirectEditingController.php @@ -29,7 +29,7 @@ class DirectEditingController extends OCSController { private IURLGenerator $urlGenerator, private IManager $directEditingManager, private DirectEditingService $directEditingService, - private LoggerInterface $logger + private LoggerInterface $logger, ) { parent::__construct($appName, $request, $corsMethods, $corsAllowedHeaders, $corsMaxAge); } diff --git a/apps/files/lib/Controller/OpenLocalEditorController.php b/apps/files/lib/Controller/OpenLocalEditorController.php index 0c13af2a6d2..1982569e7d2 100644 --- a/apps/files/lib/Controller/OpenLocalEditorController.php +++ b/apps/files/lib/Controller/OpenLocalEditorController.php @@ -42,7 +42,7 @@ class OpenLocalEditorController extends OCSController { OpenLocalEditorMapper $mapper, ISecureRandom $secureRandom, LoggerInterface $logger, - ?string $userId + ?string $userId, ) { parent::__construct($appName, $request); diff --git a/apps/files/lib/Controller/TemplateController.php b/apps/files/lib/Controller/TemplateController.php index d4232763235..f3272d70d68 100644 --- a/apps/files/lib/Controller/TemplateController.php +++ b/apps/files/lib/Controller/TemplateController.php @@ -62,7 +62,7 @@ class TemplateController extends OCSController { string $filePath, string $templatePath = '', string $templateType = 'user', - array $templateFields = [] + array $templateFields = [], ): DataResponse { try { return new DataResponse($this->templateManager->createFromTemplate( diff --git a/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php b/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php index 1ae80735972..5fd233d232e 100644 --- a/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php +++ b/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php @@ -27,7 +27,7 @@ class CredentialsCleanup extends TimedJob { ITimeFactory $time, ICredentialsManager $credentialsManager, UserGlobalStoragesService $userGlobalStoragesService, - IUserManager $userManager + IUserManager $userManager, ) { parent::__construct($time); diff --git a/apps/files_external/lib/Command/Scan.php b/apps/files_external/lib/Command/Scan.php index 575ee5989f5..374566ce211 100644 --- a/apps/files_external/lib/Command/Scan.php +++ b/apps/files_external/lib/Command/Scan.php @@ -24,7 +24,7 @@ class Scan extends StorageAuthBase { public function __construct( GlobalStoragesService $globalService, - IUserManager $userManager + IUserManager $userManager, ) { parent::__construct($globalService, $userManager); } diff --git a/apps/files_external/lib/Controller/ApiController.php b/apps/files_external/lib/Controller/ApiController.php index 10fd120c3d9..d326e1f7f44 100644 --- a/apps/files_external/lib/Controller/ApiController.php +++ b/apps/files_external/lib/Controller/ApiController.php @@ -31,7 +31,7 @@ class ApiController extends OCSController { string $appName, IRequest $request, UserGlobalStoragesService $userGlobalStorageService, - UserStoragesService $userStorageService + UserStoragesService $userStorageService, ) { parent::__construct($appName, $request); $this->userGlobalStoragesService = $userGlobalStorageService; diff --git a/apps/files_external/lib/Controller/GlobalStoragesController.php b/apps/files_external/lib/Controller/GlobalStoragesController.php index d773f3ea5e2..05cfd4684d8 100644 --- a/apps/files_external/lib/Controller/GlobalStoragesController.php +++ b/apps/files_external/lib/Controller/GlobalStoragesController.php @@ -41,7 +41,7 @@ class GlobalStoragesController extends StoragesController { LoggerInterface $logger, IUserSession $userSession, IGroupManager $groupManager, - IConfig $config + IConfig $config, ) { parent::__construct( $AppName, @@ -77,7 +77,7 @@ class GlobalStoragesController extends StoragesController { $mountOptions, $applicableUsers, $applicableGroups, - $priority + $priority, ) { $canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', true); if (!$canCreateNewLocalStorage && $backend === 'local') { @@ -144,7 +144,7 @@ class GlobalStoragesController extends StoragesController { $applicableUsers, $applicableGroups, $priority, - $testOnly = true + $testOnly = true, ) { $storage = $this->createStorage( $mountPoint, diff --git a/apps/files_external/lib/Controller/StoragesController.php b/apps/files_external/lib/Controller/StoragesController.php index ab580987b0e..fcd3863e658 100644 --- a/apps/files_external/lib/Controller/StoragesController.php +++ b/apps/files_external/lib/Controller/StoragesController.php @@ -44,7 +44,7 @@ abstract class StoragesController extends Controller { protected LoggerInterface $logger, protected IUserSession $userSession, protected IGroupManager $groupManager, - protected IConfig $config + protected IConfig $config, ) { parent::__construct($AppName, $request); } @@ -71,7 +71,7 @@ abstract class StoragesController extends Controller { $mountOptions = null, $applicableUsers = null, $applicableGroups = null, - $priority = null + $priority = null, ) { $canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', true); if (!$canCreateNewLocalStorage && $backend === 'local') { diff --git a/apps/files_external/lib/Controller/UserGlobalStoragesController.php b/apps/files_external/lib/Controller/UserGlobalStoragesController.php index 3d364fff57d..60159e1bc54 100644 --- a/apps/files_external/lib/Controller/UserGlobalStoragesController.php +++ b/apps/files_external/lib/Controller/UserGlobalStoragesController.php @@ -47,7 +47,7 @@ class UserGlobalStoragesController extends StoragesController { LoggerInterface $logger, IUserSession $userSession, IGroupManager $groupManager, - IConfig $config + IConfig $config, ) { parent::__construct( $AppName, @@ -139,7 +139,7 @@ class UserGlobalStoragesController extends StoragesController { public function update( $id, $backendOptions, - $testOnly = true + $testOnly = true, ) { try { $storage = $this->service->getStorage($id); diff --git a/apps/files_external/lib/Controller/UserStoragesController.php b/apps/files_external/lib/Controller/UserStoragesController.php index a85aa3faa96..ac806fe219c 100644 --- a/apps/files_external/lib/Controller/UserStoragesController.php +++ b/apps/files_external/lib/Controller/UserStoragesController.php @@ -44,7 +44,7 @@ class UserStoragesController extends StoragesController { LoggerInterface $logger, IUserSession $userSession, IGroupManager $groupManager, - IConfig $config + IConfig $config, ) { parent::__construct( $AppName, @@ -104,7 +104,7 @@ class UserStoragesController extends StoragesController { $backend, $authMechanism, $backendOptions, - $mountOptions + $mountOptions, ) { $canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', true); if (!$canCreateNewLocalStorage && $backend === 'local') { @@ -161,7 +161,7 @@ class UserStoragesController extends StoragesController { $authMechanism, $backendOptions, $mountOptions, - $testOnly = true + $testOnly = true, ) { $storage = $this->createStorage( $mountPoint, diff --git a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php index ea42b0275f7..5c36f843307 100644 --- a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php +++ b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php @@ -46,7 +46,7 @@ class LoginCredentials extends AuthMechanism { ICredentialsManager $credentialsManager, CredentialsStore $credentialsStore, IEventDispatcher $eventDispatcher, - ILDAPProviderFactory $ldapFactory + ILDAPProviderFactory $ldapFactory, ) { $this->session = $session; $this->credentialsManager = $credentialsManager; diff --git a/apps/files_external/lib/Lib/PersonalMount.php b/apps/files_external/lib/Lib/PersonalMount.php index 64e8fdcea69..610807bc7a2 100644 --- a/apps/files_external/lib/Lib/PersonalMount.php +++ b/apps/files_external/lib/Lib/PersonalMount.php @@ -39,7 +39,7 @@ class PersonalMount extends ExternalMountPoint implements MoveableMount { $arguments = null, $loader = null, $mountOptions = null, - $mountId = null + $mountId = null, ) { parent::__construct($storageConfig, $storage, $mountpoint, $arguments, $loader, $mountOptions, $mountId); $this->storagesService = $storagesService; diff --git a/apps/files_external/lib/MountConfig.php b/apps/files_external/lib/MountConfig.php index b057fb810bd..1cbd6e14ebe 100644 --- a/apps/files_external/lib/MountConfig.php +++ b/apps/files_external/lib/MountConfig.php @@ -41,7 +41,7 @@ class MountConfig { public function __construct( UserGlobalStoragesService $userGlobalStorageService, UserStoragesService $userStorageService, - GlobalStoragesService $globalStorageService + GlobalStoragesService $globalStorageService, ) { $this->userGlobalStorageService = $userGlobalStorageService; $this->userStorageService = $userStorageService; diff --git a/apps/files_external/lib/Service/BackendService.php b/apps/files_external/lib/Service/BackendService.php index 5eb0276be65..a72179a3373 100644 --- a/apps/files_external/lib/Service/BackendService.php +++ b/apps/files_external/lib/Service/BackendService.php @@ -62,7 +62,7 @@ class BackendService { * @param IConfig $config */ public function __construct( - IConfig $config + IConfig $config, ) { $this->config = $config; diff --git a/apps/files_external/lib/Service/LegacyStoragesService.php b/apps/files_external/lib/Service/LegacyStoragesService.php index ac9273f2afc..1f5cf8cdf28 100644 --- a/apps/files_external/lib/Service/LegacyStoragesService.php +++ b/apps/files_external/lib/Service/LegacyStoragesService.php @@ -37,7 +37,7 @@ abstract class LegacyStoragesService { &$storageConfig, $mountType, $applicable, - $storageOptions + $storageOptions, ) { $backend = $this->backendService->getBackend($storageOptions['backend']); if (!$backend) { diff --git a/apps/files_external/lib/Service/StoragesService.php b/apps/files_external/lib/Service/StoragesService.php index 09f7ea954b4..40bf5bfe1a8 100644 --- a/apps/files_external/lib/Service/StoragesService.php +++ b/apps/files_external/lib/Service/StoragesService.php @@ -50,7 +50,7 @@ abstract class StoragesService { BackendService $backendService, DBConfigService $dbConfigService, IUserMountCache $userMountCache, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { $this->backendService = $backendService; $this->dbConfig = $dbConfigService; @@ -282,7 +282,7 @@ abstract class StoragesService { $mountOptions = null, $applicableUsers = null, $applicableGroups = null, - $priority = null + $priority = null, ) { $backend = $this->backendService->getBackend($backendIdentifier); if (!$backend) { diff --git a/apps/files_external/lib/Service/UserGlobalStoragesService.php b/apps/files_external/lib/Service/UserGlobalStoragesService.php index 58590b8d682..6fc37ea99b3 100644 --- a/apps/files_external/lib/Service/UserGlobalStoragesService.php +++ b/apps/files_external/lib/Service/UserGlobalStoragesService.php @@ -37,7 +37,7 @@ class UserGlobalStoragesService extends GlobalStoragesService { IUserSession $userSession, IGroupManager $groupManager, IUserMountCache $userMountCache, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { parent::__construct($backendService, $dbConfig, $userMountCache, $eventDispatcher); $this->userSession = $userSession; diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php index ba678156368..b461451389b 100644 --- a/apps/files_external/lib/Service/UserStoragesService.php +++ b/apps/files_external/lib/Service/UserStoragesService.php @@ -34,7 +34,7 @@ class UserStoragesService extends StoragesService { DBConfigService $dbConfig, IUserSession $userSession, IUserMountCache $userMountCache, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { $this->userSession = $userSession; parent::__construct($backendService, $dbConfig, $userMountCache, $eventDispatcher); diff --git a/apps/files_external/lib/Settings/Admin.php b/apps/files_external/lib/Settings/Admin.php index 63a420e749e..707f7704702 100644 --- a/apps/files_external/lib/Settings/Admin.php +++ b/apps/files_external/lib/Settings/Admin.php @@ -30,7 +30,7 @@ class Admin implements ISettings { IManager $encryptionManager, GlobalStoragesService $globalStoragesService, BackendService $backendService, - GlobalAuth $globalAuth + GlobalAuth $globalAuth, ) { $this->encryptionManager = $encryptionManager; $this->globalStoragesService = $globalStoragesService; diff --git a/apps/files_external/lib/Settings/Personal.php b/apps/files_external/lib/Settings/Personal.php index ecd56e632a9..f84051626a2 100644 --- a/apps/files_external/lib/Settings/Personal.php +++ b/apps/files_external/lib/Settings/Personal.php @@ -35,7 +35,7 @@ class Personal implements ISettings { UserGlobalStoragesService $userGlobalStoragesService, BackendService $backendService, GlobalAuth $globalAuth, - IUserSession $userSession + IUserSession $userSession, ) { $this->encryptionManager = $encryptionManager; $this->userGlobalStoragesService = $userGlobalStoragesService; diff --git a/apps/files_external/lib/Settings/PersonalSection.php b/apps/files_external/lib/Settings/PersonalSection.php index 41db1fcd906..f72ef95ad7f 100644 --- a/apps/files_external/lib/Settings/PersonalSection.php +++ b/apps/files_external/lib/Settings/PersonalSection.php @@ -26,7 +26,7 @@ class PersonalSection extends Section { IL10N $l, IUserSession $userSession, UserGlobalStoragesService $userGlobalStoragesService, - BackendService $backendService + BackendService $backendService, ) { parent::__construct($url, $l); $this->userSession = $userSession; diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index c4d14ecb2b4..0ebb5800d29 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -116,7 +116,7 @@ function writeParameterInput($parameter, $options, $classes = []) { <a target="_blank" rel="noreferrer" class="icon-info" title="<?php p($l->t('Open documentation'));?>" href="<?php p(link_to_docs('admin-external-storage')); ?>"></a> <p class="settings-hint"><?php p($l->t('External storage enables you to mount external storage services and devices as secondary Nextcloud storage devices. You may also allow people to mount their own external storage services.')); ?></p> <?php if (isset($_['dependencies']) and ($_['dependencies'] !== '') and $canCreateMounts) { - print_unescaped(''.$_['dependencies'].''); + print_unescaped('' . $_['dependencies'] . ''); } ?> <table id="externalStorage" class="grid" data-admin='<?php print_unescaped(json_encode($_['visibilityType'] === BackendService::VISIBILITY_ADMIN)); ?>'> <thead> @@ -127,7 +127,7 @@ function writeParameterInput($parameter, $options, $classes = []) { <th><?php p($l->t('Authentication')); ?></th> <th><?php p($l->t('Configuration')); ?></th> <?php if ($_['visibilityType'] === BackendService::VISIBILITY_ADMIN) { - print_unescaped('<th>'.$l->t('Available for').'</th>'); + print_unescaped('<th>' . $l->t('Available for') . '</th>'); } ?> <th> </th> <th> </th> diff --git a/apps/files_external/tests/Controller/StoragesControllerTest.php b/apps/files_external/tests/Controller/StoragesControllerTest.php index 9e9595152ad..94512c56cad 100644 --- a/apps/files_external/tests/Controller/StoragesControllerTest.php +++ b/apps/files_external/tests/Controller/StoragesControllerTest.php @@ -47,7 +47,7 @@ abstract class StoragesControllerTest extends \Test\TestCase { $backend->method('getStorageClass') ->willReturn($storageClass); $backend->method('getIdentifier') - ->willReturn('identifier:'.$class); + ->willReturn('identifier:' . $class); $backend->method('getParameters') ->willReturn([]); return $backend; @@ -63,7 +63,7 @@ abstract class StoragesControllerTest extends \Test\TestCase { $authMech->method('getScheme') ->willReturn($scheme); $authMech->method('getIdentifier') - ->willReturn('identifier:'.$class); + ->willReturn('identifier:' . $class); $authMech->method('getParameters') ->willReturn([]); diff --git a/apps/files_external/tests/Service/BackendServiceTest.php b/apps/files_external/tests/Service/BackendServiceTest.php index 6d9754a5335..74a4b223a96 100644 --- a/apps/files_external/tests/Service/BackendServiceTest.php +++ b/apps/files_external/tests/Service/BackendServiceTest.php @@ -32,8 +32,8 @@ class BackendServiceTest extends \Test\TestCase { $backend = $this->getMockBuilder(Backend::class) ->disableOriginalConstructor() ->getMock(); - $backend->method('getIdentifier')->willReturn('identifier:'.$class); - $backend->method('getIdentifierAliases')->willReturn(['identifier:'.$class]); + $backend->method('getIdentifier')->willReturn('identifier:' . $class); + $backend->method('getIdentifierAliases')->willReturn(['identifier:' . $class]); return $backend; } @@ -46,8 +46,8 @@ class BackendServiceTest extends \Test\TestCase { $backend = $this->getMockBuilder(AuthMechanism::class) ->disableOriginalConstructor() ->getMock(); - $backend->method('getIdentifier')->willReturn('identifier:'.$class); - $backend->method('getIdentifierAliases')->willReturn(['identifier:'.$class]); + $backend->method('getIdentifier')->willReturn('identifier:' . $class); + $backend->method('getIdentifierAliases')->willReturn(['identifier:' . $class]); return $backend; } diff --git a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php index 992960a6ea1..ff8d5f4e494 100644 --- a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php +++ b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php @@ -243,7 +243,7 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { public function testGetUniqueStorages( $priority1, $applicableUsers1, $applicableGroups1, $priority2, $applicableUsers2, $applicableGroups2, - $expectedPrecedence + $expectedPrecedence, ): void { $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); $backend->method('isVisibleFor') diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php index 26a9bc7b524..94427f7a979 100644 --- a/apps/files_sharing/lib/Cache.php +++ b/apps/files_sharing/lib/Cache.php @@ -43,7 +43,7 @@ class Cache extends CacheJail { $storage, ICacheEntry $sourceRootInfo, CacheDependencies $dependencies, - IShare $share + IShare $share, ) { $this->storage = $storage; $this->sourceRootInfo = $sourceRootInfo; diff --git a/apps/files_sharing/lib/Controller/PublicPreviewController.php b/apps/files_sharing/lib/Controller/PublicPreviewController.php index 4dc3989f866..a2e244c7ba0 100644 --- a/apps/files_sharing/lib/Controller/PublicPreviewController.php +++ b/apps/files_sharing/lib/Controller/PublicPreviewController.php @@ -83,7 +83,7 @@ class PublicPreviewController extends PublicShareController { string $file = '', int $x = 32, int $y = 32, - $a = false + $a = false, ) { if ($token === '' || $x === 0 || $y === 0) { return new DataResponse([], Http::STATUS_BAD_REQUEST); diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 9ca9774013c..cf835874677 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -88,7 +88,7 @@ class ShareAPIController extends OCSController { private LoggerInterface $logger, private IProviderFactory $factory, private IMailer $mailer, - ?string $userId = null + ?string $userId = null, ) { parent::__construct($appName, $request); $this->currentUser = $userId; @@ -565,7 +565,7 @@ class ShareAPIController extends OCSController { string $note = '', string $label = '', ?string $attributes = null, - ?string $sendMail = null + ?string $sendMail = null, ): DataResponse { $share = $this->shareManager->newShare(); @@ -930,7 +930,7 @@ class ShareAPIController extends OCSController { string $reshares = 'false', string $subfiles = 'false', string $path = '', - string $include_tags = 'false' + string $include_tags = 'false', ): DataResponse { $node = null; if ($path !== '') { @@ -978,7 +978,7 @@ class ShareAPIController extends OCSController { bool $sharedWithMe = false, bool $reShares = false, bool $subFiles = false, - bool $includeTags = false + bool $includeTags = false, ): array { if ($sharedWithMe) { return $this->getSharedWithMe($node, $includeTags); diff --git a/apps/files_sharing/lib/DeleteOrphanedSharesJob.php b/apps/files_sharing/lib/DeleteOrphanedSharesJob.php index 2315ff5c120..4ab95c2587b 100644 --- a/apps/files_sharing/lib/DeleteOrphanedSharesJob.php +++ b/apps/files_sharing/lib/DeleteOrphanedSharesJob.php @@ -38,7 +38,7 @@ class DeleteOrphanedSharesJob extends TimedJob { public function __construct( ITimeFactory $time, IDBConnection $db, - LoggerInterface $logger + LoggerInterface $logger, ) { parent::__construct($time); diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index a3226e9f3dd..86c9ae830e4 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -84,7 +84,7 @@ class Manager { IUserManager $userManager, IUserSession $userSession, IEventDispatcher $eventDispatcher, - LoggerInterface $logger + LoggerInterface $logger, ) { $user = $userSession->getUser(); $this->connection = $connection; diff --git a/apps/files_sharing/lib/Helper.php b/apps/files_sharing/lib/Helper.php index f2f92679e2f..3f1937396a0 100644 --- a/apps/files_sharing/lib/Helper.php +++ b/apps/files_sharing/lib/Helper.php @@ -28,12 +28,12 @@ class Helper { */ public static function generateUniqueTarget($path, $excludeList, $view) { $pathinfo = pathinfo($path); - $ext = isset($pathinfo['extension']) ? '.'.$pathinfo['extension'] : ''; + $ext = isset($pathinfo['extension']) ? '.' . $pathinfo['extension'] : ''; $name = $pathinfo['filename']; $dir = $pathinfo['dirname']; $i = 2; while ($view->file_exists($path) || in_array($path, $excludeList)) { - $path = Filesystem::normalizePath($dir . '/' . $name . ' ('.$i.')' . $ext); + $path = Filesystem::normalizePath($dir . '/' . $name . ' (' . $i . ')' . $ext); $i++; } diff --git a/apps/files_sharing/lib/Listener/LoadSidebarListener.php b/apps/files_sharing/lib/Listener/LoadSidebarListener.php index 7fd10b38779..b00e937d675 100644 --- a/apps/files_sharing/lib/Listener/LoadSidebarListener.php +++ b/apps/files_sharing/lib/Listener/LoadSidebarListener.php @@ -22,7 +22,10 @@ use OCP\Util; */ class LoadSidebarListener implements IEventListener { - public function __construct(private IInitialState $initialState, private IManager $shareManager) { + public function __construct( + private IInitialState $initialState, + private IManager $shareManager, + ) { } public function handle(Event $event): void { diff --git a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php index e13c3354f27..009692c5667 100644 --- a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php +++ b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php @@ -47,7 +47,7 @@ class SharingCheckMiddleware extends Middleware { IAppManager $appManager, IControllerMethodReflector $reflector, IManager $shareManager, - IRequest $request + IRequest $request, ) { $this->appName = $appName; $this->config = $config; diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php index 64847bf5a5f..5313f40ff6b 100644 --- a/apps/files_sharing/lib/MountProvider.php +++ b/apps/files_sharing/lib/MountProvider.php @@ -30,7 +30,7 @@ class MountProvider implements IMountProvider { protected IManager $shareManager, protected LoggerInterface $logger, protected IEventDispatcher $eventDispatcher, - protected ICacheFactory $cacheFactory + protected ICacheFactory $cacheFactory, ) { } diff --git a/apps/files_sharing/lib/Notification/Listener.php b/apps/files_sharing/lib/Notification/Listener.php index aaac32897d7..e925ca75fb8 100644 --- a/apps/files_sharing/lib/Notification/Listener.php +++ b/apps/files_sharing/lib/Notification/Listener.php @@ -30,7 +30,7 @@ class Listener { public function __construct( INotificationManager $notificationManager, IShareManager $shareManager, - IGroupManager $groupManager + IGroupManager $groupManager, ) { $this->notificationManager = $notificationManager; $this->shareManager = $shareManager; diff --git a/apps/files_sharing/lib/OrphanHelper.php b/apps/files_sharing/lib/OrphanHelper.php index 94fe4f08318..c5ad93a354f 100644 --- a/apps/files_sharing/lib/OrphanHelper.php +++ b/apps/files_sharing/lib/OrphanHelper.php @@ -19,7 +19,7 @@ class OrphanHelper { public function __construct( IDBConnection $connection, - IRootFolder $rootFolder + IRootFolder $rootFolder, ) { $this->connection = $connection; $this->rootFolder = $rootFolder; diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php index 6c7178132ad..ddd6af3845d 100644 --- a/apps/files_sharing/lib/SharedMount.php +++ b/apps/files_sharing/lib/SharedMount.php @@ -55,7 +55,7 @@ class SharedMount extends MountPoint implements MoveableMount, ISharedMountPoint CappedMemoryCache $folderExistCache, IEventDispatcher $eventDispatcher, IUser $user, - ICache $cache + ICache $cache, ) { $this->user = $user; $this->recipientView = $recipientView; @@ -81,7 +81,7 @@ class SharedMount extends MountPoint implements MoveableMount, ISharedMountPoint private function verifyMountPoint( \OCP\Share\IShare $share, array $mountpoints, - CappedMemoryCache $folderExistCache + CappedMemoryCache $folderExistCache, ) { $cacheKey = $this->user->getUID() . '/' . $share->getId() . '/' . $share->getTarget(); $cached = $this->cache->get($cacheKey); diff --git a/apps/files_sharing/lib/SharesReminderJob.php b/apps/files_sharing/lib/SharesReminderJob.php index 5e15d2851f4..af279bbc146 100644 --- a/apps/files_sharing/lib/SharesReminderJob.php +++ b/apps/files_sharing/lib/SharesReminderJob.php @@ -84,7 +84,7 @@ class SharesReminderJob extends TimedJob { } else { $sharesResult = $this->getSharesData(); } - foreach($sharesResult as $share) { + foreach ($sharesResult as $share) { if ($share['share_type'] === IShare::TYPE_EMAIL) { $id = "ocMailShare:$share[id]"; } else { @@ -216,7 +216,7 @@ class SharesReminderJob extends TimedJob { * @param IShare $share Share that was obtained with {@link getShares} * @return array|null Info needed to send a reminder */ - private function prepareReminder(IShare $share): array|null { + private function prepareReminder(IShare $share): ?array { $sharedWith = $share->getSharedWith(); $reminderInfo = []; if ($share->getShareType() == IShare::TYPE_USER) { diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index fe0739cfcde..4d50fb4065e 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -63,7 +63,7 @@ class ApiTest extends TestCase { $this->view->mkdir($this->folder); $this->view->mkdir($this->folder . $this->subfolder); $this->view->mkdir($this->folder . $this->subfolder . $this->subsubfolder); - $this->view->file_put_contents($this->folder.$this->filename, $this->data); + $this->view->file_put_contents($this->folder . $this->filename, $this->data); $this->view->file_put_contents($this->folder . $this->subfolder . $this->filename, $this->data); $mount = $this->view->getMount($this->filename); $mount->getStorage()->getScanner()->scan('', Scanner::SCAN_RECURSIVE); @@ -135,7 +135,7 @@ class ApiTest extends TestCase { $this->assertEquals(19, $data['permissions']); $this->assertEmpty($data['expiration']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -152,7 +152,7 @@ class ApiTest extends TestCase { $this->assertEquals(31, $data['permissions']); $this->assertEmpty($data['expiration']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -169,7 +169,7 @@ class ApiTest extends TestCase { $this->assertEquals(19, $data['permissions']); $this->assertEmpty($data['expiration']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -185,7 +185,7 @@ class ApiTest extends TestCase { $this->assertEquals(31, $data['permissions']); $this->assertEmpty($data['expiration']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -210,7 +210,7 @@ class ApiTest extends TestCase { $url = \OC::$server->getURLGenerator()->getAbsoluteURL('/index.php/s/' . $data['token']); $this->assertEquals($url, $data['url']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -241,7 +241,7 @@ class ApiTest extends TestCase { $url = \OC::$server->getURLGenerator()->getAbsoluteURL('/index.php/s/' . $data['token']); $this->assertEquals($url, $data['url']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -313,7 +313,7 @@ class ApiTest extends TestCase { $data = $result->getData(); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -571,7 +571,7 @@ class ApiTest extends TestCase { ->setPermissions(19); $share1 = $this->shareManager->createShare($share1); - $node2 = $this->userFolder->get($this->folder.'/'.$this->filename); + $node2 = $this->userFolder->get($this->folder . '/' . $this->filename); $share2 = $this->shareManager->newShare(); $share2->setNode($node2) ->setSharedBy(self::TEST_FILES_SHARING_API_USER1) @@ -629,7 +629,7 @@ class ApiTest extends TestCase { $share1->setStatus(IShare::STATUS_ACCEPTED); $this->shareManager->updateShare($share1); - $node2 = $this->userFolder->get($this->folder.'/'.$this->filename); + $node2 = $this->userFolder->get($this->folder . '/' . $this->filename); $share2 = $this->shareManager->newShare(); $share2->setNode($node2) ->setSharedBy(self::TEST_FILES_SHARING_API_USER2) @@ -639,7 +639,7 @@ class ApiTest extends TestCase { $share2->setStatus(IShare::STATUS_ACCEPTED); $this->shareManager->updateShare($share2); - $node3 = $this->userFolder->get($this->folder.'/'.$this->subfolder.'/'.$this->filename); + $node3 = $this->userFolder->get($this->folder . '/' . $this->subfolder . '/' . $this->filename); $share3 = $this->shareManager->newShare(); $share3->setNode($node3) ->setSharedBy(self::TEST_FILES_SHARING_API_USER2) @@ -850,7 +850,7 @@ class ApiTest extends TestCase { $s2 = reset($data2); $this->assertEquals($this->subfolder, $s1['path']); - $this->assertEquals($this->folder.$this->subfolder, $s2['path']); + $this->assertEquals($this->folder . $this->subfolder, $s2['path']); $this->shareManager->deleteShare($share1); $this->shareManager->deleteShare($share2); @@ -1141,7 +1141,7 @@ class ApiTest extends TestCase { $this->shareManager->updateShare($share1); $user2folder = \OC::$server->getUserFolder(self::TEST_FILES_SHARING_API_USER2); - $node2 = $user2folder->get($this->folder.'/'.$this->filename); + $node2 = $user2folder->get($this->folder . '/' . $this->filename); $share2 = $this->shareManager->newShare(); $share2->setNode($node2) ->setSharedBy(self::TEST_FILES_SHARING_API_USER2) @@ -1184,7 +1184,7 @@ class ApiTest extends TestCase { $view->mkdir('localDir'); // move mount point to the folder "localDir" - $result = $view->rename($this->folder, 'localDir/'.$this->folder); + $result = $view->rename($this->folder, 'localDir/' . $this->folder); $this->assertTrue($result !== false); // try to share "localDir" @@ -1308,7 +1308,7 @@ class ApiTest extends TestCase { $url = \OC::$server->getURLGenerator()->getAbsoluteURL('/index.php/s/' . $data['token']); $this->assertEquals($url, $data['url']); - $share = $this->shareManager->getShareById('ocinternal:'.$data['id']); + $share = $this->shareManager->getShareById('ocinternal:' . $data['id']); $this->assertEquals($date, $share->getExpirationDate()->format('Y-m-d H:i:s')); @@ -1340,7 +1340,7 @@ class ApiTest extends TestCase { $url = \OC::$server->getURLGenerator()->getAbsoluteURL('/index.php/s/' . $data['token']); $this->assertEquals($url, $data['url']); - $share = $this->shareManager->getShareById('ocinternal:'.$data['id']); + $share = $this->shareManager->getShareById('ocinternal:' . $data['id']); $date->setTime(0, 0, 0); $this->assertEquals($date, $share->getExpirationDate()); diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php index 4db3adf34a6..ebcfc43edad 100644 --- a/apps/files_sharing/tests/CacheTest.php +++ b/apps/files_sharing/tests/CacheTest.php @@ -50,7 +50,7 @@ class CacheTest extends TestCase { self::loginHelper(self::TEST_FILES_SHARING_API_USER1); - $this->user2View = new \OC\Files\View('/'. self::TEST_FILES_SHARING_API_USER2 . '/files'); + $this->user2View = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2 . '/files'); // prepare user1's dir structure $this->view->mkdir('container'); diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index 67aa15d82fa..f741bb64c81 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -512,7 +512,7 @@ class ShareAPIControllerTest extends TestCase { if ($shareType === IShare::TYPE_USER || $shareType === IShare::TYPE_GROUP || $shareType === IShare::TYPE_LINK) { - $share->method('getFullId')->willReturn('ocinternal:'.$id); + $share->method('getFullId')->willReturn('ocinternal:' . $id); } return $share; diff --git a/apps/files_sharing/tests/ShareTest.php b/apps/files_sharing/tests/ShareTest.php index 651341a5607..6956093a0c1 100644 --- a/apps/files_sharing/tests/ShareTest.php +++ b/apps/files_sharing/tests/ShareTest.php @@ -34,7 +34,7 @@ class ShareTest extends TestCase { $this->view->mkdir($this->folder); $this->view->mkdir($this->folder . $this->subfolder); $this->view->mkdir($this->folder . $this->subfolder . $this->subsubfolder); - $this->view->file_put_contents($this->folder.$this->filename, $this->data); + $this->view->file_put_contents($this->folder . $this->filename, $this->data); $this->view->file_put_contents($this->folder . $this->subfolder . $this->filename, $this->data); } @@ -103,7 +103,7 @@ class ShareTest extends TestCase { public function verifyDirContent($content, $expected) { foreach ($content as $c) { if (!in_array($c['name'], $expected)) { - $this->assertTrue(false, "folder should only contain '" . implode(',', $expected) . "', found: " .$c['name']); + $this->assertTrue(false, "folder should only contain '" . implode(',', $expected) . "', found: " . $c['name']); } } } diff --git a/apps/files_sharing/tests/SharesReminderJobTest.php b/apps/files_sharing/tests/SharesReminderJobTest.php index 9889ff47c53..d68a9d30182 100644 --- a/apps/files_sharing/tests/SharesReminderJobTest.php +++ b/apps/files_sharing/tests/SharesReminderJobTest.php @@ -152,7 +152,7 @@ class SharesReminderJobTest extends \Test\TestCase { * @param bool $shouldBeReminded */ public function testSharesReminder( - \DateTime|null $expirationDate, string $email, bool $isEmpty, int $permissions, bool $shouldBeReminded + ?\DateTime $expirationDate, string $email, bool $isEmpty, int $permissions, bool $shouldBeReminded, ): void { $this->loginAsUser($this->user1); diff --git a/apps/files_sharing/tests/UpdaterTest.php b/apps/files_sharing/tests/UpdaterTest.php index 9d26ff873a5..8aee8d7ddfc 100644 --- a/apps/files_sharing/tests/UpdaterTest.php +++ b/apps/files_sharing/tests/UpdaterTest.php @@ -85,7 +85,7 @@ class UpdaterTest extends TestCase { // share mount point should now be moved to the subfolder $this->assertFalse($view->file_exists($this->folder)); - $this->assertTrue($view->file_exists('localFolder/' .$this->folder)); + $this->assertTrue($view->file_exists('localFolder/' . $this->folder)); $view->unlink('localFolder'); @@ -290,7 +290,7 @@ class UpdaterTest extends TestCase { ); // user2 moves folder2 into folder1 - $viewUser2->rename($folder2, $folder1.'/'.$folder2); + $viewUser2->rename($folder2, $folder1 . '/' . $folder2); $folder2Share = $this->shareManager->getShareById($folder2Share->getFullId()); $file1Share = $this->shareManager->getShareById($file1Share->getFullId()); $subfolder1Share = $this->shareManager->getShareById($subfolder1Share->getFullId()); @@ -308,7 +308,7 @@ class UpdaterTest extends TestCase { $this->assertEquals(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE, $file2Share->getPermissions()); // user2 moves folder2 out of folder1 - $viewUser2->rename($folder1.'/'.$folder2, $folder2); + $viewUser2->rename($folder1 . '/' . $folder2, $folder2); $folder2Share = $this->shareManager->getShareById($folder2Share->getFullId()); $file1Share = $this->shareManager->getShareById($file1Share->getFullId()); $subfolder1Share = $this->shareManager->getShareById($subfolder1Share->getFullId()); diff --git a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php index e458039bf4f..18172560893 100644 --- a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php +++ b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php @@ -24,7 +24,7 @@ class ExpireTrash extends TimedJob { IConfig $config, IUserManager $userManager, Expiration $expiration, - ITimeFactory $time + ITimeFactory $time, ) { parent::__construct($time); // Run once per 30 minutes diff --git a/apps/files_trashbin/lib/Command/Size.php b/apps/files_trashbin/lib/Command/Size.php index 48ee2ced6cb..81ae82c02d3 100644 --- a/apps/files_trashbin/lib/Command/Size.php +++ b/apps/files_trashbin/lib/Command/Size.php @@ -26,7 +26,7 @@ class Size extends Base { public function __construct( IConfig $config, IUserManager $userManager, - IBus $commandBus + IBus $commandBus, ) { parent::__construct(); diff --git a/apps/files_trashbin/lib/Controller/PreviewController.php b/apps/files_trashbin/lib/Controller/PreviewController.php index 19eb15b733a..b006ba5e5ac 100644 --- a/apps/files_trashbin/lib/Controller/PreviewController.php +++ b/apps/files_trashbin/lib/Controller/PreviewController.php @@ -50,7 +50,7 @@ class PreviewController extends Controller { IUserSession $userSession, IMimeTypeDetector $mimeTypeDetector, IPreview $previewManager, - ITimeFactory $time + ITimeFactory $time, ) { parent::__construct($appName, $request); diff --git a/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php b/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php index 2aabd101d28..0bc6b37c35b 100644 --- a/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php +++ b/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php @@ -16,7 +16,11 @@ use OCP\Files\Node; * @since 28.0.0 */ class BeforeNodeRestoredEvent extends AbstractNodesEvent { - public function __construct(Node $source, Node $target, private bool &$run) { + public function __construct( + Node $source, + Node $target, + private bool &$run, + ) { parent::__construct($source, $target); } diff --git a/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php b/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php index db9a43be6fc..2cb3a94aa1d 100644 --- a/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php +++ b/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php @@ -113,8 +113,8 @@ class SyncLivePhotosListener implements IEventListener { */ private function getTrashItem(array $trashFolder, string $path): ?ITrashItem { foreach ($trashFolder as $trashItem) { - if (str_starts_with($path, 'files_trashbin/files'.$trashItem->getTrashPath())) { - if ($path === 'files_trashbin/files'.$trashItem->getTrashPath()) { + if (str_starts_with($path, 'files_trashbin/files' . $trashItem->getTrashPath())) { + if ($path === 'files_trashbin/files' . $trashItem->getTrashPath()) { return $trashItem; } diff --git a/apps/files_trashbin/lib/Sabre/RootCollection.php b/apps/files_trashbin/lib/Sabre/RootCollection.php index f626bfd7ee1..11c44266c3d 100644 --- a/apps/files_trashbin/lib/Sabre/RootCollection.php +++ b/apps/files_trashbin/lib/Sabre/RootCollection.php @@ -21,7 +21,7 @@ class RootCollection extends AbstractPrincipalCollection { public function __construct( ITrashManager $trashManager, PrincipalBackend\BackendInterface $principalBackend, - IConfig $config + IConfig $config, ) { parent::__construct($principalBackend, 'principals/users'); diff --git a/apps/files_trashbin/lib/Sabre/TrashHome.php b/apps/files_trashbin/lib/Sabre/TrashHome.php index edea2744e6f..2c7fe749be5 100644 --- a/apps/files_trashbin/lib/Sabre/TrashHome.php +++ b/apps/files_trashbin/lib/Sabre/TrashHome.php @@ -27,7 +27,7 @@ class TrashHome implements ICollection { public function __construct( array $principalInfo, ITrashManager $trashManager, - IUser $user + IUser $user, ) { $this->principalInfo = $principalInfo; $this->trashManager = $trashManager; diff --git a/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php b/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php index 3299c2d6126..83564d2a783 100644 --- a/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php +++ b/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php @@ -32,7 +32,7 @@ class TrashbinPlugin extends ServerPlugin { private $previewManager; public function __construct( - IPreview $previewManager + IPreview $previewManager, ) { $this->previewManager = $previewManager; } diff --git a/apps/files_trashbin/lib/Storage.php b/apps/files_trashbin/lib/Storage.php index d146f23d70a..412b9f44df9 100644 --- a/apps/files_trashbin/lib/Storage.php +++ b/apps/files_trashbin/lib/Storage.php @@ -43,7 +43,7 @@ class Storage extends Wrapper { ?IUserManager $userManager = null, ?LoggerInterface $logger = null, ?IEventDispatcher $eventDispatcher = null, - ?IRootFolder $rootFolder = null + ?IRootFolder $rootFolder = null, ) { $this->mountPoint = $parameters['mountPoint']; $this->trashManager = $trashManager; diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 544bc877d70..29e4d5e8a3c 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -990,7 +990,7 @@ class Trashbin { Server::get(IDBConnection::class)->getQueryBuilder(), Server::get(IFilesMetadataManager::class), ); - $normalizedParentPath = ltrim(Filesystem::normalizePath(dirname('files_trashbin/versions/'. $filename)), '/'); + $normalizedParentPath = ltrim(Filesystem::normalizePath(dirname('files_trashbin/versions/' . $filename)), '/'); $parentId = $cache->getId($normalizedParentPath); if ($parentId === -1) { return []; diff --git a/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php b/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php index 277c176d191..87c8647450f 100644 --- a/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php +++ b/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php @@ -28,8 +28,8 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator { use TMigratorBasicVersionHandling; - protected const PATH_FILES_FOLDER = Application::APP_ID.'/files'; - protected const PATH_LOCATIONS_FILE = Application::APP_ID.'/locations.json'; + protected const PATH_FILES_FOLDER = Application::APP_ID . '/files'; + protected const PATH_LOCATIONS_FILE = Application::APP_ID . '/locations.json'; protected IRootFolder $root; @@ -40,7 +40,7 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator { public function __construct( IRootFolder $rootFolder, IDBConnection $dbc, - IL10N $l10n + IL10N $l10n, ) { $this->root = $rootFolder; $this->dbc = $dbc; @@ -54,7 +54,7 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator { $uid = $user->getUID(); try { - $trashbinFolder = $this->root->get('/'.$uid.'/files_trashbin'); + $trashbinFolder = $this->root->get('/' . $uid . '/files_trashbin'); if (!$trashbinFolder instanceof Folder) { return 0; } @@ -73,9 +73,9 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator { $uid = $user->getUID(); try { - $trashbinFolder = $this->root->get('/'.$uid.'/files_trashbin'); + $trashbinFolder = $this->root->get('/' . $uid . '/files_trashbin'); if (!$trashbinFolder instanceof Folder) { - throw new UserMigrationException('/'.$uid.'/files_trashbin is not a folder'); + throw new UserMigrationException('/' . $uid . '/files_trashbin is not a folder'); } $output->writeln('Exporting trashbin files…'); $exportDestination->copyFolder($trashbinFolder, static::PATH_FILES_FOLDER); @@ -92,7 +92,7 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator { } catch (NotFoundException $e) { $output->writeln('No trashbin to export…'); } catch (\Throwable $e) { - throw new UserMigrationException('Could not export trashbin: '.$e->getMessage(), 0, $e); + throw new UserMigrationException('Could not export trashbin: ' . $e->getMessage(), 0, $e); } } @@ -111,12 +111,12 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator { if ($importSource->pathExists(static::PATH_FILES_FOLDER)) { try { - $trashbinFolder = $this->root->get('/'.$uid.'/files_trashbin'); + $trashbinFolder = $this->root->get('/' . $uid . '/files_trashbin'); if (!$trashbinFolder instanceof Folder) { - throw new UserMigrationException('Could not import trashbin, /'.$uid.'/files_trashbin is not a folder'); + throw new UserMigrationException('Could not import trashbin, /' . $uid . '/files_trashbin is not a folder'); } } catch (NotFoundException $e) { - $trashbinFolder = $this->root->newFolder('/'.$uid.'/files_trashbin'); + $trashbinFolder = $this->root->newFolder('/' . $uid . '/files_trashbin'); } $output->writeln('Importing trashbin files…'); try { diff --git a/apps/files_trashbin/tests/Command/CleanUpTest.php b/apps/files_trashbin/tests/Command/CleanUpTest.php index 49ae103ea30..6299400a65a 100644 --- a/apps/files_trashbin/tests/Command/CleanUpTest.php +++ b/apps/files_trashbin/tests/Command/CleanUpTest.php @@ -64,10 +64,10 @@ class CleanUpTest extends TestCase { for ($i = 0; $i < 10; $i++) { $query->insert($this->trashTable) ->values([ - 'id' => $query->expr()->literal('file'.$i), + 'id' => $query->expr()->literal('file' . $i), 'timestamp' => $query->expr()->literal($i), 'location' => $query->expr()->literal('.'), - 'user' => $query->expr()->literal('user'.$i % 2) + 'user' => $query->expr()->literal('user' . $i % 2) ])->execute(); } $getAllQuery = $this->dbConnection->getQueryBuilder(); diff --git a/apps/files_versions/lib/Capabilities.php b/apps/files_versions/lib/Capabilities.php index ce7239a4bf5..3566b82842a 100644 --- a/apps/files_versions/lib/Capabilities.php +++ b/apps/files_versions/lib/Capabilities.php @@ -16,7 +16,7 @@ class Capabilities implements ICapability { public function __construct( IConfig $config, - IAppManager $appManager + IAppManager $appManager, ) { $this->config = $config; $this->appManager = $appManager; diff --git a/apps/files_versions/lib/Controller/PreviewController.php b/apps/files_versions/lib/Controller/PreviewController.php index 8416503c643..4cda69beb96 100644 --- a/apps/files_versions/lib/Controller/PreviewController.php +++ b/apps/files_versions/lib/Controller/PreviewController.php @@ -38,7 +38,7 @@ class PreviewController extends Controller { IRootFolder $rootFolder, IUserSession $userSession, IVersionManager $versionManager, - IPreview $previewManager + IPreview $previewManager, ) { parent::__construct($appName, $request); @@ -67,7 +67,7 @@ class PreviewController extends Controller { string $file = '', int $x = 44, int $y = 44, - string $version = '' + string $version = '', ) { if ($file === '' || $version === '' || $x === 0 || $y === 0) { return new DataResponse([], Http::STATUS_BAD_REQUEST); diff --git a/apps/files_versions/lib/Sabre/RootCollection.php b/apps/files_versions/lib/Sabre/RootCollection.php index 8ed397069f7..2d59acdada0 100644 --- a/apps/files_versions/lib/Sabre/RootCollection.php +++ b/apps/files_versions/lib/Sabre/RootCollection.php @@ -34,7 +34,7 @@ class RootCollection extends AbstractPrincipalCollection { IConfig $config, IUserManager $userManager, IVersionManager $versionManager, - IUserSession $userSession + IUserSession $userSession, ) { parent::__construct($principalBackend, 'principals/users'); diff --git a/apps/files_versions/lib/Sabre/VersionFile.php b/apps/files_versions/lib/Sabre/VersionFile.php index 94fc101f05e..faa03473648 100644 --- a/apps/files_versions/lib/Sabre/VersionFile.php +++ b/apps/files_versions/lib/Sabre/VersionFile.php @@ -23,7 +23,7 @@ use Sabre\DAV\IFile; class VersionFile implements IFile { public function __construct( private IVersion $version, - private IVersionManager $versionManager + private IVersionManager $versionManager, ) { } diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 41f04b5a1d1..af14f8e4b9f 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -91,7 +91,7 @@ class Storage { Filesystem::initMountPoints($uid); if ($uid !== OC_User::getUser()) { $info = Filesystem::getFileInfo($filename); - $ownerView = new View('/'.$uid.'/files'); + $ownerView = new View('/' . $uid . '/files'); try { $filename = $ownerView->getPath($info['fileid']); // make sure that the file name doesn't end with a trailing slash @@ -303,7 +303,7 @@ class Storage { // does the directory exists for versions too ? if ($rootView->is_dir('/' . $sourceOwner . '/files_versions/' . $sourcePath)) { // create missing dirs if necessary - self::createMissingDirectories($targetPath, new View('/'. $targetOwner)); + self::createMissingDirectories($targetPath, new View('/' . $targetOwner)); // move the directory containing the versions $rootView->$operation( @@ -313,13 +313,13 @@ class Storage { } } elseif ($versions = Storage::getVersions($sourceOwner, '/' . $sourcePath)) { // create missing dirs if necessary - self::createMissingDirectories($targetPath, new View('/'. $targetOwner)); + self::createMissingDirectories($targetPath, new View('/' . $targetOwner)); foreach ($versions as $v) { // move each version one by one to the target directory $rootView->$operation( - '/' . $sourceOwner . '/files_versions/' . $sourcePath.'.v' . $v['version'], - '/' . $targetOwner . '/files_versions/' . $targetPath.'.v' . $v['version'] + '/' . $sourceOwner . '/files_versions/' . $sourcePath . '.v' . $v['version'], + '/' . $targetOwner . '/files_versions/' . $targetPath . '.v' . $v['version'] ); } } @@ -345,8 +345,8 @@ class Storage { $root = \OC::$server->get(IRootFolder::class); $userFolder = $root->getUserFolder($user->getUID()); - $users_view = new View('/'.$user->getUID()); - $files_view = new View('/'. $user->getUID().'/files'); + $users_view = new View('/' . $user->getUID()); + $files_view = new View('/' . $user->getUID() . '/files'); $versionCreated = false; @@ -358,9 +358,9 @@ class Storage { } //first create a new version - $version = 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename); + $version = 'files_versions' . $filename . '.v' . $users_view->filemtime('files' . $filename); if (!$users_view->file_exists($version)) { - $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename)); + $users_view->copy('files' . $filename, 'files_versions' . $filename . '.v' . $users_view->filemtime('files' . $filename)); $versionCreated = true; } @@ -562,7 +562,7 @@ class Storage { } try { - $node = $userFolder->get(substr($path, 0, -strlen('.v'.$version))); + $node = $userFolder->get(substr($path, 0, -strlen('.v' . $version))); $versionEntity = $versionsMapper->findVersionForFileId($node->getId(), $version); $versionEntities[$info->getId()] = $versionEntity; @@ -668,7 +668,7 @@ class Storage { ]; foreach ($versions as $key => $value) { - $size = $view->filesize(self::VERSIONS_ROOT.'/'.$value['path'].'.v'.$value['timestamp']); + $size = $view->filesize(self::VERSIONS_ROOT . '/' . $value['path'] . '.v' . $value['timestamp']); $filename = $value['path']; $result['all'][$key]['version'] = $value['timestamp']; @@ -703,7 +703,7 @@ class Storage { foreach ($versions as $key => $version) { if (!is_numeric($version['version'])) { \OC::$server->get(LoggerInterface::class)->error( - 'Found a non-numeric timestamp version: '. json_encode($version), + 'Found a non-numeric timestamp version: ' . json_encode($version), ['app' => 'files_versions']); continue; } @@ -753,7 +753,7 @@ class Storage { //distance between two version too small, mark to delete $toDelete[$key] = $version['path'] . '.v' . $version['version']; $size += $version['size']; - \OC::$server->get(LoggerInterface::class)->info('Mark to expire '. $version['path'] .' next version should be ' . $nextVersion . ' or smaller. (prevTimestamp: ' . $prevTimestamp . '; step: ' . $step, ['app' => 'files_versions']); + \OC::$server->get(LoggerInterface::class)->info('Mark to expire ' . $version['path'] . ' next version should be ' . $nextVersion . ' or smaller. (prevTimestamp: ' . $prevTimestamp . '; step: ' . $step, ['app' => 'files_versions']); } else { $nextVersion = $version['version'] - $step; $prevTimestamp = $version['version']; @@ -833,7 +833,7 @@ class Storage { // file maybe renamed or deleted return false; } - $versionsFileview = new View('/'.$uid.'/files_versions'); + $versionsFileview = new View('/' . $uid . '/files_versions'); $softQuota = true; $quota = $user->getQuota(); @@ -925,10 +925,10 @@ class Storage { reset($allVersions); while ($availableSpace < 0 && $i < $numOfVersions) { $version = current($allVersions); - \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); + \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'] . '.v' . $version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); self::deleteVersion($versionsFileview, $version['path'] . '.v' . $version['version']); - \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); - $logger->info('running out of space! Delete oldest version: ' . $version['path'].'.v'.$version['version'], ['app' => 'files_versions']); + \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'] . '.v' . $version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); + $logger->info('running out of space! Delete oldest version: ' . $version['path'] . '.v' . $version['version'], ['app' => 'files_versions']); $versionsSize -= $version['size']; $availableSpace += $version['size']; next($allVersions); diff --git a/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php b/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php index 84d62ab6b45..d1647381ffa 100644 --- a/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php +++ b/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php @@ -23,7 +23,6 @@ class CleanupExpiredAuthorizationCode extends TimedJob { ITimeFactory $timeFactory, private AccessTokenMapper $accessTokenMapper, private LoggerInterface $logger, - ) { parent::__construct($timeFactory); // 30 days diff --git a/apps/oauth2/lib/Controller/OauthApiController.php b/apps/oauth2/lib/Controller/OauthApiController.php index d763779053a..2e0732a1099 100644 --- a/apps/oauth2/lib/Controller/OauthApiController.php +++ b/apps/oauth2/lib/Controller/OauthApiController.php @@ -68,7 +68,7 @@ class OauthApiController extends Controller { #[BruteForceProtection(action: 'oauth2GetToken')] public function getToken( string $grant_type, ?string $code, ?string $refresh_token, - ?string $client_id, ?string $client_secret + ?string $client_id, ?string $client_secret, ): JSONResponse { // We only handle two types diff --git a/apps/oauth2/lib/Controller/SettingsController.php b/apps/oauth2/lib/Controller/SettingsController.php index f16b26696c4..9cbb9781231 100644 --- a/apps/oauth2/lib/Controller/SettingsController.php +++ b/apps/oauth2/lib/Controller/SettingsController.php @@ -35,7 +35,7 @@ class SettingsController extends Controller { private IL10N $l, private IAuthTokenProvider $tokenProvider, private IUserManager $userManager, - private ICrypto $crypto + private ICrypto $crypto, ) { parent::__construct($appName, $request); } diff --git a/apps/oauth2/lib/Db/ClientMapper.php b/apps/oauth2/lib/Db/ClientMapper.php index dc19c93c4e1..c5ca2989d0f 100644 --- a/apps/oauth2/lib/Db/ClientMapper.php +++ b/apps/oauth2/lib/Db/ClientMapper.php @@ -41,7 +41,7 @@ class ClientMapper extends QBMapper { try { $client = $this->findEntity($qb); } catch (IMapperException $e) { - throw new ClientNotFoundException('could not find client '.$clientIdentifier, 0, $e); + throw new ClientNotFoundException('could not find client ' . $clientIdentifier, 0, $e); } return $client; } @@ -61,7 +61,7 @@ class ClientMapper extends QBMapper { try { $client = $this->findEntity($qb); } catch (IMapperException $e) { - throw new ClientNotFoundException('could not find client with id '.$id, 0, $e); + throw new ClientNotFoundException('could not find client with id ' . $id, 0, $e); } return $client; } diff --git a/apps/oauth2/tests/Controller/OauthApiControllerTest.php b/apps/oauth2/tests/Controller/OauthApiControllerTest.php index fa8c90843e6..8d13265ec9e 100644 --- a/apps/oauth2/tests/Controller/OauthApiControllerTest.php +++ b/apps/oauth2/tests/Controller/OauthApiControllerTest.php @@ -352,7 +352,7 @@ class OauthApiControllerTest extends TestCase { $this->secureRandom->method('generate') ->willReturnCallback(function ($len) { - return 'random'.$len; + return 'random' . $len; }); $this->tokenProvider->expects($this->once()) @@ -448,7 +448,7 @@ class OauthApiControllerTest extends TestCase { $this->secureRandom->method('generate') ->willReturnCallback(function ($len) { - return 'random'.$len; + return 'random' . $len; }); $this->tokenProvider->expects($this->once()) @@ -547,7 +547,7 @@ class OauthApiControllerTest extends TestCase { $this->secureRandom->method('generate') ->willReturnCallback(function ($len) { - return 'random'.$len; + return 'random' . $len; }); $this->tokenProvider->expects($this->once()) diff --git a/apps/provisioning_api/lib/Controller/AppsController.php b/apps/provisioning_api/lib/Controller/AppsController.php index d60a85f3740..955c2bc39ab 100644 --- a/apps/provisioning_api/lib/Controller/AppsController.php +++ b/apps/provisioning_api/lib/Controller/AppsController.php @@ -25,7 +25,7 @@ class AppsController extends OCSController { public function __construct( string $appName, IRequest $request, - IAppManager $appManager + IAppManager $appManager, ) { parent::__construct($appName, $request); diff --git a/apps/provisioning_api/lib/Controller/PreferencesController.php b/apps/provisioning_api/lib/Controller/PreferencesController.php index 2a31e076c83..f230d1d781f 100644 --- a/apps/provisioning_api/lib/Controller/PreferencesController.php +++ b/apps/provisioning_api/lib/Controller/PreferencesController.php @@ -31,7 +31,7 @@ class PreferencesController extends OCSController { IRequest $request, IConfig $config, IUserSession $userSession, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { parent::__construct($appName, $request); $this->config = $config; diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index e65585902bc..9b90f95d842 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -787,7 +787,7 @@ class UsersController extends AUserData { string $userId, string $collectionName, string $key, - string $value + string $value, ): DataResponse { $currentLoggedInUser = $this->userSession->getUser(); if ($currentLoggedInUser === null) { diff --git a/apps/provisioning_api/lib/Controller/VerificationController.php b/apps/provisioning_api/lib/Controller/VerificationController.php index 18113484c8a..33b5bb0020f 100644 --- a/apps/provisioning_api/lib/Controller/VerificationController.php +++ b/apps/provisioning_api/lib/Controller/VerificationController.php @@ -49,7 +49,7 @@ class VerificationController extends Controller { IL10N $l10n, IUserSession $userSession, IAccountManager $accountManager, - Crypto $crypto + Crypto $crypto, ) { parent::__construct($appName, $request); $this->verificationToken = $verificationToken; diff --git a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php index 8bbc8a29c29..f9c0848fb72 100644 --- a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php +++ b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php @@ -90,7 +90,7 @@ class GroupsControllerTest extends \Test\TestCase { ->willReturn($gid); $group ->method('getDisplayName') - ->willReturn($gid.'-name'); + ->willReturn($gid . '-name'); $group ->method('count') ->willReturn(123); diff --git a/apps/settings/lib/Command/AdminDelegation/Add.php b/apps/settings/lib/Command/AdminDelegation/Add.php index 26a13b2cd6e..5cbef5c5d15 100644 --- a/apps/settings/lib/Command/AdminDelegation/Add.php +++ b/apps/settings/lib/Command/AdminDelegation/Add.php @@ -52,7 +52,7 @@ class Add extends Base { $this->authorizedGroupService->create($groupId, $settingClass); - $io->success('Administration of '.$settingClass.' delegated to '.$groupId.'.'); + $io->success('Administration of ' . $settingClass . ' delegated to ' . $groupId . '.'); return 0; } diff --git a/apps/settings/lib/Command/AdminDelegation/Remove.php b/apps/settings/lib/Command/AdminDelegation/Remove.php index 584b9201193..6b5347ce89f 100644 --- a/apps/settings/lib/Command/AdminDelegation/Remove.php +++ b/apps/settings/lib/Command/AdminDelegation/Remove.php @@ -43,12 +43,12 @@ class Remove extends Base { foreach ($groups as $group) { if ($group->getGroupId() === $groupId) { $this->authorizedGroupService->delete($group->getId()); - $io->success('Removed delegation of '.$settingClass.' to '.$groupId.'.'); + $io->success('Removed delegation of ' . $settingClass . ' to ' . $groupId . '.'); return 0; } } - $io->success('Group '.$groupId.' didn’t have delegation for '.$settingClass.'.'); + $io->success('Group ' . $groupId . ' didn’t have delegation for ' . $settingClass . '.'); return 0; } diff --git a/apps/settings/lib/Command/AdminDelegation/Show.php b/apps/settings/lib/Command/AdminDelegation/Show.php index 73f89ad0ead..9aba6bc0cb7 100644 --- a/apps/settings/lib/Command/AdminDelegation/Show.php +++ b/apps/settings/lib/Command/AdminDelegation/Show.php @@ -47,7 +47,7 @@ class Show extends Base { continue; } - $io->section('Section: '.$section->getID()); + $io->section('Section: ' . $section->getID()); $io->table($headers, array_map(function (IDelegatedSettings $setting) use ($section) { $className = get_class($setting); $groups = array_map( diff --git a/apps/settings/lib/Controller/AppSettingsController.php b/apps/settings/lib/Controller/AppSettingsController.php index 2c682ac4600..930c1c0f7e2 100644 --- a/apps/settings/lib/Controller/AppSettingsController.php +++ b/apps/settings/lib/Controller/AppSettingsController.php @@ -437,7 +437,7 @@ class AppSettingsController extends Controller { 'missingMaxOwnCloudVersion' => false, 'missingMinOwnCloudVersion' => false, 'canInstall' => true, - 'screenshot' => isset($app['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/'.base64_encode($app['screenshots'][0]['url']) : '', + 'screenshot' => isset($app['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/' . base64_encode($app['screenshots'][0]['url']) : '', 'score' => $app['ratingOverall'], 'ratingNumOverall' => $app['ratingNumOverall'], 'ratingNumThresholdReached' => $app['ratingNumOverall'] > 5, diff --git a/apps/settings/lib/Controller/UsersController.php b/apps/settings/lib/Controller/UsersController.php index eb401f85536..71f256f57d6 100644 --- a/apps/settings/lib/Controller/UsersController.php +++ b/apps/settings/lib/Controller/UsersController.php @@ -336,7 +336,7 @@ class UsersController extends Controller { ?string $birthdate = null, ?string $birthdateScope = null, ?string $pronouns = null, - ?string $pronounsScope = null + ?string $pronounsScope = null, ) { $user = $this->userSession->getUser(); if (!$user instanceof IUser) { diff --git a/apps/settings/lib/Listener/UserAddedToGroupActivityListener.php b/apps/settings/lib/Listener/UserAddedToGroupActivityListener.php index 7369f54bf37..36feeaa1035 100644 --- a/apps/settings/lib/Listener/UserAddedToGroupActivityListener.php +++ b/apps/settings/lib/Listener/UserAddedToGroupActivityListener.php @@ -32,7 +32,7 @@ class UserAddedToGroupActivityListener implements IEventListener { public function __construct( Manager $groupManager, IManager $activityManager, - IUserSession $userSession + IUserSession $userSession, ) { $this->groupManager = $groupManager; $this->activityManager = $activityManager; diff --git a/apps/settings/lib/Listener/UserRemovedFromGroupActivityListener.php b/apps/settings/lib/Listener/UserRemovedFromGroupActivityListener.php index 711f78212bc..82302f748ec 100644 --- a/apps/settings/lib/Listener/UserRemovedFromGroupActivityListener.php +++ b/apps/settings/lib/Listener/UserRemovedFromGroupActivityListener.php @@ -32,7 +32,7 @@ class UserRemovedFromGroupActivityListener implements IEventListener { public function __construct( Manager $groupManager, IManager $activityManager, - IUserSession $userSession + IUserSession $userSession, ) { $this->groupManager = $groupManager; $this->activityManager = $activityManager; diff --git a/apps/settings/lib/Settings/Admin/Delegation.php b/apps/settings/lib/Settings/Admin/Delegation.php index e38507b4fc1..72798a30673 100644 --- a/apps/settings/lib/Settings/Admin/Delegation.php +++ b/apps/settings/lib/Settings/Admin/Delegation.php @@ -28,7 +28,7 @@ class Delegation implements ISettings { IInitialState $initialStateService, IGroupManager $groupManager, AuthorizedGroupService $authorizedGroupService, - IURLGenerator $urlGenerator + IURLGenerator $urlGenerator, ) { $this->settingManager = $settingManager; $this->initialStateService = $initialStateService; diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php index 232fea8bd73..9aa0f9ee807 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -71,7 +71,7 @@ class PersonalInfo implements ISettings { IFactory $l10nFactory, IL10N $l, IInitialState $initialStateService, - IManager $manager + IManager $manager, ) { $this->config = $config; $this->userManager = $userManager; diff --git a/apps/settings/lib/SetupChecks/CronErrors.php b/apps/settings/lib/SetupChecks/CronErrors.php index 9a5c5b8af71..dc625b04477 100644 --- a/apps/settings/lib/SetupChecks/CronErrors.php +++ b/apps/settings/lib/SetupChecks/CronErrors.php @@ -35,7 +35,7 @@ class CronErrors implements ISetupCheck { return SetupResult::error( $this->l10n->t( "It was not possible to execute the cron job via CLI. The following technical errors have appeared:\n%s", - implode("\n", array_map(fn (array $error) => '- '.$error['error'].' '.$error['hint'], $errors)) + implode("\n", array_map(fn (array $error) => '- ' . $error['error'] . ' ' . $error['hint'], $errors)) ) ); } else { diff --git a/apps/settings/lib/SetupChecks/DatabaseHasMissingColumns.php b/apps/settings/lib/SetupChecks/DatabaseHasMissingColumns.php index b004c5ada35..ec004f73021 100644 --- a/apps/settings/lib/SetupChecks/DatabaseHasMissingColumns.php +++ b/apps/settings/lib/SetupChecks/DatabaseHasMissingColumns.php @@ -62,10 +62,10 @@ class DatabaseHasMissingColumns implements ISetupCheck { } else { $list = ''; foreach ($missingColumns as $missingColumn) { - $list .= "\n".$this->l10n->t('Missing optional column "%s" in table "%s".', [$missingColumn['columnName'], $missingColumn['tableName']]); + $list .= "\n" . $this->l10n->t('Missing optional column "%s" in table "%s".', [$missingColumn['columnName'], $missingColumn['tableName']]); } return SetupResult::warning( - $this->l10n->t('The database is missing some optional columns. Due to the fact that adding columns on big tables could take some time they were not added automatically when they can be optional. By running "occ db:add-missing-columns" those missing columns could be added manually while the instance keeps running. Once the columns are added some features might improve responsiveness or usability.').$list + $this->l10n->t('The database is missing some optional columns. Due to the fact that adding columns on big tables could take some time they were not added automatically when they can be optional. By running "occ db:add-missing-columns" those missing columns could be added manually while the instance keeps running. Once the columns are added some features might improve responsiveness or usability.') . $list ); } } diff --git a/apps/settings/lib/SetupChecks/DatabaseHasMissingPrimaryKeys.php b/apps/settings/lib/SetupChecks/DatabaseHasMissingPrimaryKeys.php index 8e2a0d18e41..03810ca8faf 100644 --- a/apps/settings/lib/SetupChecks/DatabaseHasMissingPrimaryKeys.php +++ b/apps/settings/lib/SetupChecks/DatabaseHasMissingPrimaryKeys.php @@ -62,10 +62,10 @@ class DatabaseHasMissingPrimaryKeys implements ISetupCheck { } else { $list = ''; foreach ($missingPrimaryKeys as $missingPrimaryKey) { - $list .= "\n".$this->l10n->t('Missing primary key on table "%s".', [$missingPrimaryKey['tableName']]); + $list .= "\n" . $this->l10n->t('Missing primary key on table "%s".', [$missingPrimaryKey['tableName']]); } return SetupResult::warning( - $this->l10n->t('The database is missing some primary keys. Due to the fact that adding primary keys on big tables could take some time they were not added automatically. By running "occ db:add-missing-primary-keys" those missing primary keys could be added manually while the instance keeps running.').$list + $this->l10n->t('The database is missing some primary keys. Due to the fact that adding primary keys on big tables could take some time they were not added automatically. By running "occ db:add-missing-primary-keys" those missing primary keys could be added manually while the instance keeps running.') . $list ); } } diff --git a/apps/settings/lib/SetupChecks/DatabasePendingBigIntConversions.php b/apps/settings/lib/SetupChecks/DatabasePendingBigIntConversions.php index dc9f00e8448..bb9794c1e03 100644 --- a/apps/settings/lib/SetupChecks/DatabasePendingBigIntConversions.php +++ b/apps/settings/lib/SetupChecks/DatabasePendingBigIntConversions.php @@ -74,7 +74,7 @@ class DatabasePendingBigIntConversions implements ISetupCheck { } $list .= "\n"; return SetupResult::info( - $this->l10n->t('Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running "occ db:convert-filecache-bigint" those pending changes could be applied manually. This operation needs to be made while the instance is offline.').$list, + $this->l10n->t('Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running "occ db:convert-filecache-bigint" those pending changes could be applied manually. This operation needs to be made while the instance is offline.') . $list, $this->urlGenerator->linkToDocs('admin-bigint-conversion') ); } diff --git a/apps/settings/lib/SetupChecks/OcxProviders.php b/apps/settings/lib/SetupChecks/OcxProviders.php index 191341b0ee4..c53e8087bd9 100644 --- a/apps/settings/lib/SetupChecks/OcxProviders.php +++ b/apps/settings/lib/SetupChecks/OcxProviders.php @@ -76,7 +76,7 @@ class OcxProviders implements ISetupCheck { $this->l10n->t('Your web server is not properly set up to resolve %1$s. This is most likely related to a web server configuration that was not updated to deliver this folder directly. Please compare your configuration against the shipped rewrite rules in ".htaccess" for Apache or the provided one in the documentation for Nginx. -On Nginx those are typically the lines starting with "location ~" that need an update.', [join(', ', array_map(fn ($s) => '"'.$s.'"', $missingProviders))]), +On Nginx those are typically the lines starting with "location ~" that need an update.', [join(', ', array_map(fn ($s) => '"' . $s . '"', $missingProviders))]), $this->urlGenerator->linkToDocs('admin-nginx'), ); } diff --git a/apps/settings/lib/SetupChecks/PhpModules.php b/apps/settings/lib/SetupChecks/PhpModules.php index 6d4246ffdae..60c14757301 100644 --- a/apps/settings/lib/SetupChecks/PhpModules.php +++ b/apps/settings/lib/SetupChecks/PhpModules.php @@ -77,7 +77,7 @@ class PhpModules implements ISetupCheck { $moduleList = implode( "\n", array_map( - fn (string $module) => '- '.$module.' '.$this->getRecommendedModuleDescription($module), + fn (string $module) => '- ' . $module . ' ' . $this->getRecommendedModuleDescription($module), $missingRecommendedModules ) ); diff --git a/apps/settings/lib/SetupChecks/SecurityHeaders.php b/apps/settings/lib/SetupChecks/SecurityHeaders.php index b85ab9b4018..ed4e56218da 100644 --- a/apps/settings/lib/SetupChecks/SecurityHeaders.php +++ b/apps/settings/lib/SetupChecks/SecurityHeaders.php @@ -65,16 +65,16 @@ class SecurityHeaders implements ISetupCheck { $value = preg_replace('/,\s+/', ',', strtolower($response->getHeader($header))); if ($value !== $expected) { if ($accepted !== null && $value === $accepted) { - $msg .= $this->l10n->t('- The `%1$s` HTTP header is not set to `%2$s`. Some features might not work correctly, as it is recommended to adjust this setting accordingly.', [$header, $expected])."\n"; + $msg .= $this->l10n->t('- The `%1$s` HTTP header is not set to `%2$s`. Some features might not work correctly, as it is recommended to adjust this setting accordingly.', [$header, $expected]) . "\n"; } else { - $msg .= $this->l10n->t('- The `%1$s` HTTP header is not set to `%2$s`. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.', [$header, $expected])."\n"; + $msg .= $this->l10n->t('- The `%1$s` HTTP header is not set to `%2$s`. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.', [$header, $expected]) . "\n"; } } } $xssFields = array_map('trim', explode(';', $response->getHeader('X-XSS-Protection'))); if (!in_array('1', $xssFields) || !in_array('mode=block', $xssFields)) { - $msg .= $this->l10n->t('- The `%1$s` HTTP header does not contain `%2$s`. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.', ['X-XSS-Protection', '1; mode=block'])."\n"; + $msg .= $this->l10n->t('- The `%1$s` HTTP header does not contain `%2$s`. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.', ['X-XSS-Protection', '1; mode=block']) . "\n"; } $referrerPolicy = $response->getHeader('Referrer-Policy'); @@ -89,7 +89,7 @@ class SecurityHeaders implements ISetupCheck { 'strict-origin-when-cross-origin', 'same-origin', ] - )."\n"; + ) . "\n"; $msgParameters['w3c-recommendation'] = [ 'type' => 'highlight', 'id' => 'w3c-recommendation', @@ -103,17 +103,17 @@ class SecurityHeaders implements ISetupCheck { if (preg_match('/^max-age=(\d+)(;.*)?$/', $transportSecurityValidity, $m)) { $transportSecurityValidity = (int)$m[1]; if ($transportSecurityValidity < $minimumSeconds) { - $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is not set to at least `%d` seconds (current value: `%d`). For enhanced security, it is recommended to use a long HSTS policy.', [$minimumSeconds, $transportSecurityValidity])."\n"; + $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is not set to at least `%d` seconds (current value: `%d`). For enhanced security, it is recommended to use a long HSTS policy.', [$minimumSeconds, $transportSecurityValidity]) . "\n"; } } elseif (!empty($transportSecurityValidity)) { - $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is malformed: `%s`. For enhanced security, it is recommended to enable HSTS.', [$transportSecurityValidity])."\n"; + $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is malformed: `%s`. For enhanced security, it is recommended to enable HSTS.', [$transportSecurityValidity]) . "\n"; } else { - $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is not set (should be at least `%d` seconds). For enhanced security, it is recommended to enable HSTS.', [$minimumSeconds])."\n"; + $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is not set (should be at least `%d` seconds). For enhanced security, it is recommended to enable HSTS.', [$minimumSeconds]) . "\n"; } if (!empty($msg)) { return SetupResult::warning( - $this->l10n->t('Some headers are not set correctly on your instance')."\n".$msg, + $this->l10n->t('Some headers are not set correctly on your instance') . "\n" . $msg, $this->urlGenerator->linkToDocs('admin-security'), $msgParameters, ); diff --git a/apps/settings/lib/SetupChecks/TempSpaceAvailable.php b/apps/settings/lib/SetupChecks/TempSpaceAvailable.php index ef51ffe0e07..49dc0d377e7 100644 --- a/apps/settings/lib/SetupChecks/TempSpaceAvailable.php +++ b/apps/settings/lib/SetupChecks/TempSpaceAvailable.php @@ -85,7 +85,7 @@ class TempSpaceAvailable implements ISetupCheck { return SetupResult::error($this->l10n->t('Error while checking the available disk space of temporary PHP path or no free disk space returned. Temporary path: %s', [$nextcloudTempPath])); } $freeSpaceInNextcloudTempInGB = $freeSpaceInNextcloudTemp / 1024 / 1024 / 1024; - $spaceDetail .= "\n".$this->l10n->t('- %.1f GiB available in %s (Nextcloud temporary directory)', [round($freeSpaceInNextcloudTempInGB, 1),$nextcloudTempPath]); + $spaceDetail .= "\n" . $this->l10n->t('- %.1f GiB available in %s (Nextcloud temporary directory)', [round($freeSpaceInNextcloudTempInGB, 1),$nextcloudTempPath]); } if (!$this->isPrimaryStorageS3()) { diff --git a/apps/settings/lib/UserMigration/AccountMigrator.php b/apps/settings/lib/UserMigration/AccountMigrator.php index dc5ca2691f7..81107cd81c5 100644 --- a/apps/settings/lib/UserMigration/AccountMigrator.php +++ b/apps/settings/lib/UserMigration/AccountMigrator.php @@ -55,7 +55,7 @@ class AccountMigrator implements IMigrator, ISizeEstimationMigrator { IAvatarManager $avatarManager, ProfileManager $profileManager, ProfileConfigMapper $configMapper, - IL10N $l10n + IL10N $l10n, ) { $this->accountManager = $accountManager; $this->avatarManager = $avatarManager; diff --git a/apps/settings/tests/Controller/UsersControllerTest.php b/apps/settings/tests/Controller/UsersControllerTest.php index e8ae965b3bb..80eb252f988 100644 --- a/apps/settings/tests/Controller/UsersControllerTest.php +++ b/apps/settings/tests/Controller/UsersControllerTest.php @@ -669,7 +669,7 @@ class UsersControllerTest extends \Test\TestCase { */ public function testSaveUserSettings($data, $oldEmailAddress, - $oldDisplayName + $oldDisplayName, ): void { $controller = $this->getController(); $user = $this->createMock(IUser::class); @@ -792,7 +792,7 @@ class UsersControllerTest extends \Test\TestCase { string $oldEmailAddress, string $oldDisplayName, bool $setDisplayNameResult, - bool $canChangeEmail + bool $canChangeEmail, ): void { $this->expectException(ForbiddenException::class); diff --git a/apps/settings/tests/SetupChecks/SecurityHeadersTest.php b/apps/settings/tests/SetupChecks/SecurityHeadersTest.php index 2bc5aa69b9c..d8bb51d47c6 100644 --- a/apps/settings/tests/SetupChecks/SecurityHeadersTest.php +++ b/apps/settings/tests/SetupChecks/SecurityHeadersTest.php @@ -176,7 +176,7 @@ class SecurityHeadersTest extends TestCase { $result = $this->setupcheck->run(); $this->assertEquals( - 'Some headers are not set correctly on your instance'."\n$msg", + 'Some headers are not set correctly on your instance' . "\n$msg", $result->getDescription() ); $this->assertEquals(SetupResult::WARNING, $result->getSeverity()); diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 74483771762..fd43e7c089e 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -684,7 +684,7 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider ?\DateTimeInterface $expirationTime, ?string $note = '', ?IAttributes $attributes = null, - ?bool $mailSend = true + ?bool $mailSend = true, ): int { $qb = $this->dbConnection->getQueryBuilder(); $qb->insert('share') diff --git a/apps/systemtags/lib/Activity/Setting.php b/apps/systemtags/lib/Activity/Setting.php index c65cf3d404a..95001e95cf3 100644 --- a/apps/systemtags/lib/Activity/Setting.php +++ b/apps/systemtags/lib/Activity/Setting.php @@ -9,7 +9,9 @@ use OCP\Activity\ActivitySettings; use OCP\IL10N; class Setting extends ActivitySettings { - public function __construct(protected IL10N $l) { + public function __construct( + protected IL10N $l, + ) { } /** diff --git a/apps/systemtags/lib/Search/TagSearchProvider.php b/apps/systemtags/lib/Search/TagSearchProvider.php index 80f9d39c141..6e6f587d366 100644 --- a/apps/systemtags/lib/Search/TagSearchProvider.php +++ b/apps/systemtags/lib/Search/TagSearchProvider.php @@ -52,7 +52,7 @@ class TagSearchProvider implements IProvider { IMimeTypeDetector $mimeTypeDetector, IRootFolder $rootFolder, ISystemTagObjectMapper $objectMapper, - ISystemTagManager $tagManager + ISystemTagManager $tagManager, ) { $this->l10n = $l10n; $this->urlGenerator = $urlGenerator; @@ -118,7 +118,7 @@ class TagSearchProvider implements IProvider { $thumbnailUrl = ''; $link = $this->urlGenerator->linkToRoute('files.view.indexView', [ 'view' => 'tags', - ]) . '?dir='.$tag->getId(); + ]) . '?dir=' . $tag->getId(); $searchResultEntry = new SearchResultEntry( $thumbnailUrl, $this->l10n->t('All tagged %s …', [$tag->getName()]), diff --git a/apps/testing/lib/Listener/GetDeclarativeSettingsValueListener.php b/apps/testing/lib/Listener/GetDeclarativeSettingsValueListener.php index 312f49e5f5c..0df58168007 100644 --- a/apps/testing/lib/Listener/GetDeclarativeSettingsValueListener.php +++ b/apps/testing/lib/Listener/GetDeclarativeSettingsValueListener.php @@ -17,7 +17,9 @@ use OCP\Settings\Events\DeclarativeSettingsGetValueEvent; */ class GetDeclarativeSettingsValueListener implements IEventListener { - public function __construct(private IConfig $config) { + public function __construct( + private IConfig $config, + ) { } public function handle(Event $event): void { diff --git a/apps/testing/lib/Listener/SetDeclarativeSettingsValueListener.php b/apps/testing/lib/Listener/SetDeclarativeSettingsValueListener.php index 19f1ae79b7b..0058e7df43e 100644 --- a/apps/testing/lib/Listener/SetDeclarativeSettingsValueListener.php +++ b/apps/testing/lib/Listener/SetDeclarativeSettingsValueListener.php @@ -17,7 +17,9 @@ use OCP\Settings\Events\DeclarativeSettingsSetValueEvent; */ class SetDeclarativeSettingsValueListener implements IEventListener { - public function __construct(private IConfig $config) { + public function __construct( + private IConfig $config, + ) { } public function handle(Event $event): void { diff --git a/apps/testing/lib/Locking/FakeDBLockingProvider.php b/apps/testing/lib/Locking/FakeDBLockingProvider.php index 2c4d394fb0d..6e2fd9a77d8 100644 --- a/apps/testing/lib/Locking/FakeDBLockingProvider.php +++ b/apps/testing/lib/Locking/FakeDBLockingProvider.php @@ -21,7 +21,7 @@ class FakeDBLockingProvider extends DBLockingProvider { public function __construct( IDBConnection $connection, - ITimeFactory $timeFactory + ITimeFactory $timeFactory, ) { parent::__construct($connection, $timeFactory); $this->db = $connection; diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php index bdd5a43ddc3..7ba9e801d9b 100644 --- a/apps/theming/lib/Controller/IconController.php +++ b/apps/theming/lib/Controller/IconController.php @@ -40,7 +40,7 @@ class IconController extends Controller { IconBuilder $iconBuilder, ImageManager $imageManager, FileAccessHelper $fileAccessHelper, - IAppManager $appManager + IAppManager $appManager, ) { parent::__construct($appName, $request); diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php index e7e83a0b4c0..5e8754dec83 100644 --- a/apps/theming/lib/IconBuilder.php +++ b/apps/theming/lib/IconBuilder.php @@ -27,7 +27,7 @@ class IconBuilder { public function __construct( ThemingDefaults $themingDefaults, Util $util, - ImageManager $imageManager + ImageManager $imageManager, ) { $this->themingDefaults = $themingDefaults; $this->util = $util; @@ -127,12 +127,12 @@ class IconBuilder { $cornerRadius = 0.2 * $size; $background = '<?xml version="1.0" encoding="UTF-8"?>' . '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:cc="http://creativecommons.org/ns#" width="' . $size . '" height="' . $size . '" xmlns:xlink="http://www.w3.org/1999/xlink">' . - '<rect x="0" y="0" rx="' . $cornerRadius . '" ry="' . $cornerRadius . '" width="' . $size. '" height="' . $size . '" style="fill:' . $color . ';" />' . + '<rect x="0" y="0" rx="' . $cornerRadius . '" ry="' . $cornerRadius . '" width="' . $size . '" height="' . $size . '" style="fill:' . $color . ';" />' . '</svg>'; // resize svg magic as this seems broken in Imagemagick if ($mime === 'image/svg+xml' || substr($appIconContent, 0, 4) === '<svg') { if (substr($appIconContent, 0, 5) !== '<?xml') { - $svg = '<?xml version="1.0"?>'.$appIconContent; + $svg = '<?xml version="1.0"?>' . $appIconContent; } else { $svg = $appIconContent; } diff --git a/apps/theming/lib/Jobs/MigrateBackgroundImages.php b/apps/theming/lib/Jobs/MigrateBackgroundImages.php index aff13fc2910..6bf1dd4e5bc 100644 --- a/apps/theming/lib/Jobs/MigrateBackgroundImages.php +++ b/apps/theming/lib/Jobs/MigrateBackgroundImages.php @@ -42,7 +42,7 @@ class MigrateBackgroundImages extends QueuedJob { IJobList $jobList, IDBConnection $dbc, IAppData $appData, - LoggerInterface $logger + LoggerInterface $logger, ) { parent::__construct($time); $this->appDataFactory = $appDataFactory; @@ -54,7 +54,7 @@ class MigrateBackgroundImages extends QueuedJob { protected function run(mixed $argument): void { if (!is_array($argument) || !isset($argument['stage'])) { - throw new \Exception('Job '.self::class.' called with wrong argument'); + throw new \Exception('Job ' . self::class . ' called with wrong argument'); } switch ($argument['stage']) { diff --git a/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php b/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php index 1ec659d0646..42662dacef2 100644 --- a/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php +++ b/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php @@ -42,7 +42,7 @@ class RestoreBackgroundImageColor extends QueuedJob { protected function run(mixed $argument): void { if (!is_array($argument) || !isset($argument['stage'])) { - throw new \Exception('Job '.self::class.' called with wrong argument'); + throw new \Exception('Job ' . self::class . ' called with wrong argument'); } switch ($argument['stage']) { @@ -69,7 +69,7 @@ class RestoreBackgroundImageColor extends QueuedJob { // Get those users, that have a background_image set - not the default, but no background_color. $result = $qb->selectDistinct('a.userid') ->from('preferences', 'a') - ->leftJoin('a', $qb->createFunction('('.$innerSQL->getSQL().')'), 'b', 'a.userid = b.userid') + ->leftJoin('a', $qb->createFunction('(' . $innerSQL->getSQL() . ')'), 'b', 'a.userid = b.userid') ->where($qb2->expr()->eq('a.configkey', $qb->createNamedParameter('background_image'))) ->andWhere($qb2->expr()->neq('a.configvalue', $qb->createNamedParameter(BackgroundService::BACKGROUND_DEFAULT))) ->andWhere($qb2->expr()->isNull('b.userid')) @@ -101,7 +101,7 @@ class RestoreBackgroundImageColor extends QueuedJob { } $background = $this->config->getUserValue($userId, Application::APP_ID, 'background_image'); - switch($background) { + switch ($background) { case BackgroundService::BACKGROUND_DEFAULT: $this->service->setDefaultBackground($userId); break; diff --git a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php index cb72e46360e..2ad495b0239 100644 --- a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php +++ b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php @@ -35,7 +35,7 @@ class BeforeTemplateRenderedListener implements IEventListener { ContainerInterface $container, ThemeInjectionService $themeInjectionService, IUserSession $userSession, - IConfig $config + IConfig $config, ) { $this->initialState = $initialState; $this->container = $container; diff --git a/apps/theming/lib/Service/BackgroundService.php b/apps/theming/lib/Service/BackgroundService.php index a0158dcb667..bf650874448 100644 --- a/apps/theming/lib/Service/BackgroundService.php +++ b/apps/theming/lib/Service/BackgroundService.php @@ -321,7 +321,7 @@ class BackgroundService { * @param resource|string $path * @return string|null The fallback background color - if any */ - public function setGlobalBackground($path): string|null { + public function setGlobalBackground($path): ?string { $image = new \OCP\Image(); $handle = is_resource($path) ? $path : fopen($path, 'rb'); @@ -347,7 +347,7 @@ class BackgroundService { $hex = dechex($channel); return match (strlen($hex)) { 0 => '00', - 1 => '0'.$hex, + 1 => '0' . $hex, 2 => $hex, default => 'ff', }; diff --git a/apps/theming/lib/Service/ThemesService.php b/apps/theming/lib/Service/ThemesService.php index 49cd72d4255..ef8d1ff44ff 100644 --- a/apps/theming/lib/Service/ThemesService.php +++ b/apps/theming/lib/Service/ThemesService.php @@ -31,7 +31,8 @@ class ThemesService { private DarkTheme $darkTheme, HighContrastTheme $highContrastTheme, DarkHighContrastTheme $darkHighContrastTheme, - DyslexiaFont $dyslexiaFont) { + DyslexiaFont $dyslexiaFont, + ) { // Register themes $this->themesProviders = [ diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index 9be830a61fd..42c96557ba7 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -123,7 +123,7 @@ class ThemingDefaults extends \OC_Defaults { $footer = '<a href="' . $baseUrl . '" target="_blank"' . ' rel="noreferrer noopener" class="entity-name">' . $entity . '</a>'; } else { - $footer = '<span class="entity-name">' .$entity . '</span>'; + $footer = '<span class="entity-name">' . $entity . '</span>'; } } $footer .= ($slogan !== '' ? ' – ' . $slogan : ''); @@ -340,10 +340,10 @@ class ThemingDefaults extends \OC_Defaults { 'theming-favicon-mime' => "'" . $this->config->getAppValue('theming', 'faviconMime') . "'" ]; - $variables['image-logo'] = "url('".$this->imageManager->getImageUrl('logo')."')"; - $variables['image-logoheader'] = "url('".$this->imageManager->getImageUrl('logoheader')."')"; - $variables['image-favicon'] = "url('".$this->imageManager->getImageUrl('favicon')."')"; - $variables['image-login-background'] = "url('".$this->imageManager->getImageUrl('background')."')"; + $variables['image-logo'] = "url('" . $this->imageManager->getImageUrl('logo') . "')"; + $variables['image-logoheader'] = "url('" . $this->imageManager->getImageUrl('logoheader') . "')"; + $variables['image-favicon'] = "url('" . $this->imageManager->getImageUrl('favicon') . "')"; + $variables['image-login-background'] = "url('" . $this->imageManager->getImageUrl('background') . "')"; $variables['image-login-plain'] = 'false'; if ($this->appConfig->getValueString(Application::APP_ID, 'primary_color', '') !== '') { diff --git a/apps/theming/lib/Util.php b/apps/theming/lib/Util.php index 809ff53f5e1..839ef1d0b46 100644 --- a/apps/theming/lib/Util.php +++ b/apps/theming/lib/Util.php @@ -189,7 +189,7 @@ class Util { */ public function generateRadioButton($color) { $radioButtonIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16">' . - '<path d="M8 1a7 7 0 0 0-7 7 7 7 0 0 0 7 7 7 7 0 0 0 7-7 7 7 0 0 0-7-7zm0 1a6 6 0 0 1 6 6 6 6 0 0 1-6 6 6 6 0 0 1-6-6 6 6 0 0 1 6-6zm0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8z" fill="'.$color.'"/></svg>'; + '<path d="M8 1a7 7 0 0 0-7 7 7 7 0 0 0 7 7 7 7 0 0 0 7-7 7 7 0 0 0-7-7zm0 1a6 6 0 0 1 6 6 6 6 0 0 1-6 6 6 6 0 0 1-6-6 6 6 0 0 1 6-6zm0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8z" fill="' . $color . '"/></svg>'; return base64_encode($radioButtonIcon); } diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php index d69ceefa0e5..6ce808253a0 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -256,7 +256,7 @@ class ThemingControllerTest extends TestCase { ->method('getUploadedFile') ->with('image') ->willReturn([ - 'tmp_name' => __DIR__ . '/../../../../tests/data/testimagelarge.svg', + 'tmp_name' => __DIR__ . '/../../../../tests/data/testimagelarge.svg', 'type' => 'image/svg', 'name' => 'testimagelarge.svg', 'error' => 0, @@ -297,7 +297,7 @@ class ThemingControllerTest extends TestCase { ->method('getUploadedFile') ->with('image') ->willReturn([ - 'tmp_name' => __DIR__ . '/../../../../tests/data/lorem.txt', + 'tmp_name' => __DIR__ . '/../../../../tests/data/lorem.txt', 'type' => 'application/pdf', 'name' => 'logo.pdf', 'error' => 0, @@ -443,7 +443,7 @@ class ThemingControllerTest extends TestCase { $tmpLogo = \OC::$server->getTempManager()->getTemporaryFolder() . '/logo.svg'; touch($tmpLogo); - file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/data.zip')); + file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/data.zip')); $this->request ->expects($this->once()) ->method('getParam') diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php index 942bcf399fa..bef48448bfa 100644 --- a/apps/theming/tests/IconBuilderTest.php +++ b/apps/theming/tests/IconBuilderTest.php @@ -84,7 +84,7 @@ class IconBuilderTest extends TestCase { ->with('global/images') ->willThrowException(new NotFoundException()); - $expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file); + $expectedIcon = new \Imagick(realpath(__DIR__) . '/data/' . $file); $icon = $this->iconBuilder->renderAppIcon($app, 512); $this->assertEquals(true, $icon->valid()); @@ -113,7 +113,7 @@ class IconBuilderTest extends TestCase { ->with('global/images') ->willThrowException(new NotFoundException()); - $expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file); + $expectedIcon = new \Imagick(realpath(__DIR__) . '/data/' . $file); $icon = new \Imagick(); $icon->readImageBlob($this->iconBuilder->getTouchIcon($app)); @@ -146,7 +146,7 @@ class IconBuilderTest extends TestCase { ->with('global/images') ->willThrowException(new NotFoundException()); - $expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file); + $expectedIcon = new \Imagick(realpath(__DIR__) . '/data/' . $file); $actualIcon = $this->iconBuilder->getFavicon($app); $icon = new \Imagick(); diff --git a/apps/updatenotification/lib/Command/Check.php b/apps/updatenotification/lib/Command/Check.php index 75e42904515..a66e729e8a7 100644 --- a/apps/updatenotification/lib/Command/Check.php +++ b/apps/updatenotification/lib/Command/Check.php @@ -52,7 +52,7 @@ class Check extends Command { // Server $r = $this->updateChecker->getUpdateState(); if (isset($r['updateAvailable']) && $r['updateAvailable']) { - $output->writeln($r['updateVersionString'] . ' is available. Get more information on how to update at '. $r['updateLink'] . '.'); + $output->writeln($r['updateVersionString'] . ' is available. Get more information on how to update at ' . $r['updateLink'] . '.'); $updatesAvailableCount += 1; } diff --git a/apps/updatenotification/lib/Manager.php b/apps/updatenotification/lib/Manager.php index f2e75eedfa4..b6f455f93fe 100644 --- a/apps/updatenotification/lib/Manager.php +++ b/apps/updatenotification/lib/Manager.php @@ -34,7 +34,7 @@ class Manager { * @param ?string $languageCode The language in which to query the changelog (defaults to current user language and fallsback to English) * @return string|null Either the changelog entry or null if no changelog is found */ - public function getChangelog(string $appId, string $version, ?string $languageCode = null): string|null { + public function getChangelog(string $appId, string $version, ?string $languageCode = null): ?string { if ($languageCode === null) { $languageCode = $this->l10NFactory->getUserLanguage($this->currentUser); } @@ -55,7 +55,7 @@ class Manager { * @param string $languageCode The language code to search * @return string|null Either the file path or null if not found */ - public function getChangelogFile(string $appId, string $languageCode): string|null { + public function getChangelogFile(string $appId, string $languageCode): ?string { try { $appPath = $this->appManager->getAppPath($appId); $files = ["CHANGELOG.$languageCode.md", 'CHANGELOG.en.md']; @@ -76,7 +76,7 @@ class Manager { * @param string $path The path to the changlog file * @param string $version The version to query (make sure to only pass in "{major}.{minor}(.{patch}" format) */ - protected function retrieveChangelogEntry(string $path, string $version): string|null { + protected function retrieveChangelogEntry(string $path, string $version): ?string { $matches = []; $content = file_get_contents($path); if ($content === false) { diff --git a/apps/updatenotification/lib/Settings/Admin.php b/apps/updatenotification/lib/Settings/Admin.php index 6e39a40ad8d..4a74993f0a5 100644 --- a/apps/updatenotification/lib/Settings/Admin.php +++ b/apps/updatenotification/lib/Settings/Admin.php @@ -35,7 +35,7 @@ class Admin implements ISettings { private IRegistry $subscriptionRegistry, private IUserManager $userManager, private LoggerInterface $logger, - private IInitialState $initialState + private IInitialState $initialState, ) { } diff --git a/apps/user_ldap/ajax/getNewServerConfigPrefix.php b/apps/user_ldap/ajax/getNewServerConfigPrefix.php index 8064ce92833..ccd96250d52 100644 --- a/apps/user_ldap/ajax/getNewServerConfigPrefix.php +++ b/apps/user_ldap/ajax/getNewServerConfigPrefix.php @@ -15,7 +15,7 @@ $serverConnections = $helper->getServerConfigurationPrefixes(); sort($serverConnections); $lk = array_pop($serverConnections); $ln = (int)str_replace('s', '', $lk); -$nk = 's'.str_pad($ln + 1, 2, '0', STR_PAD_LEFT); +$nk = 's' . str_pad($ln + 1, 2, '0', STR_PAD_LEFT); $resultData = ['configPrefix' => $nk]; diff --git a/apps/user_ldap/ajax/wizard.php b/apps/user_ldap/ajax/wizard.php index 5c2cddc7672..f1778677327 100644 --- a/apps/user_ldap/ajax/wizard.php +++ b/apps/user_ldap/ajax/wizard.php @@ -98,7 +98,7 @@ switch ($action) { $setParameters = []; $configuration->setConfiguration($cfg, $setParameters); if (!in_array($key, $setParameters)) { - \OC_JSON::error(['message' => $l->t($key. + \OC_JSON::error(['message' => $l->t($key . ' Could not set configuration %s', $setParameters[0])]); exit; } diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index dab8db20c99..81f3dc6cb70 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -624,7 +624,7 @@ class Access extends LDAPUtility { string $fdn, string $name, string $uuid, - bool $isUser + bool $isUser, ): bool { if ($mapper->map($fdn, $name, $uuid)) { if ($isUser) { @@ -1118,7 +1118,7 @@ class Access extends LDAPUtility { string $base, ?array &$attr, ?int $pageSize, - ?int $offset + ?int $offset, ) { // See if we have a resource, in case not cancel with message $cr = $this->connection->getConnectionResource(); @@ -1158,7 +1158,7 @@ class Access extends LDAPUtility { int $foundItems, int $limit, bool $pagedSearchOK, - bool $skipHandling + bool $skipHandling, ): bool { $cookie = ''; if ($pagedSearchOK) { @@ -1213,7 +1213,7 @@ class Access extends LDAPUtility { ?array $attr = null, int $limit = 0, int $offset = 0, - bool $skipHandling = false + bool $skipHandling = false, ) { $this->logger->debug('Count filter: {filter}', [ 'app' => 'user_ldap', @@ -1278,7 +1278,7 @@ class Access extends LDAPUtility { ?array $attr = null, ?int $limit = null, ?int $offset = null, - bool $skipHandling = false + bool $skipHandling = false, ): array { $limitPerPage = (int)$this->connection->ldapPagingSize; if (!is_null($limit) && $limit < $limitPerPage && $limit > 0) { @@ -1983,7 +1983,7 @@ class Access extends LDAPUtility { string $base, ?array $attr, int $pageSize, - int $offset + int $offset, ): array { $pagedSearchOK = false; if ($pageSize !== 0) { diff --git a/apps/user_ldap/lib/AppInfo/Application.php b/apps/user_ldap/lib/AppInfo/Application.php index 400315442bb..e3f6f56152c 100644 --- a/apps/user_ldap/lib/AppInfo/Application.php +++ b/apps/user_ldap/lib/AppInfo/Application.php @@ -109,7 +109,7 @@ class Application extends App implements IBootstrap { IGroupManager $groupManager, User_Proxy $userBackend, Group_Proxy $groupBackend, - Helper $helper + Helper $helper, ) { $configPrefixes = $helper->getServerConfigurationPrefixes(true); if (count($configPrefixes) > 0) { diff --git a/apps/user_ldap/lib/Command/CheckGroup.php b/apps/user_ldap/lib/Command/CheckGroup.php index c376d0f890a..9c7ccb9d3b3 100644 --- a/apps/user_ldap/lib/Command/CheckGroup.php +++ b/apps/user_ldap/lib/Command/CheckGroup.php @@ -99,25 +99,25 @@ class CheckGroup extends Command { throw new \Exception('The given group is not a recognized LDAP group.'); } catch (\Exception $e) { - $output->writeln('<error>' . $e->getMessage(). '</error>'); + $output->writeln('<error>' . $e->getMessage() . '</error>'); return self::FAILURE; } } public function onGroupCreatedEvent(GroupCreatedEvent $event, OutputInterface $output): void { - $output->writeln('<info>The group '.$event->getGroup()->getGID().' was added to Nextcloud with '.$event->getGroup()->count().' users</info>'); + $output->writeln('<info>The group ' . $event->getGroup()->getGID() . ' was added to Nextcloud with ' . $event->getGroup()->count() . ' users</info>'); } public function onUserAddedEvent(UserAddedEvent $event, OutputInterface $output): void { $user = $event->getUser(); $group = $event->getGroup(); - $output->writeln('<info>The user '.$user->getUID().' was added to group '.$group->getGID().'</info>'); + $output->writeln('<info>The user ' . $user->getUID() . ' was added to group ' . $group->getGID() . '</info>'); } public function onUserRemovedEvent(UserRemovedEvent $event, OutputInterface $output): void { $user = $event->getUser(); $group = $event->getGroup(); - $output->writeln('<info>The user '.$user->getUID().' was removed from group '.$group->getGID().'</info>'); + $output->writeln('<info>The user ' . $user->getUID() . ' was removed from group ' . $group->getGID() . '</info>'); } /** diff --git a/apps/user_ldap/lib/Command/CheckUser.php b/apps/user_ldap/lib/Command/CheckUser.php index ebb416c24a6..d5bd0235b2c 100644 --- a/apps/user_ldap/lib/Command/CheckUser.php +++ b/apps/user_ldap/lib/Command/CheckUser.php @@ -84,7 +84,7 @@ class CheckUser extends Command { throw new \Exception('The given user is not a recognized LDAP user.'); } catch (\Exception $e) { - $output->writeln('<error>' . $e->getMessage(). '</error>'); + $output->writeln('<error>' . $e->getMessage() . '</error>'); return self::FAILURE; } } diff --git a/apps/user_ldap/lib/Command/PromoteGroup.php b/apps/user_ldap/lib/Command/PromoteGroup.php index bb5362e4700..b203a910b14 100644 --- a/apps/user_ldap/lib/Command/PromoteGroup.php +++ b/apps/user_ldap/lib/Command/PromoteGroup.php @@ -22,7 +22,7 @@ class PromoteGroup extends Command { public function __construct( private IGroupManager $groupManager, - private Group_Proxy $backend + private Group_Proxy $backend, ) { parent::__construct(); } diff --git a/apps/user_ldap/lib/Command/Search.php b/apps/user_ldap/lib/Command/Search.php index 4886e0c7638..fe1b9f34988 100644 --- a/apps/user_ldap/lib/Command/Search.php +++ b/apps/user_ldap/lib/Command/Search.php @@ -106,7 +106,7 @@ class Search extends Command { $result = $proxy->$getMethod($input->getArgument('search'), $limit, $offset); foreach ($result as $id => $name) { - $line = $name . ($printID ? ' ('.$id.')' : ''); + $line = $name . ($printID ? ' (' . $id . ')' : ''); $output->writeln($line); } return self::SUCCESS; diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php index 9de180cad76..989d0bd3929 100644 --- a/apps/user_ldap/lib/Configuration.php +++ b/apps/user_ldap/lib/Configuration.php @@ -241,7 +241,7 @@ class Configuration { case 'homeFolderNamingRule': $trimmedVal = trim($val); if ($trimmedVal !== '' && !str_contains($val, 'attr:')) { - $val = 'attr:'.$trimmedVal; + $val = 'attr:' . $trimmedVal; } break; case 'ldapBase': @@ -450,7 +450,7 @@ class Configuration { $defaults = $this->getDefaults(); } return \OC::$server->getConfig()->getAppValue('user_ldap', - $this->configPrefix.$varName, + $this->configPrefix . $varName, $defaults[$varName]); } @@ -480,7 +480,7 @@ class Configuration { protected function saveValue(string $varName, string $value): bool { \OC::$server->getConfig()->setAppValue( 'user_ldap', - $this->configPrefix.$varName, + $this->configPrefix . $varName, $value ); return true; diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php index b74c964eb72..757ba2d8e8a 100644 --- a/apps/user_ldap/lib/Connection.php +++ b/apps/user_ldap/lib/Connection.php @@ -259,11 +259,11 @@ class Connection extends LDAPUtility { * @param string|null $key */ private function getCacheKey($key): string { - $prefix = 'LDAP-'.$this->configID.'-'.$this->configPrefix.'-'; + $prefix = 'LDAP-' . $this->configID . '-' . $this->configPrefix . '-'; if (is_null($key)) { return $prefix; } - return $prefix.hash('sha256', $key); + return $prefix . hash('sha256', $key); } /** @@ -410,7 +410,7 @@ class Connection extends LDAPUtility { $this->configuration->$effectiveSetting = 'auto'; $this->configuration->saveConfiguration(); $this->logger->info( - 'Illegal value for the '.$effectiveSetting.', reset to autodetect.', + 'Illegal value for the ' . $effectiveSetting . ', reset to autodetect.', ['app' => 'user_ldap'] ); } @@ -480,7 +480,7 @@ class Connection extends LDAPUtility { } $configurationOK = false; $this->logger->warning( - $errorStr.'No '.$subj.' given!', + $errorStr . 'No ' . $subj . ' given!', ['app' => 'user_ldap'] ); } @@ -494,7 +494,7 @@ class Connection extends LDAPUtility { || ($agent !== '' && $pwd === '') ) { $this->logger->warning( - $errorStr.'either no password is given for the user ' . + $errorStr . 'either no password is given for the user ' . 'agent or a password is given, but not an LDAP agent.', ['app' => 'user_ldap'] ); @@ -507,7 +507,7 @@ class Connection extends LDAPUtility { if (empty($base) && empty($baseUsers) && empty($baseGroups)) { $this->logger->warning( - $errorStr.'Not a single Base DN given.', + $errorStr . 'Not a single Base DN given.', ['app' => 'user_ldap'] ); $configurationOK = false; @@ -516,7 +516,7 @@ class Connection extends LDAPUtility { if (mb_strpos((string)$this->configuration->ldapLoginFilter, '%uid', 0, 'UTF-8') === false) { $this->logger->warning( - $errorStr.'login filter does not contain %uid place holder.', + $errorStr . 'login filter does not contain %uid place holder.', ['app' => 'user_ldap'] ); $configurationOK = false; diff --git a/apps/user_ldap/lib/Controller/ConfigAPIController.php b/apps/user_ldap/lib/Controller/ConfigAPIController.php index 978aa005559..f4f55217ef1 100644 --- a/apps/user_ldap/lib/Controller/ConfigAPIController.php +++ b/apps/user_ldap/lib/Controller/ConfigAPIController.php @@ -33,7 +33,7 @@ class ConfigAPIController extends OCSController { Manager $keyManager, private Helper $ldapHelper, private LoggerInterface $logger, - private ConnectionFactory $connectionFactory + private ConnectionFactory $connectionFactory, ) { parent::__construct( $appName, diff --git a/apps/user_ldap/lib/GroupPluginManager.php b/apps/user_ldap/lib/GroupPluginManager.php index fca9f37d092..37622a53480 100644 --- a/apps/user_ldap/lib/GroupPluginManager.php +++ b/apps/user_ldap/lib/GroupPluginManager.php @@ -41,7 +41,7 @@ class GroupPluginManager { foreach ($this->which as $action => $v) { if ((bool)($respondToActions & $action)) { $this->which[$action] = $plugin; - \OCP\Server::get(LoggerInterface::class)->debug('Registered action '.$action.' to plugin '.get_class($plugin), ['app' => 'user_ldap']); + \OCP\Server::get(LoggerInterface::class)->debug('Registered action ' . $action . ' to plugin ' . get_class($plugin), ['app' => 'user_ldap']); } } } diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php index d4d67b546d6..5fe5abf4c13 100644 --- a/apps/user_ldap/lib/Group_LDAP.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -46,7 +46,7 @@ class Group_LDAP extends ABackend implements GroupInterface, IGroupLDAP, IGetDis Access $access, GroupPluginManager $groupPluginManager, IConfig $config, - IUserManager $ncUserManager + IUserManager $ncUserManager, ) { $this->access = $access; $filter = $this->access->connection->ldapGroupFilter; @@ -454,7 +454,7 @@ class Group_LDAP extends ABackend implements GroupInterface, IGroupLDAP, IGetDis string $groupDN, string $search = '', ?int $limit = -1, - ?int $offset = 0 + ?int $offset = 0, ): array { try { $filter = $this->prepareFilterForUsersHasGidNumber($groupDN, $search); @@ -578,7 +578,7 @@ class Group_LDAP extends ABackend implements GroupInterface, IGroupLDAP, IGetDis string $groupDN, string $search = '', ?int $limit = -1, - ?int $offset = 0 + ?int $offset = 0, ): array { try { $filter = $this->prepareFilterForUsersInPrimaryGroup($groupDN, $search); @@ -603,7 +603,7 @@ class Group_LDAP extends ABackend implements GroupInterface, IGroupLDAP, IGetDis string $groupDN, string $search = '', int $limit = -1, - int $offset = 0 + int $offset = 0, ): int { try { $filter = $this->prepareFilterForUsersInPrimaryGroup($groupDN, $search); @@ -1266,7 +1266,7 @@ class Group_LDAP extends ABackend implements GroupInterface, IGroupLDAP, IGetDis // Getting dn, if false the group is not mapped $dn = $this->access->groupname2dn($gid); if (!$dn) { - throw new Exception('Could not delete unknown group '.$gid.' in LDAP backend.'); + throw new Exception('Could not delete unknown group ' . $gid . ' in LDAP backend.'); } if (!$this->groupExists($gid)) { @@ -1276,7 +1276,7 @@ class Group_LDAP extends ABackend implements GroupInterface, IGroupLDAP, IGetDis return true; } - throw new Exception('Could not delete existing group '.$gid.' in LDAP backend.'); + throw new Exception('Could not delete existing group ' . $gid . ' in LDAP backend.'); } /** diff --git a/apps/user_ldap/lib/Jobs/CleanUp.php b/apps/user_ldap/lib/Jobs/CleanUp.php index 22c878ed067..b04dc67ef49 100644 --- a/apps/user_ldap/lib/Jobs/CleanUp.php +++ b/apps/user_ldap/lib/Jobs/CleanUp.php @@ -50,7 +50,7 @@ class CleanUp extends TimedJob { public function __construct( ITimeFactory $timeFactory, User_Proxy $userBackend, - DeletedUsersIndex $dui + DeletedUsersIndex $dui, ) { parent::__construct($timeFactory); $minutes = \OC::$server->getConfig()->getSystemValue( diff --git a/apps/user_ldap/lib/LDAPProvider.php b/apps/user_ldap/lib/LDAPProvider.php index 3b1568d1748..e7c507a265f 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -37,7 +37,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { $userBackendFound = false; $groupBackendFound = false; foreach ($serverContainer->getUserManager()->getBackends() as $backend) { - $this->logger->debug('instance '.get_class($backend).' user backend.', ['app' => 'user_ldap']); + $this->logger->debug('instance ' . get_class($backend) . ' user backend.', ['app' => 'user_ldap']); if ($backend instanceof IUserLDAP) { $this->userBackend = $backend; $userBackendFound = true; @@ -45,7 +45,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { } } foreach ($serverContainer->getGroupManager()->getBackends() as $backend) { - $this->logger->debug('instance '.get_class($backend).' group backend.', ['app' => 'user_ldap']); + $this->logger->debug('instance ' . get_class($backend) . ' group backend.', ['app' => 'user_ldap']); if ($backend instanceof IGroupLDAP) { $this->groupBackend = $backend; $groupBackendFound = true; diff --git a/apps/user_ldap/lib/Proxy.php b/apps/user_ldap/lib/Proxy.php index 285427bfd4d..88a55f6462d 100644 --- a/apps/user_ldap/lib/Proxy.php +++ b/apps/user_ldap/lib/Proxy.php @@ -22,7 +22,7 @@ abstract class Proxy { public function __construct( ILDAPWrapper $ldap, - AccessFactory $accessFactory + AccessFactory $accessFactory, ) { $this->ldap = $ldap; $this->accessFactory = $accessFactory; diff --git a/apps/user_ldap/lib/Settings/Admin.php b/apps/user_ldap/lib/Settings/Admin.php index 71532846b91..8fc0915c6fe 100644 --- a/apps/user_ldap/lib/Settings/Admin.php +++ b/apps/user_ldap/lib/Settings/Admin.php @@ -55,7 +55,7 @@ class Admin implements IDelegatedSettings { } $defaults = $config->getDefaults(); foreach ($defaults as $key => $default) { - $parameters[$key.'_default'] = $default; + $parameters[$key . '_default'] = $default; } return new TemplateResponse('user_ldap', 'settings', $parameters); diff --git a/apps/user_ldap/lib/SetupChecks/LdapConnection.php b/apps/user_ldap/lib/SetupChecks/LdapConnection.php index a33dd10f063..ee8c4ddd595 100644 --- a/apps/user_ldap/lib/SetupChecks/LdapConnection.php +++ b/apps/user_ldap/lib/SetupChecks/LdapConnection.php @@ -61,7 +61,7 @@ class LdapConnection implements ISetupCheck { 'Binding failed for %n LDAP configurations: %s', count($bindFailedConfigurations), [implode(',', $bindFailedConfigurations)] - )."\n"; + ) . "\n"; } if (!empty($searchFailedConfigurations)) { $output .= $this->l10n->n( @@ -69,7 +69,7 @@ class LdapConnection implements ISetupCheck { 'Searching failed for %n LDAP configurations: %s', count($searchFailedConfigurations), [implode(',', $searchFailedConfigurations)] - )."\n"; + ) . "\n"; } if (!empty($inactiveConfigurations)) { $output .= $this->l10n->n( @@ -77,7 +77,7 @@ class LdapConnection implements ISetupCheck { 'There are %n inactive LDAP configurations: %s', count($inactiveConfigurations), [implode(',', $inactiveConfigurations)] - )."\n"; + ) . "\n"; } if (!empty($bindFailedConfigurations) || !empty($searchFailedConfigurations)) { return SetupResult::error($output); diff --git a/apps/user_ldap/lib/User/DeletedUsersIndex.php b/apps/user_ldap/lib/User/DeletedUsersIndex.php index 4b5bb26fa96..515233b3825 100644 --- a/apps/user_ldap/lib/User/DeletedUsersIndex.php +++ b/apps/user_ldap/lib/User/DeletedUsersIndex.php @@ -22,7 +22,7 @@ class DeletedUsersIndex { public function __construct( IConfig $config, UserMapping $mapping, - IManager $shareManager + IManager $shareManager, ) { $this->config = $config; $this->mapping = $mapping; diff --git a/apps/user_ldap/lib/User/Manager.php b/apps/user_ldap/lib/User/Manager.php index bf1da54823c..5d5ad8b2658 100644 --- a/apps/user_ldap/lib/User/Manager.php +++ b/apps/user_ldap/lib/User/Manager.php @@ -49,7 +49,7 @@ class Manager { Image $image, IUserManager $userManager, INotificationManager $notificationManager, - IManager $shareManager + IManager $shareManager, ) { $this->ocConfig = $ocConfig; $this->ocFilesystem = $ocFilesystem; diff --git a/apps/user_ldap/lib/User/OfflineUser.php b/apps/user_ldap/lib/User/OfflineUser.php index 24f11a5a1f9..eed715ccc1c 100644 --- a/apps/user_ldap/lib/User/OfflineUser.php +++ b/apps/user_ldap/lib/User/OfflineUser.php @@ -70,7 +70,7 @@ class OfflineUser { $ocName, IConfig $config, UserMapping $mapping, - IManager $shareManager + IManager $shareManager, ) { $this->ocName = $ocName; $this->config = $config; diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index f2a9ba49f2f..0688a843bd7 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/apps/user_ldap/lib/User/User.php @@ -201,7 +201,7 @@ class User { } //memberOf groups - $cacheKey = 'getMemberOf'.$this->getUsername(); + $cacheKey = 'getMemberOf' . $this->getUsername(); $groups = false; if (isset($ldapEntry['memberof'])) { $groups = $ldapEntry['memberof']; @@ -217,7 +217,7 @@ class User { // check for cached profile data $username = $this->getUsername(); // buffer variable, to save resource - $cacheKey = 'getUserProfile-'.$username; + $cacheKey = 'getUserProfile-' . $username; $profileCached = $this->connection->getFromCache($cacheKey); // honoring profile disabled in config.php and check if user profile was refreshed if ($this->config->getSystemValueBool('profile.enabled', true) && @@ -404,7 +404,7 @@ class User { && $path[1] === ':' && ($path[2] === '\\' || $path[2] === '/')) ) { $path = $this->config->getSystemValue('datadirectory', - \OC::$SERVERROOT.'/data') . '/' . $path; + \OC::$SERVERROOT . '/data') . '/' . $path; } //we need it to store it in the DB as well in case a user gets //deleted so we can clean up afterwards @@ -427,7 +427,7 @@ class User { } public function getMemberOfGroups() { - $cacheKey = 'getMemberOf'.$this->getUsername(); + $cacheKey = 'getMemberOf' . $this->getUsername(); $memberOfGroups = $this->connection->getFromCache($cacheKey); if (!is_null($memberOfGroups)) { return $memberOfGroups; @@ -637,7 +637,7 @@ class User { // fetch/prepare user $user = $this->userManager->get($this->uid); if (is_null($user)) { - $this->logger->error('could not get user for uid='.$this->uid.'', ['app' => 'user_ldap']); + $this->logger->error('could not get user for uid=' . $this->uid . '', ['app' => 'user_ldap']); return; } // prepare AccountManager and Account @@ -654,22 +654,22 @@ class User { $currentValue = $accountProperty->getValue(); $scope = ($accountProperty->getScope() ?: $defaultScopes[$property]); } catch (PropertyDoesNotExistException $e) { // thrown at getProperty - $this->logger->error('property does not exist: '.$property - .' for uid='.$this->uid.'', ['app' => 'user_ldap', 'exception' => $e]); + $this->logger->error('property does not exist: ' . $property + . ' for uid=' . $this->uid . '', ['app' => 'user_ldap', 'exception' => $e]); $currentValue = ''; $scope = $defaultScopes[$property]; } $verified = IAccountManager::VERIFIED; // trust the LDAP admin knew what he put there if ($currentValue !== $value) { $account->setProperty($property, $value, $scope, $verified); - $this->logger->debug('update user profile: '.$property.'='.$value - .' for uid='.$this->uid.'', ['app' => 'user_ldap']); + $this->logger->debug('update user profile: ' . $property . '=' . $value + . ' for uid=' . $this->uid . '', ['app' => 'user_ldap']); } } try { $accountManager->updateAccount($account); // may throw InvalidArgumentException } catch (\InvalidArgumentException $e) { - $this->logger->error('invalid data from LDAP: for uid='.$this->uid.'', ['app' => 'user_ldap', 'func' => 'updateProfile' + $this->logger->error('invalid data from LDAP: for uid=' . $this->uid . '', ['app' => 'user_ldap', 'func' => 'updateProfile' , 'exception' => $e]); } } @@ -735,7 +735,7 @@ class User { */ private function setOwnCloudAvatar() { if (!$this->image->valid()) { - $this->logger->error('avatar image data from LDAP invalid for '.$this->dn, ['app' => 'user_ldap']); + $this->logger->error('avatar image data from LDAP invalid for ' . $this->dn, ['app' => 'user_ldap']); return false; } @@ -743,7 +743,7 @@ class User { //make sure it is a square and not bigger than 512x512 $size = min([$this->image->width(), $this->image->height(), 512]); if (!$this->image->centerCrop($size)) { - $this->logger->error('croping image for avatar failed for '.$this->dn, ['app' => 'user_ldap']); + $this->logger->error('croping image for avatar failed for ' . $this->dn, ['app' => 'user_ldap']); return false; } @@ -845,10 +845,10 @@ class User { if (!empty($pwdGraceAuthNLimit) && count($pwdGraceUseTime) < (int)$pwdGraceAuthNLimit[0]) { //at least one more grace login available? $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true'); - header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( + header('Location: ' . \OC::$server->getURLGenerator()->linkToRouteAbsolute( 'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid])); } else { //no more grace login available - header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( + header('Location: ' . \OC::$server->getURLGenerator()->linkToRouteAbsolute( 'user_ldap.renewPassword.showLoginFormInvalidPassword', ['user' => $uid])); } exit(); @@ -856,7 +856,7 @@ class User { //handle pwdReset attribute if (!empty($pwdReset) && $pwdReset[0] === 'TRUE') { //user must change his password $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true'); - header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( + header('Location: ' . \OC::$server->getURLGenerator()->linkToRouteAbsolute( 'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid])); exit(); } @@ -868,7 +868,7 @@ class User { $pwdExpireWarningInt = (int)$pwdExpireWarning[0]; if ($pwdMaxAgeInt > 0 && $pwdExpireWarningInt > 0) { $pwdChangedTimeDt = \DateTime::createFromFormat('YmdHisZ', $pwdChangedTime[0]); - $pwdChangedTimeDt->add(new \DateInterval('PT'.$pwdMaxAgeInt.'S')); + $pwdChangedTimeDt->add(new \DateInterval('PT' . $pwdMaxAgeInt . 'S')); $currentDateTime = new \DateTime(); $secondsToExpiry = $pwdChangedTimeDt->getTimestamp() - $currentDateTime->getTimestamp(); if ($secondsToExpiry <= $pwdExpireWarningInt) { diff --git a/apps/user_ldap/lib/UserPluginManager.php b/apps/user_ldap/lib/UserPluginManager.php index ddf23ddfe3e..4a36794bca5 100644 --- a/apps/user_ldap/lib/UserPluginManager.php +++ b/apps/user_ldap/lib/UserPluginManager.php @@ -43,12 +43,12 @@ class UserPluginManager { foreach ($this->which as $action => $v) { if (is_int($action) && (bool)($respondToActions & $action)) { $this->which[$action] = $plugin; - \OCP\Server::get(LoggerInterface::class)->debug('Registered action '.$action.' to plugin '.get_class($plugin), ['app' => 'user_ldap']); + \OCP\Server::get(LoggerInterface::class)->debug('Registered action ' . $action . ' to plugin ' . get_class($plugin), ['app' => 'user_ldap']); } } if (method_exists($plugin, 'deleteUser')) { $this->which['deleteUser'] = $plugin; - \OCP\Server::get(LoggerInterface::class)->debug('Registered action deleteUser to plugin '.get_class($plugin), ['app' => 'user_ldap']); + \OCP\Server::get(LoggerInterface::class)->debug('Registered action deleteUser to plugin ' . get_class($plugin), ['app' => 'user_ldap']); } } diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php index b1065fcf7a7..e34f0fcb185 100644 --- a/apps/user_ldap/lib/User_LDAP.php +++ b/apps/user_ldap/lib/User_LDAP.php @@ -217,7 +217,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I */ public function getUsers($search = '', $limit = 10, $offset = 0) { $search = $this->access->escapeFilterPart($search, true); - $cachekey = 'getUsers-'.$search.'-'.$limit.'-'.$offset; + $cachekey = 'getUsers-' . $search . '-' . $limit . '-' . $offset; //check if users are cached, if so return $ldap_users = $this->access->connection->getFromCache($cachekey); @@ -237,7 +237,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I ]); $this->logger->debug( - 'getUsers: Options: search '.$search.' limit '.$limit.' offset '.$offset.' Filter: '.$filter, + 'getUsers: Options: search ' . $search . ' limit ' . $limit . ' offset ' . $offset . ' Filter: ' . $filter, ['app' => 'user_ldap'] ); //do the search and translate results to Nextcloud names @@ -247,7 +247,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I $limit, $offset); $ldap_users = $this->access->nextcloudUserNames($ldap_users); $this->logger->debug( - 'getUsers: '.count($ldap_users). ' Users found', + 'getUsers: ' . count($ldap_users) . ' Users found', ['app' => 'user_ldap'] ); @@ -318,7 +318,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I * @throws \Exception when connection could not be established */ public function userExists($uid) { - $userExists = $this->access->connection->getFromCache('userExists'.$uid); + $userExists = $this->access->connection->getFromCache('userExists' . $uid); if (!is_null($userExists)) { return (bool)$userExists; } @@ -326,14 +326,14 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I if (!$userExists) { $this->logger->debug( - 'No DN found for '.$uid.' on '.$this->access->connection->ldapHost, + 'No DN found for ' . $uid . ' on ' . $this->access->connection->ldapHost, ['app' => 'user_ldap'] ); - $this->access->connection->writeToCache('userExists'.$uid, false); + $this->access->connection->writeToCache('userExists' . $uid, false); return false; } - $this->access->connection->writeToCache('userExists'.$uid, true); + $this->access->connection->writeToCache('userExists' . $uid, true); return true; } @@ -367,7 +367,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I } if (!$marked) { $this->logger->notice( - 'User '.$uid . ' is not marked as deleted, not cleaning up.', + 'User ' . $uid . ' is not marked as deleted, not cleaning up.', ['app' => 'user_ldap'] ); return false; @@ -400,7 +400,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I return $this->userPluginManager->getHome($uid); } - $cacheKey = 'getHome'.$uid; + $cacheKey = 'getHome' . $uid; $path = $this->access->connection->getFromCache($cacheKey); if (!is_null($path)) { return $path; @@ -432,7 +432,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I return false; } - $cacheKey = 'getDisplayName'.$uid; + $cacheKey = 'getDisplayName' . $uid; if (!is_null($displayName = $this->access->connection->getFromCache($cacheKey))) { return $displayName; } @@ -495,7 +495,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I * @return array an array of all displayNames (value) and the corresponding uids (key) */ public function getDisplayNames($search = '', $limit = null, $offset = null) { - $cacheKey = 'getDisplayNames-'.$search.'-'.$limit.'-'.$offset; + $cacheKey = 'getDisplayNames-' . $search . '-' . $limit . '-' . $offset; if (!is_null($displayNames = $this->access->connection->getFromCache($cacheKey))) { return $displayNames; } @@ -546,7 +546,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I } $filter = $this->access->getFilterForUserCount(); - $cacheKey = 'countUsers-'.$filter; + $cacheKey = 'countUsers-' . $filter; if (!is_null($entries = $this->access->connection->getFromCache($cacheKey))) { return $entries; } diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php index fd5f12ce0cf..87f0d04f497 100644 --- a/apps/user_ldap/lib/Wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -37,7 +37,7 @@ class Wizard extends LDAPUtility { public function __construct( Configuration $configuration, ILDAPWrapper $ldap, - Access $access + Access $access, ) { parent::__construct($ldap); $this->configuration = $configuration; @@ -262,7 +262,7 @@ class Wizard extends LDAPUtility { $this->applyFind('ldap_email_attr', $winner); if ($writeLog) { $this->logger->info( - 'The mail attribute has automatically been reset, '. + 'The mail attribute has automatically been reset, ' . 'because the original value did not return any results.', ['app' => 'user_ldap'] ); @@ -402,7 +402,7 @@ class Wizard extends LDAPUtility { $filterParts = []; foreach ($obclasses as $obclass) { - $filterParts[] = 'objectclass='.$obclass; + $filterParts[] = 'objectclass=' . $obclass; } //we filter for everything //- that looks like a group and @@ -647,7 +647,7 @@ class Wizard extends LDAPUtility { $p = $setting['port']; $t = $setting['tls']; $this->logger->debug( - 'Wiz: trying port '. $p . ', TLS '. $t, + 'Wiz: trying port ' . $p . ', TLS ' . $t, ['app' => 'user_ldap'] ); //connectAndBind may throw Exception, it needs to be caught by the @@ -755,7 +755,7 @@ class Wizard extends LDAPUtility { //removes Port from Host if (is_array($hostInfo) && isset($hostInfo['port'])) { $port = $hostInfo['port']; - $host = str_replace(':'.$port, '', $host); + $host = str_replace(':' . $port, '', $host); $this->applyFind('ldap_host', $host); $this->applyFind('ldap_port', (string)$port); } @@ -824,7 +824,7 @@ class Wizard extends LDAPUtility { $errorNo = $this->ldap->errno($cr); $errorMsg = $this->ldap->error($cr); $this->logger->info( - 'Wiz: Could not search base '.$base.' Error '.$errorNo.': '.$errorMsg, + 'Wiz: Could not search base ' . $base . ' Error ' . $errorNo . ': ' . $errorMsg, ['app' => 'user_ldap'] ); return false; @@ -902,7 +902,7 @@ class Wizard extends LDAPUtility { $filterPart = '(memberof=' . ldap_escape($dn, '', LDAP_ESCAPE_FILTER) . ')'; if (isset($attrs['primaryGroupToken'])) { $pgt = $attrs['primaryGroupToken'][0]; - $primaryFilterPart = '(primaryGroupID=' . ldap_escape($pgt, '', LDAP_ESCAPE_FILTER) .')'; + $primaryFilterPart = '(primaryGroupID=' . ldap_escape($pgt, '', LDAP_ESCAPE_FILTER) . ')'; $filterPart = '(|' . $filterPart . $primaryFilterPart . ')'; } $filter .= $filterPart; @@ -1002,12 +1002,12 @@ class Wizard extends LDAPUtility { $filterLogin .= ')'; } - $filter = '(&'.$ulf.$filterLogin.')'; + $filter = '(&' . $ulf . $filterLogin . ')'; break; } $this->logger->debug( - 'Wiz: Final filter '.$filter, + 'Wiz: Final filter ' . $filter, ['app' => 'user_ldap'] ); @@ -1069,7 +1069,7 @@ class Wizard extends LDAPUtility { if ($login === true) { $this->logger->debug( - 'Wiz: Bind successful to Port '. $port . ' TLS ' . (int)$tls, + 'Wiz: Bind successful to Port ' . $port . ' TLS ' . (int)$tls, ['app' => 'user_ldap'] ); return true; @@ -1203,7 +1203,7 @@ class Wizard extends LDAPUtility { } $p = 'objectclass='; foreach ($objectclasses as $key => $value) { - $objectclasses[$key] = $p.$value; + $objectclasses[$key] = $p . $value; } $maxEntryObjC = ''; diff --git a/apps/user_ldap/templates/part.wizard-server.php b/apps/user_ldap/templates/part.wizard-server.php index 94bd59f7b96..9fb67342247 100644 --- a/apps/user_ldap/templates/part.wizard-server.php +++ b/apps/user_ldap/templates/part.wizard-server.php @@ -15,7 +15,7 @@ $sel = ' selected'; foreach ($_['serverConfigurationPrefixes'] as $prefix) { ?> <option value="<?php p($prefix); ?>"<?php p($sel); - $sel = ''; ?>><?php p($l->t('%s. Server:', [$i++])); ?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option> + $sel = ''; ?>><?php p($l->t('%s. Server:', [$i++])); ?> <?php p(' ' . $_['serverConfigurationHosts'][$prefix]); ?></option> <?php } ?> diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php index 4be24095e99..9117a9f533c 100644 --- a/apps/user_ldap/templates/settings.php +++ b/apps/user_ldap/templates/settings.php @@ -73,7 +73,7 @@ style('user_ldap', 'settings'); </ul> <?php if (!function_exists('ldap_connect')) { - print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.').'</p>'); + print_unescaped('<p class="ldapwarning">' . $l->t('<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.') . '</p>'); } ?> <?php require_once __DIR__ . '/part.wizard-server.php'; ?> diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php index 79c0f3216a2..a9eeceeb86b 100644 --- a/apps/user_ldap/tests/AccessTest.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -526,7 +526,7 @@ class AccessTest extends TestCase { $base, $fakeConnection, $fakeSearchResultResource, - $fakeLdapEntries + $fakeLdapEntries, ) { $this->connection ->expects($this->any()) diff --git a/apps/user_ldap/tests/Group_LDAPTest.php b/apps/user_ldap/tests/Group_LDAPTest.php index 58006627410..13c5d35dce4 100644 --- a/apps/user_ldap/tests/Group_LDAPTest.php +++ b/apps/user_ldap/tests/Group_LDAPTest.php @@ -1033,10 +1033,10 @@ class Group_LDAPTest extends TestCase { $this->assertTrue(str_contains($filter, $groupFilter)); } [$memberFilter] = explode('&', $filter); - if ($memberFilter === 'member='.$dn) { + if ($memberFilter === 'member=' . $dn) { return [$group1, $group2]; return []; - } elseif ($memberFilter === 'member='.$group2['dn'][0]) { + } elseif ($memberFilter === 'member=' . $group2['dn'][0]) { return [$group3]; } else { return []; diff --git a/apps/user_ldap/tests/Integration/Bootstrap.php b/apps/user_ldap/tests/Integration/Bootstrap.php index 872e06139ff..1e270aa6f8a 100644 --- a/apps/user_ldap/tests/Integration/Bootstrap.php +++ b/apps/user_ldap/tests/Integration/Bootstrap.php @@ -4,5 +4,5 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ define('CLI_TEST_RUN', true); -require_once __DIR__ . '/../../../../lib/base.php'; +require_once __DIR__ . '/../../../../lib/base.php'; require_once __DIR__ . '/setup-scripts/config.php'; diff --git a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php index f42c6d4bccd..4618179f8ab 100644 --- a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php +++ b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php @@ -77,7 +77,7 @@ class ExceptionOnLostConnection { * @throws \Exception */ public function setUp(): void { - require_once __DIR__ . '/../../../../lib/base.php'; + require_once __DIR__ . '/../../../../lib/base.php'; \OC_App::loadApps(['user_ldap']); $ch = $this->getCurl(); diff --git a/apps/user_ldap/tests/Settings/AdminTest.php b/apps/user_ldap/tests/Settings/AdminTest.php index e06563d1856..099cc09c068 100644 --- a/apps/user_ldap/tests/Settings/AdminTest.php +++ b/apps/user_ldap/tests/Settings/AdminTest.php @@ -52,7 +52,7 @@ class AdminTest extends TestCase { $config = new Configuration('', false); $defaults = $config->getDefaults(); foreach ($defaults as $key => $default) { - $parameters[$key.'_default'] = $default; + $parameters[$key . '_default'] = $default; } $expected = new TemplateResponse('user_ldap', 'settings', $parameters); diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php index aca4e2434e2..d596402d322 100644 --- a/apps/user_ldap/tests/User/UserTest.php +++ b/apps/user_ldap/tests/User/UserTest.php @@ -1110,7 +1110,7 @@ class UserTest extends \Test\TestCase { if ($base === $this->dn) { return [ [ - 'pwdchangedtime' => [(new \DateTime())->sub(new \DateInterval('P28D'))->format('Ymdhis').'Z'], + 'pwdchangedtime' => [(new \DateTime())->sub(new \DateInterval('P28D'))->format('Ymdhis') . 'Z'], 'pwdgraceusetime' => [], ], ]; @@ -1174,7 +1174,7 @@ class UserTest extends \Test\TestCase { return [ [ 'pwdpolicysubentry' => ['cn=custom,ou=policies,dc=foo,dc=bar'], - 'pwdchangedtime' => [(new \DateTime())->sub(new \DateInterval('P28D'))->format('Ymdhis').'Z'], + 'pwdchangedtime' => [(new \DateTime())->sub(new \DateInterval('P28D'))->format('Ymdhis') . 'Z'], 'pwdgraceusetime' => [], ] ]; diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index 90166beccff..f766c7f583a 100644 --- a/apps/user_ldap/tests/User_LDAPTest.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -654,7 +654,7 @@ class User_LDAPTest extends TestCase { $this->prepareMockForUserExists(); $dataDir = \OC::$server->getConfig()->getSystemValue( - 'datadirectory', \OC::$SERVERROOT.'/data'); + 'datadirectory', \OC::$SERVERROOT . '/data'); $this->connection->expects($this->any()) ->method('__get') @@ -689,7 +689,7 @@ class User_LDAPTest extends TestCase { ->willReturn('dnOfLadyOfShadows,dc=test'); $user->expects($this->any()) ->method('getHomePath') - ->willReturn($dataDir.'/susannah/'); + ->willReturn($dataDir . '/susannah/'); $this->userManager->expects($this->atLeastOnce()) ->method('get') @@ -701,7 +701,7 @@ class User_LDAPTest extends TestCase { /** @noinspection PhpUnhandledExceptionInspection */ $result = $backend->getHome('ladyofshadows'); - $this->assertEquals($dataDir.'/susannah/', $result); + $this->assertEquals($dataDir . '/susannah/', $result); } @@ -1078,11 +1078,11 @@ class User_LDAPTest extends TestCase { $this->connection->expects($this->exactly(2)) ->method('getFromCache') - ->with($this->equalTo('loginName2UserName-'.$loginName)) + ->with($this->equalTo('loginName2UserName-' . $loginName)) ->willReturnOnConsecutiveCalls(null, $username); $this->connection->expects($this->once()) ->method('writeToCache') - ->with($this->equalTo('loginName2UserName-'.$loginName), $this->equalTo($username)); + ->with($this->equalTo('loginName2UserName-' . $loginName), $this->equalTo($username)); $backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex); $user = $this->createMock(User::class); @@ -1121,11 +1121,11 @@ class User_LDAPTest extends TestCase { $this->connection->expects($this->exactly(2)) ->method('getFromCache') - ->with($this->equalTo('loginName2UserName-'.$loginName)) + ->with($this->equalTo('loginName2UserName-' . $loginName)) ->willReturnOnConsecutiveCalls(null, false); $this->connection->expects($this->once()) ->method('writeToCache') - ->with($this->equalTo('loginName2UserName-'.$loginName), false); + ->with($this->equalTo('loginName2UserName-' . $loginName), false); $this->userManager->expects($this->any()) ->method('getAttributes') @@ -1154,11 +1154,11 @@ class User_LDAPTest extends TestCase { $this->connection->expects($this->exactly(2)) ->method('getFromCache') - ->with($this->equalTo('loginName2UserName-'.$loginName)) + ->with($this->equalTo('loginName2UserName-' . $loginName)) ->willReturnOnConsecutiveCalls(null, false); $this->connection->expects($this->once()) ->method('writeToCache') - ->with($this->equalTo('loginName2UserName-'.$loginName), $this->equalTo(false)); + ->with($this->equalTo('loginName2UserName-' . $loginName), $this->equalTo(false)); $this->userManager->expects($this->any()) ->method('get') @@ -1196,7 +1196,7 @@ class User_LDAPTest extends TestCase { $this->connection->expects($this->any()) ->method('getFromCache') ->willReturnCallback(function ($uid) { - if ($uid === 'userExists'.'roland') { + if ($uid === 'userExists' . 'roland') { return true; } return null; diff --git a/apps/user_status/lib/ContactsMenu/StatusProvider.php b/apps/user_status/lib/ContactsMenu/StatusProvider.php index 023b4402fc2..6a6949b46ba 100644 --- a/apps/user_status/lib/ContactsMenu/StatusProvider.php +++ b/apps/user_status/lib/ContactsMenu/StatusProvider.php @@ -19,7 +19,9 @@ use function array_map; class StatusProvider implements IBulkProvider { - public function __construct(private StatusService $statusService) { + public function __construct( + private StatusService $statusService, + ) { } public function process(array $entries): void { diff --git a/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php b/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php index 8b639169b07..49ac93573dd 100644 --- a/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php +++ b/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php @@ -46,7 +46,7 @@ class BeforeTemplateRenderedListener implements IEventListener { ProfileManager $profileManager, IUserSession $userSession, IInitialStateService $initialState, - JSDataService $jsDataService + JSDataService $jsDataService, ) { $this->profileManager = $profileManager; $this->userSession = $userSession; diff --git a/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php b/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php index 23dec452928..6337d637896 100644 --- a/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php +++ b/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php @@ -28,9 +28,11 @@ use OCP\UserStatus\IUserStatus; * */ class OutOfOfficeStatusListener implements IEventListener { - public function __construct(private IJobList $jobsList, + public function __construct( + private IJobList $jobsList, private ITimeFactory $time, - private IManager $manager) { + private IManager $manager, + ) { } /** diff --git a/apps/user_status/lib/Listener/UserLiveStatusListener.php b/apps/user_status/lib/Listener/UserLiveStatusListener.php index ea8d995b8a3..79305a99b05 100644 --- a/apps/user_status/lib/Listener/UserLiveStatusListener.php +++ b/apps/user_status/lib/Listener/UserLiveStatusListener.php @@ -33,11 +33,13 @@ class UserLiveStatusListener implements IEventListener { private StatusService $statusService; private ITimeFactory $timeFactory; - public function __construct(UserStatusMapper $mapper, + public function __construct( + UserStatusMapper $mapper, StatusService $statusService, ITimeFactory $timeFactory, private CalendarStatusService $calendarStatusService, - private LoggerInterface $logger) { + private LoggerInterface $logger, + ) { $this->mapper = $mapper; $this->statusService = $statusService; $this->timeFactory = $timeFactory; diff --git a/apps/user_status/lib/Migration/Version1008Date20230921144701.php b/apps/user_status/lib/Migration/Version1008Date20230921144701.php index 561dfd343cf..30ebbf37b0e 100644 --- a/apps/user_status/lib/Migration/Version1008Date20230921144701.php +++ b/apps/user_status/lib/Migration/Version1008Date20230921144701.php @@ -18,7 +18,9 @@ use OCP\Migration\SimpleMigrationStep; class Version1008Date20230921144701 extends SimpleMigrationStep { - public function __construct(private IDBConnection $connection) { + public function __construct( + private IDBConnection $connection, + ) { } public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { diff --git a/apps/user_status/tests/bootstrap.php b/apps/user_status/tests/bootstrap.php index 6abfa601943..c24f86c7cbe 100644 --- a/apps/user_status/tests/bootstrap.php +++ b/apps/user_status/tests/bootstrap.php @@ -10,7 +10,7 @@ if (!defined('PHPUNIT_RUN')) { define('PHPUNIT_RUN', 1); } -require_once __DIR__.'/../../../lib/base.php'; +require_once __DIR__ . '/../../../lib/base.php'; \OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true); diff --git a/apps/weather_status/lib/Service/WeatherStatusService.php b/apps/weather_status/lib/Service/WeatherStatusService.php index 1ffb3e5cff2..9d9972e84ef 100644 --- a/apps/weather_status/lib/Service/WeatherStatusService.php +++ b/apps/weather_status/lib/Service/WeatherStatusService.php @@ -49,7 +49,7 @@ class WeatherStatusService { private IUserManager $userManager, private IAppManager $appManager, private ICacheFactory $cacheFactory, - private ?string $userId + private ?string $userId, ) { $this->version = $appManager->getAppVersion(Application::APP_ID); $this->client = $clientService->newClient(); diff --git a/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php b/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php index efc9401f44f..c78be6e4e6b 100644 --- a/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php +++ b/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php @@ -81,12 +81,12 @@ class WebhookCall extends QueuedJob { } $statusCode = $response->getStatusCode(); if ($statusCode >= 200 && $statusCode < 300) { - $this->logger->debug('Webhook returned status code '.$statusCode, ['body' => $response->getBody()]); + $this->logger->debug('Webhook returned status code ' . $statusCode, ['body' => $response->getBody()]); } else { - $this->logger->warning('Webhook(' . $webhookId . ') returned unexpected status code '.$statusCode, ['body' => $response->getBody()]); + $this->logger->warning('Webhook(' . $webhookId . ') returned unexpected status code ' . $statusCode, ['body' => $response->getBody()]); } } catch (\Exception $e) { - $this->logger->error('Webhook(' . $webhookId . ') call failed: '.$e->getMessage(), ['exception' => $e]); + $this->logger->error('Webhook(' . $webhookId . ') call failed: ' . $e->getMessage(), ['exception' => $e]); } } } diff --git a/apps/webhook_listeners/lib/Db/WebhookListener.php b/apps/webhook_listeners/lib/Db/WebhookListener.php index fd592fda169..4f226a3407c 100644 --- a/apps/webhook_listeners/lib/Db/WebhookListener.php +++ b/apps/webhook_listeners/lib/Db/WebhookListener.php @@ -118,7 +118,7 @@ class WebhookListener extends Entity implements \JsonSerializable { public function setAuthDataClear( #[\SensitiveParameter] - ?array $data + ?array $data, ): void { if ($data === null) { if ($this->getAuthMethodEnum() === AuthMethod::Header) { diff --git a/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php b/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php index c0d96891ecc..75456cc0b75 100644 --- a/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php +++ b/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php @@ -256,6 +256,6 @@ class WebhookListenerMapper extends QBMapper { } private function buildCacheKey(?string $userIdFilter): string { - return self::EVENTS_CACHE_KEY_PREFIX.'_'.($userIdFilter ?? ''); + return self::EVENTS_CACHE_KEY_PREFIX . '_' . ($userIdFilter ?? ''); } } diff --git a/apps/webhook_listeners/lib/Service/PHPMongoQuery.php b/apps/webhook_listeners/lib/Service/PHPMongoQuery.php index 43429ce9393..d2668d17644 100644 --- a/apps/webhook_listeners/lib/Service/PHPMongoQuery.php +++ b/apps/webhook_listeners/lib/Service/PHPMongoQuery.php @@ -76,7 +76,7 @@ abstract class PHPMongoQuery { */ private static function _executeQuery(array $query, array &$document, array $options = [], string $logicalOperator = '$and'): bool { if ($logicalOperator !== '$and' && (!count($query) || !isset($query[0]))) { - throw new Exception($logicalOperator.' requires nonempty array'); + throw new Exception($logicalOperator . ' requires nonempty array'); } if ($options['_debug'] && $options['_shouldLog']) { $options['logger']->debug('_executeQuery called', ['query' => $query, 'document' => $document, 'logicalOperator' => $logicalOperator]); @@ -180,7 +180,7 @@ abstract class PHPMongoQuery { return in_array($operatorValue, $v); } if (is_string($operatorValue) && preg_match('/^\/(.*?)\/([a-z]*)$/i', $operatorValue, $matches)) { - return (bool)preg_match('/'.$matches[1].'/'.$matches[2], $v); + return (bool)preg_match('/' . $matches[1] . '/' . $matches[2], $v); } return $operatorValue === $v; } @@ -303,15 +303,15 @@ abstract class PHPMongoQuery { default: if (empty($options['unknownOperatorCallback']) || !is_callable($options['unknownOperatorCallback'])) { - throw new Exception('Operator '.$operator.' is unknown'); + throw new Exception('Operator ' . $operator . ' is unknown'); } $res = call_user_func($options['unknownOperatorCallback'], $operator, $operatorValue, $element, $document); if ($res === null) { - throw new Exception('Operator '.$operator.' is unknown'); + throw new Exception('Operator ' . $operator . ' is unknown'); } if (!is_bool($res)) { - throw new Exception('Return value of unknownOperatorCallback must be boolean, actual value '.$res); + throw new Exception('Return value of unknownOperatorCallback must be boolean, actual value ' . $res); } return $res; } diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php index ca81eb828dc..e8d27c1c4ad 100644 --- a/apps/workflowengine/lib/Check/FileSystemTags.php +++ b/apps/workflowengine/lib/Check/FileSystemTags.php @@ -47,7 +47,7 @@ class FileSystemTags implements ICheck, IFileCheck { ISystemTagManager $systemTagManager, ISystemTagObjectMapper $systemTagObjectMapper, IUserSession $userSession, - IGroupManager $groupManager + IGroupManager $groupManager, ) { $this->l = $l; $this->systemTagManager = $systemTagManager; diff --git a/apps/workflowengine/lib/Controller/AWorkflowController.php b/apps/workflowengine/lib/Controller/AWorkflowController.php index a738d55dae8..6863cd12ab5 100644 --- a/apps/workflowengine/lib/Controller/AWorkflowController.php +++ b/apps/workflowengine/lib/Controller/AWorkflowController.php @@ -32,7 +32,7 @@ abstract class AWorkflowController extends OCSController { $appName, IRequest $request, Manager $manager, - LoggerInterface $logger + LoggerInterface $logger, ) { parent::__construct($appName, $request); @@ -92,7 +92,7 @@ abstract class AWorkflowController extends OCSController { array $checks, string $operation, string $entity, - array $events + array $events, ): DataResponse { $context = $this->getScopeContext(); try { @@ -121,7 +121,7 @@ abstract class AWorkflowController extends OCSController { array $checks, string $operation, string $entity, - array $events + array $events, ): DataResponse { try { $context = $this->getScopeContext(); diff --git a/apps/workflowengine/lib/Controller/UserWorkflowsController.php b/apps/workflowengine/lib/Controller/UserWorkflowsController.php index 10197a6f117..a615a280f32 100644 --- a/apps/workflowengine/lib/Controller/UserWorkflowsController.php +++ b/apps/workflowengine/lib/Controller/UserWorkflowsController.php @@ -33,7 +33,7 @@ class UserWorkflowsController extends AWorkflowController { IRequest $request, Manager $manager, IUserSession $session, - LoggerInterface $logger + LoggerInterface $logger, ) { parent::__construct($appName, $request, $manager, $logger); diff --git a/apps/workflowengine/lib/Entity/File.php b/apps/workflowengine/lib/Entity/File.php index 25cefcd9314..f9234926e4d 100644 --- a/apps/workflowengine/lib/Entity/File.php +++ b/apps/workflowengine/lib/Entity/File.php @@ -68,7 +68,7 @@ class File implements IEntity, IDisplayText, IUrl, IIcon, IContextPortation { ISystemTagManager $tagManager, IUserManager $userManager, UserMountCache $userMountCache, - IMountManager $mountManager + IMountManager $mountManager, ) { $this->l10n = $l10n; $this->urlGenerator = $urlGenerator; diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php index b51e85bdea7..f03f84a33c0 100644 --- a/apps/workflowengine/lib/Manager.php +++ b/apps/workflowengine/lib/Manager.php @@ -238,7 +238,7 @@ class Manager implements IManager { array $checkIds, string $operation, string $entity, - array $events + array $events, ): int { $query = $this->connection->getQueryBuilder(); $query->insert('flow_operations') @@ -273,7 +273,7 @@ class Manager implements IManager { string $operation, ScopeContext $scope, string $entity, - array $events + array $events, ) { $this->validateOperation($class, $name, $checks, $operation, $scope, $entity, $events); @@ -342,7 +342,7 @@ class Manager implements IManager { string $operation, ScopeContext $scopeContext, string $entity, - array $events + array $events, ): array { if (!$this->canModify($id, $scopeContext)) { throw new \DomainException('Target operation not within scope'); diff --git a/apps/workflowengine/lib/Service/Logger.php b/apps/workflowengine/lib/Service/Logger.php index 13ac36659e5..494240bc403 100644 --- a/apps/workflowengine/lib/Service/Logger.php +++ b/apps/workflowengine/lib/Service/Logger.php @@ -128,7 +128,7 @@ class Logger { protected function log( string $message, array $context, - LogContext $logContext + LogContext $logContext, ): void { if (!isset($context['app'])) { $context['app'] = Application::APP_ID; diff --git a/apps/workflowengine/lib/Service/RuleMatcher.php b/apps/workflowengine/lib/Service/RuleMatcher.php index 1712b3b2a32..46758456205 100644 --- a/apps/workflowengine/lib/Service/RuleMatcher.php +++ b/apps/workflowengine/lib/Service/RuleMatcher.php @@ -53,7 +53,7 @@ class RuleMatcher implements IRuleMatcher { IServerContainer $container, IL10N $l, Manager $manager, - Logger $logger + Logger $logger, ) { $this->session = $session; $this->manager = $manager; diff --git a/apps/workflowengine/lib/Settings/ASettings.php b/apps/workflowengine/lib/Settings/ASettings.php index 390682a2f06..8b875db043c 100644 --- a/apps/workflowengine/lib/Settings/ASettings.php +++ b/apps/workflowengine/lib/Settings/ASettings.php @@ -41,7 +41,7 @@ abstract class ASettings implements ISettings { Manager $manager, IInitialState $initialStateService, IConfig $config, - IURLGenerator $urlGenerator + IURLGenerator $urlGenerator, ) { $this->appName = $appName; $this->l10n = $l; diff --git a/build/integration/features/bootstrap/CalDavContext.php b/build/integration/features/bootstrap/CalDavContext.php index 11486bbbc97..80f8c53fc4e 100644 --- a/build/integration/features/bootstrap/CalDavContext.php +++ b/build/integration/features/bootstrap/CalDavContext.php @@ -41,7 +41,7 @@ class CalDavContext implements \Behat\Behat\Context\Context { /** @AfterScenario */ public function afterScenario() { - $davUrl = $this->baseUrl. '/remote.php/dav/calendars/admin/MyCalendar'; + $davUrl = $this->baseUrl . '/remote.php/dav/calendars/admin/MyCalendar'; try { $this->client->delete( $davUrl, @@ -266,7 +266,7 @@ class CalDavContext implements \Behat\Behat\Context\Context { * @param string $name */ public function createsACalendarNamed($user, $name) { - $davUrl = $this->baseUrl . '/remote.php/dav/calendars/'.$user.'/'.$name; + $davUrl = $this->baseUrl . '/remote.php/dav/calendars/' . $user . '/' . $name; $password = ($user === 'admin') ? 'admin' : '123456'; $this->response = $this->client->request( @@ -289,7 +289,7 @@ class CalDavContext implements \Behat\Behat\Context\Context { * @param string $name */ public function publiclySharesTheCalendarNamed($user, $name) { - $davUrl = $this->baseUrl . '/remote.php/dav/calendars/'.$user.'/'.$name; + $davUrl = $this->baseUrl . '/remote.php/dav/calendars/' . $user . '/' . $name; $password = ($user === 'admin') ? 'admin' : '123456'; $this->response = $this->client->request( diff --git a/build/integration/features/bootstrap/CardDavContext.php b/build/integration/features/bootstrap/CardDavContext.php index 36337814e2d..a59f0d56f96 100644 --- a/build/integration/features/bootstrap/CardDavContext.php +++ b/build/integration/features/bootstrap/CardDavContext.php @@ -110,7 +110,7 @@ class CardDavContext implements \Behat\Behat\Context\Context { * @throws \Exception */ public function createsAnAddressbookNamedWithStatuscode($user, $addressBook, $statusCode) { - $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/'.$user.'/'.$addressBook; + $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/' . $user . '/' . $addressBook; $password = ($user === 'admin') ? 'admin' : '123456'; $this->response = $this->client->request( @@ -123,7 +123,7 @@ class CardDavContext implements \Behat\Behat\Context\Context { <d:prop> <d:resourcetype> <d:collection />,<card:addressbook /> - </d:resourcetype>,<d:displayname>'.$addressBook.'</d:displayname> + </d:resourcetype>,<d:displayname>' . $addressBook . '</d:displayname> </d:prop> </d:set> </d:mkcol>', @@ -190,7 +190,7 @@ class CardDavContext implements \Behat\Behat\Context\Context { * @Given :user uploads the contact :fileName to the addressbook :addressbook */ public function uploadsTheContactToTheAddressbook($user, $fileName, $addressBook) { - $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/'.$user.'/'.$addressBook . '/' . $fileName; + $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/' . $user . '/' . $addressBook . '/' . $fileName; $password = ($user === 'admin') ? 'admin' : '123456'; $this->response = $this->client->request( @@ -223,7 +223,7 @@ class CardDavContext implements \Behat\Behat\Context\Context { * @When Exporting the picture of contact :fileName from addressbook :addressBook as user :user */ public function whenExportingThePictureOfContactFromAddressbookAsUser($fileName, $addressBook, $user) { - $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/'.$user.'/'.$addressBook . '/' . $fileName . '?photo=true'; + $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/' . $user . '/' . $addressBook . '/' . $fileName . '?photo=true'; $password = ($user === 'admin') ? 'admin' : '123456'; try { @@ -249,7 +249,7 @@ class CardDavContext implements \Behat\Behat\Context\Context { * @When Downloading the contact :fileName from addressbook :addressBook as user :user */ public function whenDownloadingTheContactFromAddressbookAsUser($fileName, $addressBook, $user) { - $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/'.$user.'/'.$addressBook . '/' . $fileName; + $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/' . $user . '/' . $addressBook . '/' . $fileName; $password = ($user === 'admin') ? 'admin' : '123456'; try { diff --git a/build/integration/features/bootstrap/ChecksumsContext.php b/build/integration/features/bootstrap/ChecksumsContext.php index d72e321ed7e..3392f8545d9 100644 --- a/build/integration/features/bootstrap/ChecksumsContext.php +++ b/build/integration/features/bootstrap/ChecksumsContext.php @@ -87,7 +87,7 @@ class ChecksumsContext implements \Behat\Behat\Context\Context { */ public function theWebdavResponseShouldHaveAStatusCode($statusCode) { if ((int)$statusCode !== $this->response->getStatusCode()) { - throw new \Exception("Expected $statusCode, got ".$this->response->getStatusCode()); + throw new \Exception("Expected $statusCode, got " . $this->response->getStatusCode()); } } @@ -131,7 +131,7 @@ class ChecksumsContext implements \Behat\Behat\Context\Context { $checksums = $parsed[0]['value'][1]['value'][0]['value'][0]; if ($checksums['value'][0]['value'] !== $checksum) { - throw new \Exception("Expected $checksum, got ".$checksums['value'][0]['value']); + throw new \Exception("Expected $checksum, got " . $checksums['value'][0]['value']); } } @@ -159,7 +159,7 @@ class ChecksumsContext implements \Behat\Behat\Context\Context { */ public function theHeaderChecksumShouldMatch($checksum) { if ($this->response->getHeader('OC-Checksum')[0] !== $checksum) { - throw new \Exception("Expected $checksum, got ".$this->response->getHeader('OC-Checksum')[0]); + throw new \Exception("Expected $checksum, got " . $this->response->getHeader('OC-Checksum')[0]); } } @@ -199,7 +199,7 @@ class ChecksumsContext implements \Behat\Behat\Context\Context { $status = $parsed[0]['value'][1]['value'][1]['value']; if ($status !== 'HTTP/1.1 404 Not Found') { - throw new \Exception("Expected 'HTTP/1.1 404 Not Found', got ".$status); + throw new \Exception("Expected 'HTTP/1.1 404 Not Found', got " . $status); } } @@ -208,7 +208,7 @@ class ChecksumsContext implements \Behat\Behat\Context\Context { */ public function theOcChecksumHeaderShouldNotBeThere() { if ($this->response->hasHeader('OC-Checksum')) { - throw new \Exception('Expected no checksum header but got '.$this->response->getHeader('OC-Checksum')[0]); + throw new \Exception('Expected no checksum header but got ' . $this->response->getHeader('OC-Checksum')[0]); } } } diff --git a/build/integration/features/bootstrap/FakeSMTPHelper.php b/build/integration/features/bootstrap/FakeSMTPHelper.php index 2d90494b82c..caf2139faab 100644 --- a/build/integration/features/bootstrap/FakeSMTPHelper.php +++ b/build/integration/features/bootstrap/FakeSMTPHelper.php @@ -34,7 +34,7 @@ class fakeSMTP { $hasValidTo = false; $receivingData = false; $header = true; - $this->reply('220 '.$this->serverHello); + $this->reply('220 ' . $this->serverHello); $this->mail['ipaddress'] = $this->detectIP(); while ($data = fgets($this->fd)) { $data = preg_replace('@\r\n@', "\n", $data); @@ -60,7 +60,7 @@ class fakeSMTP { $this->reply('250 2.1.5 Ok'); $hasValidTo = true; } else { - $this->reply('501 5.1.3 Bad recipient address syntax '.$match[1]); + $this->reply('501 5.1.3 Bad recipient address syntax ' . $match[1]); } } } elseif (!$receivingData && preg_match('/^RSET$/i', trim($data))) { @@ -70,7 +70,7 @@ class fakeSMTP { } elseif (!$receivingData && preg_match('/^NOOP$/i', trim($data))) { $this->reply('250 2.0.0 Ok'); } elseif (!$receivingData && preg_match('/^VRFY (.*)/i', trim($data), $match)) { - $this->reply('250 2.0.0 '.$match[1]); + $this->reply('250 2.0.0 ' . $match[1]); } elseif (!$receivingData && preg_match('/^DATA/i', trim($data))) { if (!$hasValidTo) { $this->reply('503 5.5.1 Error: need RCPT command'); @@ -79,7 +79,7 @@ class fakeSMTP { $receivingData = true; } } elseif (!$receivingData && preg_match('/^(HELO|EHLO)/i', $data)) { - $this->reply('250 HELO '.$this->mail['ipaddress']); + $this->reply('250 HELO ' . $this->mail['ipaddress']); } elseif (!$receivingData && preg_match('/^QUIT/i', trim($data))) { break; } elseif (!$receivingData) { @@ -88,7 +88,7 @@ class fakeSMTP { } elseif ($receivingData && $data == ".\n") { /* Email Received, now let's look at it */ $receivingData = false; - $this->reply('250 2.0.0 Ok: queued as '.$this->generateRandom(10)); + $this->reply('250 2.0.0 Ok: queued as ' . $this->generateRandom(10)); $splitmail = explode("\n\n", $this->mail['rawEmail'], 2); if (count($splitmail) == 2) { $this->mail['emailHeaders'] = $splitmail[0]; @@ -109,14 +109,14 @@ class fakeSMTP { } } /* Say good bye */ - $this->reply('221 2.0.0 Bye '.$this->mail['ipaddress']); + $this->reply('221 2.0.0 Bye ' . $this->mail['ipaddress']); fclose($this->fd); } public function log($s) { if ($this->logFile) { - file_put_contents($this->logFile, trim($s)."\n", FILE_APPEND); + file_put_contents($this->logFile, trim($s) . "\n", FILE_APPEND); } } diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 803099c9c59..6c0c1767e73 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -74,7 +74,7 @@ trait WebDav { } elseif ($type === 'uploads') { $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . "$path"; } else { - $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . '/' . $type . "$path"; + $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . '/' . $type . "$path"; } $client = new GClient(); $options = [ @@ -197,7 +197,7 @@ trait WebDav { */ public function checkPropForFile($file, $prefix, $prop, $value) { $elementList = $this->propfindFile($this->currentUser, $file, "<$prefix:$prop/>"); - $property = $elementList['/'.$this->getDavFilesPath($this->currentUser).$file][200]["{DAV:}$prop"]; + $property = $elementList['/' . $this->getDavFilesPath($this->currentUser) . $file][200]["{DAV:}$prop"]; Assert::assertEquals($property, $value); } @@ -563,7 +563,7 @@ trait WebDav { if ($type === 'files') { return $this->encodePath($this->getDavFilesPath($user) . $path); } else { - return $this->encodePath($this->davPath . '/' . $type . '/' . $user . '/' . $path); + return $this->encodePath($this->davPath . '/' . $type . '/' . $user . '/' . $path); } } @@ -705,28 +705,28 @@ trait WebDav { $boundary = 'boundary_azertyuiop'; $body = ''; - $body .= '--'.$boundary."\r\n"; - $body .= 'X-File-Path: '.$name1."\r\n"; + $body .= '--' . $boundary . "\r\n"; + $body .= 'X-File-Path: ' . $name1 . "\r\n"; $body .= "X-File-MD5: f6a6263167c92de8644ac998b3c4e4d1\r\n"; $body .= "X-OC-Mtime: 1111111111\r\n"; - $body .= 'Content-Length: '.strlen($content1)."\r\n"; + $body .= 'Content-Length: ' . strlen($content1) . "\r\n"; $body .= "\r\n"; - $body .= $content1."\r\n"; - $body .= '--'.$boundary."\r\n"; - $body .= 'X-File-Path: '.$name2."\r\n"; + $body .= $content1 . "\r\n"; + $body .= '--' . $boundary . "\r\n"; + $body .= 'X-File-Path: ' . $name2 . "\r\n"; $body .= "X-File-MD5: 87c7d4068be07d390a1fffd21bf1e944\r\n"; $body .= "X-OC-Mtime: 2222222222\r\n"; - $body .= 'Content-Length: '.strlen($content2)."\r\n"; + $body .= 'Content-Length: ' . strlen($content2) . "\r\n"; $body .= "\r\n"; - $body .= $content2."\r\n"; - $body .= '--'.$boundary."\r\n"; - $body .= 'X-File-Path: '.$name3."\r\n"; + $body .= $content2 . "\r\n"; + $body .= '--' . $boundary . "\r\n"; + $body .= 'X-File-Path: ' . $name3 . "\r\n"; $body .= "X-File-MD5: e86a1cf0678099986a901c79086f5617\r\n"; $body .= "X-File-Mtime: 3333333333\r\n"; - $body .= 'Content-Length: '.strlen($content3)."\r\n"; + $body .= 'Content-Length: ' . strlen($content3) . "\r\n"; $body .= "\r\n"; - $body .= $content3."\r\n"; - $body .= '--'.$boundary."--\r\n"; + $body .= $content3 . "\r\n"; + $body .= '--' . $boundary . "--\r\n"; $stream = fopen('php://temp', 'r+'); fwrite($stream, $body); @@ -736,7 +736,7 @@ trait WebDav { $options = [ 'auth' => [$user, $this->regularUser], 'headers' => [ - 'Content-Type' => 'multipart/related; boundary='.$boundary, + 'Content-Type' => 'multipart/related; boundary=' . $boundary, 'Content-Length' => (string)strlen($body), ], 'body' => $body diff --git a/build/license.php b/build/license.php index 6737caa8eec..b21f5b263fc 100644 --- a/build/license.php +++ b/build/license.php @@ -119,10 +119,10 @@ With help from many libraries and frameworks including: … '; $authors = implode(PHP_EOL, array_map(function ($author) { - return ' - '.$author; + return ' - ' . $author; }, $this->authors)); $template = str_replace('@AUTHORS@', $authors, $template); - file_put_contents(__DIR__.'/../AUTHORS', $template); + file_put_contents(__DIR__ . '/../AUTHORS', $template); } public function handleFile($path, $gitRoot) { @@ -422,7 +422,7 @@ With help from many libraries and frameworks including: private function fixInvalidEmail($author) { preg_match('/<(.*)>/', $author, $mailMatch); if (count($mailMatch) === 2 && !filter_var($mailMatch[1], FILTER_VALIDATE_EMAIL)) { - $author = str_replace('<'.$mailMatch[1].'>', '"'.$mailMatch[1].'"', $author); + $author = str_replace('<' . $mailMatch[1] . '>', '"' . $mailMatch[1] . '"', $author); } return $author; } diff --git a/core/Command/Background/JobBase.php b/core/Command/Background/JobBase.php index 7229d7589ee..d92bb77d4b6 100644 --- a/core/Command/Background/JobBase.php +++ b/core/Command/Background/JobBase.php @@ -19,7 +19,7 @@ abstract class JobBase extends \OC\Core\Command\Base { public function __construct( protected IJobList $jobList, - protected LoggerInterface $logger + protected LoggerInterface $logger, ) { parent::__construct(); } diff --git a/core/Command/Background/ListCommand.php b/core/Command/Background/ListCommand.php index 005f0418579..c8efbfef5c7 100644 --- a/core/Command/Background/ListCommand.php +++ b/core/Command/Background/ListCommand.php @@ -53,7 +53,7 @@ class ListCommand extends Base { $jobsInfo = $this->formatJobs($this->jobList->getJobsIterator($input->getOption('class'), $limit, (int)$input->getOption('offset'))); $this->writeTableInOutputFormat($input, $output, $jobsInfo); if ($input->getOption('output') === self::OUTPUT_FORMAT_PLAIN && count($jobsInfo) >= $limit) { - $output->writeln("\n<comment>Output is currently limited to " . $limit . ' jobs. Specify `-l, --limit[=LIMIT]` to override.</comment>'); + $output->writeln("\n<comment>Output is currently limited to " . $limit . ' jobs. Specify `-l, --limit[=LIMIT]` to override.</comment>'); } return 0; } diff --git a/core/Command/Config/Import.php b/core/Command/Config/Import.php index 9974b11e19c..b58abec3390 100644 --- a/core/Command/Config/Import.php +++ b/core/Command/Config/Import.php @@ -49,7 +49,7 @@ class Import extends Command implements CompletionAwareInterface { try { $configs = $this->validateFileContent($content); } catch (\UnexpectedValueException $e) { - $output->writeln('<error>' . $e->getMessage(). '</error>'); + $output->writeln('<error>' . $e->getMessage() . '</error>'); return 1; } diff --git a/core/Command/Db/ConvertType.php b/core/Command/Db/ConvertType.php index 031d5a83d12..43b2d62a900 100644 --- a/core/Command/Db/ConvertType.php +++ b/core/Command/Db/ConvertType.php @@ -215,7 +215,7 @@ class ConvertType extends Command implements CompletionAwareInterface { $apps = $input->getOption('all-apps') ? \OC_App::getAllApps() : \OC_App::getEnabledApps(); foreach ($apps as $app) { - $output->writeln('<info> - '.$app.'</info>'); + $output->writeln('<info> - ' . $app . '</info>'); // Make sure autoloading works... \OC_App::loadApp($app); $fromMS = new MigrationService($app, $fromDB); @@ -404,7 +404,7 @@ class ConvertType extends Command implements CompletionAwareInterface { try { // copy table rows foreach ($tables as $table) { - $output->writeln('<info> - '.$table.'</info>'); + $output->writeln('<info> - ' . $table . '</info>'); $this->copyTable($fromDB, $toDB, $schema->getTable($table), $input, $output); } if ($input->getArgument('type') === 'pgsql') { @@ -427,7 +427,7 @@ class ConvertType extends Command implements CompletionAwareInterface { $dbName = $input->getArgument('database'); $password = $input->getOption('password'); if ($input->getOption('port')) { - $dbHost .= ':'.$input->getOption('port'); + $dbHost .= ':' . $input->getOption('port'); } $this->config->setSystemValues([ diff --git a/core/Command/Info/File.php b/core/Command/Info/File.php index 76fbd38712c..2a557b6768e 100644 --- a/core/Command/Info/File.php +++ b/core/Command/Info/File.php @@ -33,7 +33,7 @@ class File extends Command { public function __construct( IFactory $l10nFactory, private FileUtils $fileUtils, - private \OC\Encryption\Util $encryptionUtil + private \OC\Encryption\Util $encryptionUtil, ) { $this->l10n = $l10nFactory->get('core'); parent::__construct(); @@ -85,7 +85,7 @@ class File extends Command { return $node->getSize(); }, $children)); if ($childSize != $node->getSize()) { - $output->writeln(' <error>warning: folder has a size of ' . Util::humanFileSize($node->getSize()) ." but it's children sum up to " . Util::humanFileSize($childSize) . '</error>.'); + $output->writeln(' <error>warning: folder has a size of ' . Util::humanFileSize($node->getSize()) . " but it's children sum up to " . Util::humanFileSize($childSize) . '</error>.'); $output->writeln(' Run <info>occ files:scan --path ' . $node->getPath() . '</info> to attempt to resolve this.'); } if ($showChildren) { @@ -164,10 +164,10 @@ class File extends Command { } if ($input->getOption('storage-tree')) { $storageTmp = $storage; - $storageClass = get_class($storageTmp).' (cache:'.get_class($storageTmp->getCache()).')'; + $storageClass = get_class($storageTmp) . ' (cache:' . get_class($storageTmp->getCache()) . ')'; while ($storageTmp instanceof \OC\Files\Storage\Wrapper\Wrapper) { $storageTmp = $storageTmp->getWrapperStorage(); - $storageClass .= "\n\t".'> '.get_class($storageTmp).' (cache:'.get_class($storageTmp->getCache()).')'; + $storageClass .= "\n\t" . '> ' . get_class($storageTmp) . ' (cache:' . get_class($storageTmp->getCache()) . ')'; } $output->writeln(' storage wrapping: ' . $storageClass); } diff --git a/core/Command/Integrity/SignApp.php b/core/Command/Integrity/SignApp.php index 6df84662388..d307bc58985 100644 --- a/core/Command/Integrity/SignApp.php +++ b/core/Command/Integrity/SignApp.php @@ -51,7 +51,7 @@ class SignApp extends Command { $documentationUrl = $this->urlGenerator->linkToDocs('developer-code-integrity'); $output->writeln('This command requires the --path, --privateKey and --certificate.'); $output->writeln('Example: ./occ integrity:sign-app --path="/Users/lukasreschke/Programming/myapp/" --privateKey="/Users/lukasreschke/private/myapp.key" --certificate="/Users/lukasreschke/public/mycert.crt"'); - $output->writeln('For more information please consult the documentation: '. $documentationUrl); + $output->writeln('For more information please consult the documentation: ' . $documentationUrl); return 1; } @@ -75,7 +75,7 @@ class SignApp extends Command { $x509->setPrivateKey($rsa); try { $this->checker->writeAppSignature($path, $x509, $rsa); - $output->writeln('Successfully signed "'.$path.'"'); + $output->writeln('Successfully signed "' . $path . '"'); } catch (\Exception $e) { $output->writeln('Error: ' . $e->getMessage()); return 1; diff --git a/core/Command/L10n/CreateJs.php b/core/Command/L10n/CreateJs.php index 7d45fbe91f8..64a21e6d48c 100644 --- a/core/Command/L10n/CreateJs.php +++ b/core/Command/L10n/CreateJs.php @@ -153,7 +153,7 @@ class CreateJs extends Command implements CompletionAwareInterface { $appName = $context->getWordAtIndex($context->getWordIndex() - 1); try { return $this->getAllLanguages($this->appManager->getAppPath($appName)); - } catch(AppPathNotFoundException) { + } catch (AppPathNotFoundException) { return []; } } diff --git a/core/Command/Log/File.php b/core/Command/Log/File.php index e04d19f51cf..8b4a38db611 100644 --- a/core/Command/Log/File.php +++ b/core/Command/Log/File.php @@ -79,11 +79,11 @@ class File extends Command implements Completion\CompletionAwareInterface { } else { $enabledText = 'disabled'; } - $output->writeln('Log backend file: '.$enabledText); + $output->writeln('Log backend file: ' . $enabledText); - $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data'); - $defaultLogFile = rtrim($dataDir, '/').'/nextcloud.log'; - $output->writeln('Log file: '.$this->config->getSystemValue('logfile', $defaultLogFile)); + $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); + $defaultLogFile = rtrim($dataDir, '/') . '/nextcloud.log'; + $output->writeln('Log file: ' . $this->config->getSystemValue('logfile', $defaultLogFile)); $rotateSize = $this->config->getSystemValue('log_rotate_size', 100 * 1024 * 1024); if ($rotateSize) { @@ -91,7 +91,7 @@ class File extends Command implements Completion\CompletionAwareInterface { } else { $rotateString = 'disabled'; } - $output->writeln('Rotate at: '.$rotateString); + $output->writeln('Rotate at: ' . $rotateString); return 0; } diff --git a/core/Command/Log/Manage.php b/core/Command/Log/Manage.php index e68720a1280..f67f0d969f6 100644 --- a/core/Command/Log/Manage.php +++ b/core/Command/Log/Manage.php @@ -84,14 +84,14 @@ class Manage extends Command implements CompletionAwareInterface { // display configuration $backend = $this->config->getSystemValue('log_type', self::DEFAULT_BACKEND); - $output->writeln('Enabled logging backend: '.$backend); + $output->writeln('Enabled logging backend: ' . $backend); $levelNum = $this->config->getSystemValue('loglevel', self::DEFAULT_LOG_LEVEL); $level = $this->convertLevelNumber($levelNum); - $output->writeln('Log level: '.$level.' ('.$levelNum.')'); + $output->writeln('Log level: ' . $level . ' (' . $levelNum . ')'); $timezone = $this->config->getSystemValue('logtimezone', self::DEFAULT_TIMEZONE); - $output->writeln('Log timezone: '.$timezone); + $output->writeln('Log timezone: ' . $timezone); return 0; } @@ -100,7 +100,7 @@ class Manage extends Command implements CompletionAwareInterface { * @throws \InvalidArgumentException */ protected function validateBackend($backend) { - if (!class_exists('OC\\Log\\'.ucfirst($backend))) { + if (!class_exists('OC\\Log\\' . ucfirst($backend))) { throw new \InvalidArgumentException('Invalid backend'); } } diff --git a/core/Command/Maintenance/Install.php b/core/Command/Maintenance/Install.php index a954beb406d..31f6d1cd79d 100644 --- a/core/Command/Maintenance/Install.php +++ b/core/Command/Maintenance/Install.php @@ -46,7 +46,7 @@ class Install extends Command { ->addOption('admin-user', null, InputOption::VALUE_REQUIRED, 'Login of the admin account', 'admin') ->addOption('admin-pass', null, InputOption::VALUE_REQUIRED, 'Password of the admin account') ->addOption('admin-email', null, InputOption::VALUE_OPTIONAL, 'E-Mail of the admin account') - ->addOption('data-dir', null, InputOption::VALUE_REQUIRED, 'Path to data directory', \OC::$SERVERROOT.'/data'); + ->addOption('data-dir', null, InputOption::VALUE_REQUIRED, 'Path to data directory', \OC::$SERVERROOT . '/data'); } protected function execute(InputInterface $input, OutputInterface $output): int { @@ -134,7 +134,7 @@ class Install extends Command { if (is_null($dbPass)) { /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); - $question = new Question('What is the password to access the database with user <'.$dbUser.'>?'); + $question = new Question('What is the password to access the database with user <' . $dbUser . '>?'); $question->setHidden(true); $question->setHiddenFallback(false); $dbPass = $helper->ask($input, $output, $question); @@ -144,7 +144,7 @@ class Install extends Command { if (is_null($adminPassword)) { /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); - $question = new Question('What is the password you like to use for the admin account <'.$adminLogin.'>?'); + $question = new Question('What is the password you like to use for the admin account <' . $adminLogin . '>?'); $question->setHidden(true); $question->setHiddenFallback(false); $adminPassword = $helper->ask($input, $output, $question); diff --git a/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php b/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php index 1a6c3933461..283809a9031 100644 --- a/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php +++ b/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php @@ -22,7 +22,7 @@ class GenerateMimetypeFileBuilder { }, ARRAY_FILTER_USE_KEY); // Fetch all files - $dir = new \DirectoryIterator(\OC::$SERVERROOT.'/core/img/filetypes'); + $dir = new \DirectoryIterator(\OC::$SERVERROOT . '/core/img/filetypes'); $files = []; foreach ($dir as $fileInfo) { @@ -38,7 +38,7 @@ class GenerateMimetypeFileBuilder { // Fetch all themes! $themes = []; - $dirs = new \DirectoryIterator(\OC::$SERVERROOT.'/themes/'); + $dirs = new \DirectoryIterator(\OC::$SERVERROOT . '/themes/'); foreach ($dirs as $dir) { //Valid theme dir if ($dir->isFile() || $dir->isDot()) { diff --git a/core/Command/Maintenance/Mimetype/UpdateDB.php b/core/Command/Maintenance/Mimetype/UpdateDB.php index fd448cf862a..9ba535ef658 100644 --- a/core/Command/Maintenance/Mimetype/UpdateDB.php +++ b/core/Command/Maintenance/Mimetype/UpdateDB.php @@ -55,21 +55,21 @@ class UpdateDB extends Command { $mimetypeId = $this->mimetypeLoader->getId($mimetype); if (!$existing) { - $output->writeln('Added mimetype "'.$mimetype.'" to database'); + $output->writeln('Added mimetype "' . $mimetype . '" to database'); $totalNewMimetypes++; } if (!$existing || $input->getOption('repair-filecache')) { $touchedFilecacheRows = $this->mimetypeLoader->updateFilecache($ext, $mimetypeId); if ($touchedFilecacheRows > 0) { - $output->writeln('Updated '.$touchedFilecacheRows.' filecache rows for mimetype "'.$mimetype.'"'); + $output->writeln('Updated ' . $touchedFilecacheRows . ' filecache rows for mimetype "' . $mimetype . '"'); } $totalFilecacheUpdates += $touchedFilecacheRows; } } - $output->writeln('Added '.$totalNewMimetypes.' new mimetypes'); - $output->writeln('Updated '.$totalFilecacheUpdates.' filecache rows'); + $output->writeln('Added ' . $totalNewMimetypes . ' new mimetypes'); + $output->writeln('Updated ' . $totalFilecacheUpdates . ' filecache rows'); return 0; } } diff --git a/core/Command/Maintenance/Mimetype/UpdateJS.php b/core/Command/Maintenance/Mimetype/UpdateJS.php index a1559024f2e..35633f16355 100644 --- a/core/Command/Maintenance/Mimetype/UpdateJS.php +++ b/core/Command/Maintenance/Mimetype/UpdateJS.php @@ -32,7 +32,7 @@ class UpdateJS extends Command { // Output the JS $generatedMimetypeFile = new GenerateMimetypeFileBuilder(); - file_put_contents(\OC::$SERVERROOT.'/core/js/mimetypelist.js', $generatedMimetypeFile->generateFile($aliases)); + file_put_contents(\OC::$SERVERROOT . '/core/js/mimetypelist.js', $generatedMimetypeFile->generateFile($aliases)); $output->writeln('<info>mimetypelist.js is updated'); return 0; diff --git a/core/Command/SetupChecks.php b/core/Command/SetupChecks.php index fda463b8f6d..60517e224b3 100644 --- a/core/Command/SetupChecks.php +++ b/core/Command/SetupChecks.php @@ -61,11 +61,11 @@ class SetupChecks extends Base { $description = $this->richTextFormatter->richToParsed($description, $descriptionParameters); } $output->writeln( - "\t\t". - ($styleTag !== null ? "<{$styleTag}>" : ''). - "{$emoji} ". - ($check->getName() ?? $check::class). - ($description !== null ? ': '.$description : ''). + "\t\t" . + ($styleTag !== null ? "<{$styleTag}>" : '') . + "{$emoji} " . + ($check->getName() ?? $check::class) . + ($description !== null ? ': ' . $description : '') . ($styleTag !== null ? "</{$styleTag}>" : ''), $verbosity ); diff --git a/core/Command/SystemTag/Add.php b/core/Command/SystemTag/Add.php index 9d8f7ae05e4..92ed42c37bc 100644 --- a/core/Command/SystemTag/Add.php +++ b/core/Command/SystemTag/Add.php @@ -73,7 +73,7 @@ class Add extends Base { ]); return 0; } catch (TagAlreadyExistsException $e) { - $output->writeln('<error>'.$e->getMessage().'</error>'); + $output->writeln('<error>' . $e->getMessage() . '</error>'); return 2; } } diff --git a/core/Command/SystemTag/Edit.php b/core/Command/SystemTag/Edit.php index 7ac74cbc53a..eb6412b7639 100644 --- a/core/Command/SystemTag/Edit.php +++ b/core/Command/SystemTag/Edit.php @@ -82,13 +82,13 @@ class Edit extends Base { try { $this->systemTagManager->updateTag($input->getArgument('id'), $name, $userVisible, $userAssignable); - $output->writeln('<info>Tag updated ("' . $name . '", '. $userVisible . ', ' . $userAssignable . ')</info>'); + $output->writeln('<info>Tag updated ("' . $name . '", ' . $userVisible . ', ' . $userAssignable . ')</info>'); return 0; } catch (TagNotFoundException $e) { $output->writeln('<error>Tag not found</error>'); return 1; } catch (TagAlreadyExistsException $e) { - $output->writeln('<error>'.$e->getMessage().'</error>'); + $output->writeln('<error>' . $e->getMessage() . '</error>'); return 2; } } diff --git a/core/Command/Upgrade.php b/core/Command/Upgrade.php index 7b1526766f3..a9ed4cf2fd1 100644 --- a/core/Command/Upgrade.php +++ b/core/Command/Upgrade.php @@ -35,7 +35,7 @@ class Upgrade extends Command { public const ERROR_FAILURE = 5; public function __construct( - private IConfig $config + private IConfig $config, ) { parent::__construct(); } diff --git a/core/Command/User/AuthTokens/Add.php b/core/Command/User/AuthTokens/Add.php index 43386b7709a..ad4bf732bd0 100644 --- a/core/Command/User/AuthTokens/Add.php +++ b/core/Command/User/AuthTokens/Add.php @@ -81,7 +81,7 @@ class Add extends Command { $output->writeln('<info>No password provided. The generated app password will therefore have limited capabilities. Any operation that requires the login password will fail.</info>'); } - $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $generatedToken = $this->tokenProvider->generateToken( $token, $user->getUID(), diff --git a/core/Command/User/SyncAccountDataCommand.php b/core/Command/User/SyncAccountDataCommand.php index e8fcccdaa28..640b66581e1 100644 --- a/core/Command/User/SyncAccountDataCommand.php +++ b/core/Command/User/SyncAccountDataCommand.php @@ -21,7 +21,7 @@ class SyncAccountDataCommand extends Base { public function __construct( IUserManager $userManager, - IAccountManager $accountManager + IAccountManager $accountManager, ) { $this->userManager = $userManager; $this->accountManager = $accountManager; diff --git a/core/Command/User/Welcome.php b/core/Command/User/Welcome.php index ba1c88a26c5..c383811f982 100644 --- a/core/Command/User/Welcome.php +++ b/core/Command/User/Welcome.php @@ -27,7 +27,7 @@ class Welcome extends Base { */ public function __construct( IUserManager $userManager, - NewUserMailHelper $newUserMailHelper + NewUserMailHelper $newUserMailHelper, ) { parent::__construct(); diff --git a/core/Controller/AppPasswordController.php b/core/Controller/AppPasswordController.php index 7cab4c5380b..b43f0077507 100644 --- a/core/Controller/AppPasswordController.php +++ b/core/Controller/AppPasswordController.php @@ -78,7 +78,7 @@ class AppPasswordController extends \OCP\AppFramework\OCSController { $userAgent = $this->request->getHeader('USER_AGENT'); - $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $generatedToken = $this->tokenProvider->generateToken( $token, @@ -149,7 +149,7 @@ class AppPasswordController extends \OCP\AppFramework\OCSController { throw new OCSForbiddenException('could not rotate apptoken'); } - $newToken = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $newToken = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $this->tokenProvider->rotate($token, $appPassword, $newToken); return new DataResponse([ diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php index a7205abc0fc..93eec8921fe 100644 --- a/core/Controller/ClientFlowLoginController.php +++ b/core/Controller/ClientFlowLoginController.php @@ -118,7 +118,7 @@ class ClientFlowLoginController extends Controller { $stateToken = $this->random->generate( 64, - ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS ); $this->session->set(self::STATE_NAME, $stateToken); @@ -247,7 +247,7 @@ class ClientFlowLoginController extends Controller { $clientName = $client->getName(); } - $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $uid = $this->userSession->getUser()->getUID(); $generatedToken = $this->tokenProvider->generateToken( $token, @@ -260,7 +260,7 @@ class ClientFlowLoginController extends Controller { ); if ($client) { - $code = $this->random->generate(128, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $code = $this->random->generate(128, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $accessToken = new AccessToken(); $accessToken->setClientId($client->getId()); $accessToken->setEncryptedToken($this->crypto->encrypt($token, $code)); diff --git a/core/Controller/ClientFlowLoginV2Controller.php b/core/Controller/ClientFlowLoginV2Controller.php index e6e1c282d2b..43eac012be1 100644 --- a/core/Controller/ClientFlowLoginV2Controller.php +++ b/core/Controller/ClientFlowLoginV2Controller.php @@ -110,7 +110,7 @@ class ClientFlowLoginV2Controller extends Controller { $stateToken = $this->random->generate( 64, - ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS ); $this->session->set(self::STATE_NAME, $stateToken); diff --git a/core/Controller/CssController.php b/core/Controller/CssController.php index 345b70fe2d3..37e7edc530f 100644 --- a/core/Controller/CssController.php +++ b/core/Controller/CssController.php @@ -65,11 +65,11 @@ class CssController extends Controller { } $ttl = 31536000; - $response->addHeader('Cache-Control', 'max-age='.$ttl.', immutable'); + $response->addHeader('Cache-Control', 'max-age=' . $ttl . ', immutable'); $expires = new \DateTime(); $expires->setTimestamp($this->timeFactory->getTime()); - $expires->add(new \DateInterval('PT'.$ttl.'S')); + $expires->add(new \DateInterval('PT' . $ttl . 'S')); $response->addHeader('Expires', $expires->format(\DateTime::RFC1123)); return $response; } diff --git a/core/Controller/JsController.php b/core/Controller/JsController.php index f5fe381688d..5754c554e50 100644 --- a/core/Controller/JsController.php +++ b/core/Controller/JsController.php @@ -65,11 +65,11 @@ class JsController extends Controller { } $ttl = 31536000; - $response->addHeader('Cache-Control', 'max-age='.$ttl.', immutable'); + $response->addHeader('Cache-Control', 'max-age=' . $ttl . ', immutable'); $expires = new \DateTime(); $expires->setTimestamp($this->timeFactory->getTime()); - $expires->add(new \DateInterval('PT'.$ttl.'S')); + $expires->add(new \DateInterval('PT' . $ttl . 'S')); $response->addHeader('Expires', $expires->format(\DateTime::RFC1123)); return $response; } diff --git a/core/Controller/OCMController.php b/core/Controller/OCMController.php index d79b5b1669e..b53dc08fecf 100644 --- a/core/Controller/OCMController.php +++ b/core/Controller/OCMController.php @@ -32,7 +32,7 @@ class OCMController extends Controller { public function __construct( IRequest $request, private IConfig $config, - private LoggerInterface $logger + private LoggerInterface $logger, ) { parent::__construct('core', $request); } diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php index e5f92eed1a9..eb78d74dd4e 100644 --- a/core/Controller/SetupController.php +++ b/core/Controller/SetupController.php @@ -18,7 +18,7 @@ class SetupController { protected Setup $setupHelper, protected LoggerInterface $logger, ) { - $this->autoConfigFile = \OC::$configDir.'autoconfig.php'; + $this->autoConfigFile = \OC::$configDir . 'autoconfig.php'; } public function run(array $post): void { diff --git a/core/Controller/TaskProcessingApiController.php b/core/Controller/TaskProcessingApiController.php index b459143aa7e..cc685d34bf0 100644 --- a/core/Controller/TaskProcessingApiController.php +++ b/core/Controller/TaskProcessingApiController.php @@ -121,7 +121,7 @@ class TaskProcessingApiController extends \OCP\AppFramework\OCSController { #[ApiRoute(verb: 'POST', url: '/schedule', root: '/taskprocessing')] public function schedule( array $input, string $type, string $appId, string $customId = '', - ?string $webhookUri = null, ?string $webhookMethod = null + ?string $webhookUri = null, ?string $webhookMethod = null, ): DataResponse { $task = new Task($type, $input, $appId, $this->userId, $customId); $task->setWebhookUri($webhookUri); diff --git a/core/Listener/BeforeMessageLoggedEventListener.php b/core/Listener/BeforeMessageLoggedEventListener.php index ef771ca0a81..9010f7755eb 100644 --- a/core/Listener/BeforeMessageLoggedEventListener.php +++ b/core/Listener/BeforeMessageLoggedEventListener.php @@ -40,11 +40,11 @@ class BeforeMessageLoggedEventListener implements IEventListener { 2 => '[warning]', 3 => '[error]', 4 => '[fatal]', - default => '['.$event->getLevel().']', + default => '[' . $event->getLevel() . ']', } - .' ['.$event->getApp().'] ' - .$event->getMessage()['message'] - ."\n"; + . ' [' . $event->getApp() . '] ' + . $event->getMessage()['message'] + . "\n"; } /** @@ -55,10 +55,10 @@ class BeforeMessageLoggedEventListener implements IEventListener { $argv = $_SERVER['argv']; $level = 0; foreach ($argv as $key => $arg) { - if ($arg === '--'.ReservedOptions::DEBUG_LOG) { + if ($arg === '--' . ReservedOptions::DEBUG_LOG) { unset($argv[$key]); - } elseif (str_starts_with($arg, '--'.ReservedOptions::DEBUG_LOG_LEVEL.'=')) { - $level = (int)substr($arg, strlen('--'.ReservedOptions::DEBUG_LOG_LEVEL.'=')); + } elseif (str_starts_with($arg, '--' . ReservedOptions::DEBUG_LOG_LEVEL . '=')) { + $level = (int)substr($arg, strlen('--' . ReservedOptions::DEBUG_LOG_LEVEL . '=')); unset($argv[$key]); } } diff --git a/core/Service/LoginFlowV2Service.php b/core/Service/LoginFlowV2Service.php index 89c89f50b3e..e67a602e7b5 100644 --- a/core/Service/LoginFlowV2Service.php +++ b/core/Service/LoginFlowV2Service.php @@ -126,7 +126,7 @@ class LoginFlowV2Service { return false; } - $appPassword = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $appPassword = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $this->tokenProvider->generateToken( $appPassword, $userId, @@ -166,8 +166,8 @@ class LoginFlowV2Service { public function createTokens(string $userAgent): LoginFlowV2Tokens { $flow = new LoginFlowV2(); - $pollToken = $this->random->generate(128, ISecureRandom::CHAR_DIGITS.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER); - $loginToken = $this->random->generate(128, ISecureRandom::CHAR_DIGITS.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER); + $pollToken = $this->random->generate(128, ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER); + $loginToken = $this->random->generate(128, ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER); $flow->setPollToken($this->hashToken($pollToken)); $flow->setLoginToken($loginToken); $flow->setStarted(0); diff --git a/core/templates/installation.php b/core/templates/installation.php index 5343464edbc..d03bc3cb174 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -67,7 +67,7 @@ script('core', 'install'); <div id="datadirContent"> <label for="directory"><?php p($l->t('Data folder')); ?></label> <input type="text" name="directory" id="directory" - placeholder="<?php p(OC::$SERVERROOT.'/data'); ?>" + placeholder="<?php p(OC::$SERVERROOT . '/data'); ?>" value="<?php p($_['directory']); ?>" autocomplete="off" autocapitalize="none" spellcheck="false"> </div> diff --git a/core/templates/layout.public.php b/core/templates/layout.public.php index d3c558ec04f..e2ed47d0716 100644 --- a/core/templates/layout.public.php +++ b/core/templates/layout.public.php @@ -10,7 +10,7 @@ <meta charset="utf-8"> <title> <?php - p(!empty($_['application']) ? $_['application'].' - ' : ''); + p(!empty($_['application']) ? $_['application'] . ' - ' : ''); p($theme->getTitle()); ?> </title> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index f820a2f3ace..fc0f3af2d09 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -24,8 +24,8 @@ $getUserAvatar = static function (int $size) use ($_): string { <meta charset="utf-8"> <title> <?php - p(!empty($_['pageTitle']) && $_['pageTitle'] !== $_['application'] ? $_['pageTitle'].' - ' : ''); -p(!empty($_['application']) ? $_['application'].' - ' : ''); + p(!empty($_['pageTitle']) && $_['pageTitle'] !== $_['application'] ? $_['pageTitle'] . ' - ' : ''); +p(!empty($_['application']) ? $_['application'] . ' - ' : ''); p($theme->getTitle()); ?> </title> @@ -84,7 +84,7 @@ p($theme->getTitle()); <main id="content" class="app-<?php p($_['appid']) ?>"> <h1 class="hidden-visually" id="page-heading-level-1"> <?php p((!empty($_['application']) && !empty($_['pageTitle']) && $_['application'] != $_['pageTitle']) - ? $_['application'].': '.$_['pageTitle'] + ? $_['application'] . ': ' . $_['pageTitle'] : (!empty($_['pageTitle']) ? $_['pageTitle'] : $theme->getName()) ); ?> </h1> @@ -189,7 +189,7 @@ Options: } if ($memoryAfter - $memoryBefore > 50_000_000) { - $message = 'Used memory grew by more than 50 MB when executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryAfter). ' (before: ' . Util::humanFileSize($memoryBefore) . ')'; + $message = 'Used memory grew by more than 50 MB when executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryAfter) . ' (before: ' . Util::humanFileSize($memoryBefore) . ')'; $logger->warning($message, ['app' => 'cron']); if ($verbose) { echo $message . PHP_EOL; diff --git a/lib/base.php b/lib/base.php index 1f9caf473e2..ec5cf3759f2 100644 --- a/lib/base.php +++ b/lib/base.php @@ -141,7 +141,7 @@ class OC { // slash which is required by URL generation. if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] === \OC::$WEBROOT && substr($_SERVER['REQUEST_URI'], -1) !== '/') { - header('Location: '.\OC::$WEBROOT.'/'); + header('Location: ' . \OC::$WEBROOT . '/'); exit(); } } @@ -183,7 +183,7 @@ class OC { $l = Server::get(\OCP\L10N\IFactory::class)->get('lib'); // Create config if it does not already exist - $configFilePath = self::$configDir .'/config.php'; + $configFilePath = self::$configDir . '/config.php'; if (!file_exists($configFilePath)) { @touch($configFilePath); } @@ -195,11 +195,11 @@ class OC { $urlGenerator = Server::get(IURLGenerator::class); if (self::$CLI) { - echo $l->t('Cannot write into "config" directory!')."\n"; - echo $l->t('This can usually be fixed by giving the web server write access to the config directory.')."\n"; + echo $l->t('Cannot write into "config" directory!') . "\n"; + echo $l->t('This can usually be fixed by giving the web server write access to the config directory.') . "\n"; echo "\n"; - echo $l->t('But, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.')."\n"; - echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-config') ])."\n"; + echo $l->t('But, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.') . "\n"; + echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-config') ]) . "\n"; exit; } else { OC_Template::printErrorPage( @@ -568,7 +568,7 @@ class OC { try { self::initPaths(); // setup 3rdparty autoloader - $vendorAutoLoad = OC::$SERVERROOT. '/3rdparty/autoload.php'; + $vendorAutoLoad = OC::$SERVERROOT . '/3rdparty/autoload.php'; if (!file_exists($vendorAutoLoad)) { throw new \RuntimeException('Composer autoloader not found, unable to continue. Check the folder "3rdparty". Running "git submodule update --init" will initialize the git submodule that handles the subfolder "3rdparty".'); } @@ -587,7 +587,7 @@ class OC { self::$server = new \OC\Server(\OC::$WEBROOT, self::$config); self::$server->boot(); - if (self::$CLI && in_array('--'.\OCP\Console\ReservedOptions::DEBUG_LOG, $_SERVER['argv'])) { + if (self::$CLI && in_array('--' . \OCP\Console\ReservedOptions::DEBUG_LOG, $_SERVER['argv'])) { \OC\Core\Listener\BeforeMessageLoggedEventListener::setup(); } diff --git a/lib/private/Activity/ActivitySettingsAdapter.php b/lib/private/Activity/ActivitySettingsAdapter.php index 5579685ccb8..27c85ee5554 100644 --- a/lib/private/Activity/ActivitySettingsAdapter.php +++ b/lib/private/Activity/ActivitySettingsAdapter.php @@ -19,7 +19,7 @@ use OCP\IL10N; class ActivitySettingsAdapter extends ActivitySettings { public function __construct( private ISetting $oldSettings, - private IL10N $l10n + private IL10N $l10n, ) { } diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php index f08e5125a47..46b53e3c1b2 100644 --- a/lib/private/AllConfig.php +++ b/lib/private/AllConfig.php @@ -41,7 +41,7 @@ class AllConfig implements IConfig { private CappedMemoryCache $userCache; public function __construct( - private SystemConfig $systemConfig + private SystemConfig $systemConfig, ) { $this->userCache = new CappedMemoryCache(); } diff --git a/lib/private/App/AppStore/Fetcher/AppDiscoverFetcher.php b/lib/private/App/AppStore/Fetcher/AppDiscoverFetcher.php index 1174c7d240b..2537d1dcec9 100644 --- a/lib/private/App/AppStore/Fetcher/AppDiscoverFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppDiscoverFetcher.php @@ -81,7 +81,7 @@ class AppDiscoverFetcher extends Fetcher { }); } - public function getETag(): string|null { + public function getETag(): ?string { $rootFolder = $this->appData->getFolder('/'); try { diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index e7ab2f9c377..352646c3f5e 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -18,7 +18,8 @@ class AppFetcher extends Fetcher { /** @var bool */ private $ignoreMaxVersion; - public function __construct(Factory $appDataFactory, + public function __construct( + Factory $appDataFactory, IClientService $clientService, ITimeFactory $timeFactory, IConfig $config, diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index f6361ff2ac6..828d83bc67a 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -281,7 +281,7 @@ class AppConfig implements IAppConfig { string $app, string $key, string $default = '', - ?bool $lazy = false + ?bool $lazy = false, ): string { try { $lazy = ($lazy === null) ? $this->isLazy($app, $key) : $lazy; @@ -316,7 +316,7 @@ class AppConfig implements IAppConfig { string $app, string $key, string $default = '', - bool $lazy = false + bool $lazy = false, ): string { return $this->getTypedValue($app, $key, $default, $lazy, self::VALUE_STRING); } @@ -339,7 +339,7 @@ class AppConfig implements IAppConfig { string $app, string $key, int $default = 0, - bool $lazy = false + bool $lazy = false, ): int { return (int)$this->getTypedValue($app, $key, (string)$default, $lazy, self::VALUE_INT); } @@ -399,7 +399,7 @@ class AppConfig implements IAppConfig { string $app, string $key, array $default = [], - bool $lazy = false + bool $lazy = false, ): array { try { $defaultJson = json_encode($default, JSON_THROW_ON_ERROR); @@ -427,7 +427,7 @@ class AppConfig implements IAppConfig { string $key, string $default, bool $lazy, - int $type + int $type, ): string { $this->assertParams($app, $key, valueType: $type); $this->loadConfig($lazy); @@ -526,7 +526,7 @@ class AppConfig implements IAppConfig { string $key, string $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->setTypedValue( $app, @@ -557,7 +557,7 @@ class AppConfig implements IAppConfig { string $key, string $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->setTypedValue( $app, @@ -587,7 +587,7 @@ class AppConfig implements IAppConfig { string $key, int $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { if ($value > 2000000000) { $this->logger->debug('You are trying to store an integer value around/above 2,147,483,647. This is a reminder that reaching this theoretical limit on 32 bits system will throw an exception.'); @@ -621,7 +621,7 @@ class AppConfig implements IAppConfig { string $key, float $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->setTypedValue( $app, @@ -649,7 +649,7 @@ class AppConfig implements IAppConfig { string $app, string $key, bool $value, - bool $lazy = false + bool $lazy = false, ): bool { return $this->setTypedValue( $app, @@ -680,7 +680,7 @@ class AppConfig implements IAppConfig { string $key, array $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { try { return $this->setTypedValue( @@ -718,7 +718,7 @@ class AppConfig implements IAppConfig { string $key, string $value, bool $lazy, - int $type + int $type, ): bool { $this->assertParams($app, $key); $this->loadConfig($lazy); diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index 4bbeabb7aae..d177221556c 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -484,7 +484,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { $prefix = '__Host-'; } - return $prefix.$name; + return $prefix . $name; } /** @@ -606,7 +606,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { * @return bool */ private function isOverwriteCondition(): bool { - $regex = '/' . $this->config->getSystemValueString('overwritecondaddr', '') . '/'; + $regex = '/' . $this->config->getSystemValueString('overwritecondaddr', '') . '/'; $remoteAddr = isset($this->server['REMOTE_ADDR']) ? $this->server['REMOTE_ADDR'] : ''; return $regex === '//' || preg_match($regex, $remoteAddr) === 1; } diff --git a/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php b/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php index 34291dfef10..2b3025fccff 100644 --- a/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php +++ b/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php @@ -24,7 +24,7 @@ class PublicShareMiddleware extends Middleware { private IRequest $request, private ISession $session, private IConfig $config, - private IThrottler $throttler + private IThrottler $throttler, ) { } diff --git a/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php b/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php index 10c8f8c7aee..d8f00f31096 100644 --- a/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php @@ -40,7 +40,8 @@ class CORSMiddleware extends Middleware { /** @var IThrottler */ private $throttler; - public function __construct(IRequest $request, + public function __construct( + IRequest $request, ControllerMethodReflector $reflector, Session $session, IThrottler $throttler, @@ -135,7 +136,7 @@ class CORSMiddleware extends Middleware { foreach ($response->getHeaders() as $header => $value) { if (strtolower($header) === 'access-control-allow-credentials' && strtolower(trim($value)) === 'true') { - $msg = 'Access-Control-Allow-Credentials must not be '. + $msg = 'Access-Control-Allow-Credentials must not be ' . 'set to true in order to prevent CSRF'; throw new SecurityException($msg); } diff --git a/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php b/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php index 34933e13ecd..f5416ff652a 100644 --- a/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php @@ -44,7 +44,8 @@ class PasswordConfirmationMiddleware extends Middleware { * @param IUserSession $userSession * @param ITimeFactory $timeFactory */ - public function __construct(ControllerMethodReflector $reflector, + public function __construct( + ControllerMethodReflector $reflector, ISession $session, IUserSession $userSession, ITimeFactory $timeFactory, diff --git a/lib/private/AppFramework/Services/AppConfig.php b/lib/private/AppFramework/Services/AppConfig.php index e47bbc429d0..423a9eb5814 100644 --- a/lib/private/AppFramework/Services/AppConfig.php +++ b/lib/private/AppFramework/Services/AppConfig.php @@ -116,7 +116,7 @@ class AppConfig implements IAppConfig { string $key, string $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->appConfig->setValueString($this->appName, $key, $value, $lazy, $sensitive); } @@ -138,7 +138,7 @@ class AppConfig implements IAppConfig { string $key, int $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->appConfig->setValueInt($this->appName, $key, $value, $lazy, $sensitive); } @@ -160,7 +160,7 @@ class AppConfig implements IAppConfig { string $key, float $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->appConfig->setValueFloat($this->appName, $key, $value, $lazy, $sensitive); } @@ -180,7 +180,7 @@ class AppConfig implements IAppConfig { public function setAppValueBool( string $key, bool $value, - bool $lazy = false + bool $lazy = false, ): bool { return $this->appConfig->setValueBool($this->appName, $key, $value, $lazy); } @@ -203,7 +203,7 @@ class AppConfig implements IAppConfig { string $key, array $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->appConfig->setValueArray($this->appName, $key, $value, $lazy, $sensitive); } diff --git a/lib/private/Archive/Archive.php b/lib/private/Archive/Archive.php index 26b940be410..874087fb167 100644 --- a/lib/private/Archive/Archive.php +++ b/lib/private/Archive/Archive.php @@ -92,10 +92,10 @@ abstract class Archive { if ($file === '.' || $file === '..') { continue; } - if (is_dir($source.'/'.$file)) { - $this->addRecursive($path.'/'.$file, $source.'/'.$file); + if (is_dir($source . '/' . $file)) { + $this->addRecursive($path . '/' . $file, $source . '/' . $file); } else { - $this->addFile($path.'/'.$file, $source.'/'.$file); + $this->addFile($path . '/' . $file, $source . '/' . $file); } } } diff --git a/lib/private/Archive/ZIP.php b/lib/private/Archive/ZIP.php index 52352f9505e..61fd25d071d 100644 --- a/lib/private/Archive/ZIP.php +++ b/lib/private/Archive/ZIP.php @@ -26,7 +26,7 @@ class ZIP extends Archive { $this->zip = new \ZipArchive(); if ($this->zip->open($source, \ZipArchive::CREATE)) { } else { - \OC::$server->get(LoggerInterface::class)->warning('Error while opening archive '.$source, ['app' => 'files_archive']); + \OC::$server->get(LoggerInterface::class)->warning('Error while opening archive ' . $source, ['app' => 'files_archive']); } } @@ -169,15 +169,15 @@ class ZIP extends Archive { * check if a file or folder exists in the archive */ public function fileExists(string $path): bool { - return ($this->zip->locateName($path) !== false) or ($this->zip->locateName($path.'/') !== false); + return ($this->zip->locateName($path) !== false) or ($this->zip->locateName($path . '/') !== false); } /** * remove a file or folder from the archive */ public function remove(string $path): bool { - if ($this->fileExists($path.'/')) { - return $this->zip->deleteName($path.'/'); + if ($this->fileExists($path . '/')) { + return $this->zip->deleteName($path . '/'); } else { return $this->zip->deleteName($path); } diff --git a/lib/private/Authentication/Login/Chain.php b/lib/private/Authentication/Login/Chain.php index abd24287a6c..3cba396afdd 100644 --- a/lib/private/Authentication/Login/Chain.php +++ b/lib/private/Authentication/Login/Chain.php @@ -56,7 +56,7 @@ class Chain { UpdateLastPasswordConfirmCommand $updateLastPasswordConfirmCommand, SetUserTimezoneCommand $setUserTimezoneCommand, TwoFactorCommand $twoFactorCommand, - FinishRememberedLoginCommand $finishRememberedLoginCommand + FinishRememberedLoginCommand $finishRememberedLoginCommand, ) { $this->preLoginHookCommand = $preLoginHookCommand; $this->userDisabledCheckCommand = $userDisabledCheckCommand; diff --git a/lib/private/Authentication/Login/WebAuthnChain.php b/lib/private/Authentication/Login/WebAuthnChain.php index c31e39de28c..ae523c43da6 100644 --- a/lib/private/Authentication/Login/WebAuthnChain.php +++ b/lib/private/Authentication/Login/WebAuthnChain.php @@ -48,7 +48,7 @@ class WebAuthnChain { UpdateLastPasswordConfirmCommand $updateLastPasswordConfirmCommand, SetUserTimezoneCommand $setUserTimezoneCommand, TwoFactorCommand $twoFactorCommand, - FinishRememberedLoginCommand $finishRememberedLoginCommand + FinishRememberedLoginCommand $finishRememberedLoginCommand, ) { $this->userDisabledCheckCommand = $userDisabledCheckCommand; $this->webAuthnLoginCommand = $webAuthnLoginCommand; diff --git a/lib/private/Authentication/WebAuthn/Manager.php b/lib/private/Authentication/WebAuthn/Manager.php index 7aa7a3c8f3a..e65002632d8 100644 --- a/lib/private/Authentication/WebAuthn/Manager.php +++ b/lib/private/Authentication/WebAuthn/Manager.php @@ -53,7 +53,7 @@ class Manager { CredentialRepository $repository, PublicKeyCredentialMapper $credentialMapper, LoggerInterface $logger, - IConfig $config + IConfig $config, ) { $this->repository = $repository; $this->credentialMapper = $credentialMapper; diff --git a/lib/private/Avatar/Avatar.php b/lib/private/Avatar/Avatar.php index bf29d57b88d..7aa2d220b88 100644 --- a/lib/private/Avatar/Avatar.php +++ b/lib/private/Avatar/Avatar.php @@ -183,7 +183,7 @@ abstract class Avatar implements IAvatar { string $text, string $font, int $size, - int $angle = 0 + int $angle = 0, ): array { // Image width & height $xi = imagesx($image); diff --git a/lib/private/Avatar/UserAvatar.php b/lib/private/Avatar/UserAvatar.php index c5a146a48b6..51c44b23a55 100644 --- a/lib/private/Avatar/UserAvatar.php +++ b/lib/private/Avatar/UserAvatar.php @@ -217,7 +217,7 @@ class UserAvatar extends Avatar { if ($size === -1) { $path = 'avatar' . ($darkTheme ? '-dark' : '') . '.' . $ext; } else { - $path = 'avatar' . ($darkTheme ? '-dark' : '') . '.' . $size . '.' . $ext; + $path = 'avatar' . ($darkTheme ? '-dark' : '') . '.' . $size . '.' . $ext; } } else { if ($size === -1) { diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php index dc8e33c743c..f6410269d67 100644 --- a/lib/private/BackgroundJob/JobList.php +++ b/lib/private/BackgroundJob/JobList.php @@ -27,7 +27,7 @@ class JobList implements IJobList { protected IDBConnection $connection, protected IConfig $config, protected ITimeFactory $timeFactory, - protected LoggerInterface $logger + protected LoggerInterface $logger, ) { } diff --git a/lib/private/Collaboration/Collaborators/LookupPlugin.php b/lib/private/Collaboration/Collaborators/LookupPlugin.php index 3cc4e93a486..8b46ad5e072 100644 --- a/lib/private/Collaboration/Collaborators/LookupPlugin.php +++ b/lib/private/Collaboration/Collaborators/LookupPlugin.php @@ -63,7 +63,7 @@ class LookupPlugin implements ISearchPlugin { try { $remote = $this->cloudIdManager->resolveCloudId($lookup['federationId'])->getRemote(); } catch (\Exception $e) { - $this->logger->error('Can not parse federated cloud ID "' . $lookup['federationId'] . '"', [ + $this->logger->error('Can not parse federated cloud ID "' . $lookup['federationId'] . '"', [ 'exception' => $e, ]); continue; diff --git a/lib/private/Collaboration/Resources/Collection.php b/lib/private/Collaboration/Resources/Collection.php index 2c5cc28ef28..d652305016f 100644 --- a/lib/private/Collaboration/Resources/Collection.php +++ b/lib/private/Collaboration/Resources/Collection.php @@ -28,7 +28,7 @@ class Collection implements ICollection { protected int $id, protected string $name, protected ?IUser $userForAccess = null, - protected ?bool $access = null + protected ?bool $access = null, ) { } diff --git a/lib/private/Collaboration/Resources/Resource.php b/lib/private/Collaboration/Resources/Resource.php index 34f68aeee11..19da3da7e7d 100644 --- a/lib/private/Collaboration/Resources/Resource.php +++ b/lib/private/Collaboration/Resources/Resource.php @@ -23,7 +23,7 @@ class Resource implements IResource { protected string $type, protected string $id, protected ?IUser $userForAccess = null, - protected ?bool $access = null + protected ?bool $access = null, ) { } diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php index ac022cd4c3c..0308d01ab9a 100644 --- a/lib/private/Comments/Comment.php +++ b/lib/private/Comments/Comment.php @@ -175,7 +175,7 @@ class Comment implements IComment { } $message = trim($message); if ($maxLength && mb_strlen($message, 'UTF-8') > $maxLength) { - throw new MessageTooLongException('Comment message must not exceed ' . $maxLength. ' characters'); + throw new MessageTooLongException('Comment message must not exceed ' . $maxLength . ' characters'); } $this->data['message'] = $message; return $this; diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index 8b7f43c03a2..41e0c662212 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -320,7 +320,7 @@ class Manager implements ICommentsManager { $objectId, $limit = 0, $offset = 0, - ?\DateTime $notOlderThan = null + ?\DateTime $notOlderThan = null, ) { $comments = []; @@ -372,7 +372,7 @@ class Manager implements ICommentsManager { int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array { return $this->getCommentsWithVerbForObjectSinceComment( $objectType, @@ -403,7 +403,7 @@ class Manager implements ICommentsManager { int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array { $comments = []; @@ -575,7 +575,7 @@ class Manager implements ICommentsManager { if ($search !== '') { $query->where($query->expr()->iLike('message', $query->createNamedParameter( - '%' . $this->dbConn->escapeLikeParameter($search). '%' + '%' . $this->dbConn->escapeLikeParameter($search) . '%' ))); } @@ -769,7 +769,7 @@ class Manager implements ICommentsManager { string $objectId, string $verb, string $actorType, - array $actors + array $actors, ): array { $lastComments = []; diff --git a/lib/private/Config.php b/lib/private/Config.php index 08f9b028856..d9b16832698 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -35,7 +35,7 @@ class Config { */ public function __construct($configDir, $fileName = 'config.php') { $this->configDir = $configDir; - $this->configFilePath = $this->configDir.$fileName; + $this->configFilePath = $this->configDir . $fileName; $this->configFileName = $fileName; $this->readData(); $this->isReadOnly = $this->getValue('config_is_read_only', false); @@ -171,7 +171,7 @@ class Config { $configFiles = [$this->configFilePath]; // Add all files in the config dir ending with the same file name - $extra = glob($this->configDir.'*.'.$this->configFileName); + $extra = glob($this->configDir . '*.' . $this->configFileName); if (is_array($extra)) { natsort($extra); $configFiles = array_merge($configFiles, $extra); @@ -248,7 +248,7 @@ class Config { private function writeData() { $this->checkReadOnly(); - if (!is_file(\OC::$configDir.'/CAN_INSTALL') && !isset($this->cache['version'])) { + if (!is_file(\OC::$configDir . '/CAN_INSTALL') && !isset($this->cache['version'])) { throw new HintException(sprintf('Configuration was not read or initialized correctly, not overwriting %s', $this->configFilePath)); } diff --git a/lib/private/Console/Application.php b/lib/private/Console/Application.php index 22dc8d0c65e..1b620089736 100644 --- a/lib/private/Console/Application.php +++ b/lib/private/Console/Application.php @@ -47,7 +47,7 @@ class Application { */ public function loadCommands( InputInterface $input, - ConsoleOutputInterface $output + ConsoleOutputInterface $output, ): void { // $application is required to be defined in the register_command scripts $application = $this->application; diff --git a/lib/private/Contacts/ContactsMenu/ContactsStore.php b/lib/private/Contacts/ContactsMenu/ContactsStore.php index d15e6e35706..a502a58366d 100644 --- a/lib/private/Contacts/ContactsMenu/ContactsStore.php +++ b/lib/private/Contacts/ContactsMenu/ContactsStore.php @@ -163,7 +163,7 @@ class ContactsStore implements IContactsStore { private function filterContacts( IUser $self, array $entries, - ?string $filter + ?string $filter, ): array { $disallowEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') !== 'yes'; $restrictEnumerationGroup = $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_to_group', 'no') === 'yes'; diff --git a/lib/private/DB/Adapter.php b/lib/private/DB/Adapter.php index 71824bda9e8..8f1b8e6d75f 100644 --- a/lib/private/DB/Adapter.php +++ b/lib/private/DB/Adapter.php @@ -51,7 +51,7 @@ class Adapter { */ public function lockTable(string $tableName) { $this->conn->beginTransaction(); - $this->conn->executeUpdate('LOCK TABLE `' .$tableName . '` IN EXCLUSIVE MODE'); + $this->conn->executeUpdate('LOCK TABLE `' . $tableName . '` IN EXCLUSIVE MODE'); } /** diff --git a/lib/private/DB/AdapterMySQL.php b/lib/private/DB/AdapterMySQL.php index 598dbc4de20..63c75607379 100644 --- a/lib/private/DB/AdapterMySQL.php +++ b/lib/private/DB/AdapterMySQL.php @@ -15,7 +15,7 @@ class AdapterMySQL extends Adapter { * @param string $tableName */ public function lockTable($tableName) { - $this->conn->executeUpdate('LOCK TABLES `' .$tableName . '` WRITE'); + $this->conn->executeUpdate('LOCK TABLES `' . $tableName . '` WRITE'); } public function unlockTable() { diff --git a/lib/private/DB/AdapterSqlite.php b/lib/private/DB/AdapterSqlite.php index 0023ee15364..aeadf55ecf7 100644 --- a/lib/private/DB/AdapterSqlite.php +++ b/lib/private/DB/AdapterSqlite.php @@ -50,7 +50,7 @@ class AdapterSqlite extends Adapter { } $fieldList = '`' . implode('`,`', array_keys($input)) . '`'; $query = "INSERT INTO `$table` ($fieldList) SELECT " - . str_repeat('?,', count($input) - 1).'? ' + . str_repeat('?,', count($input) - 1) . '? ' . " WHERE NOT EXISTS (SELECT 1 FROM `$table` WHERE "; $inserts = array_values($input); diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index ecc6d09bc95..55e61a7be14 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -117,7 +117,7 @@ class Connection extends PrimaryReadReplicaConnection { private array $params, Driver $driver, ?Configuration $config = null, - ?EventManager $eventManager = null + ?EventManager $eventManager = null, ) { if (!isset($params['adapter'])) { throw new \Exception('adapter not set'); @@ -664,9 +664,9 @@ class Connection extends PrimaryReadReplicaConnection { $msg = $this->errorCode() . ': '; $errorInfo = $this->errorInfo(); if (!empty($errorInfo)) { - $msg .= 'SQLSTATE = '.$errorInfo[0] . ', '; - $msg .= 'Driver Code = '.$errorInfo[1] . ', '; - $msg .= 'Driver Message = '.$errorInfo[2]; + $msg .= 'SQLSTATE = ' . $errorInfo[0] . ', '; + $msg .= 'Driver Code = ' . $errorInfo[1] . ', '; + $msg .= 'Driver Message = ' . $errorInfo[2]; } return $msg; } diff --git a/lib/private/DB/DbDataCollector.php b/lib/private/DB/DbDataCollector.php index fcaa74daeab..e3c7cd35855 100644 --- a/lib/private/DB/DbDataCollector.php +++ b/lib/private/DB/DbDataCollector.php @@ -111,7 +111,7 @@ class DbDataCollector extends \OCP\DataCollector\AbstractDataCollector { } if ($error) { - return ['⚠ '.$error->getMessage(), false, false]; + return ['⚠ ' . $error->getMessage(), false, false]; } if (\is_array($var)) { diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 61a6d2baf16..0b59509eaab 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -396,7 +396,7 @@ class MigrationService { } catch (\Exception $e) { // The exception itself does not contain the name of the migration, // so we wrap it here, to make debugging easier. - throw new \Exception('Database error when running migration ' . $version . ' for app ' . $this->getApp() . PHP_EOL. $e->getMessage(), 0, $e); + throw new \Exception('Database error when running migration ' . $version . ' for app ' . $this->getApp() . PHP_EOL . $e->getMessage(), 0, $e); } } } diff --git a/lib/private/DB/MigratorExecuteSqlEvent.php b/lib/private/DB/MigratorExecuteSqlEvent.php index cfcfe7fa512..340cd636300 100644 --- a/lib/private/DB/MigratorExecuteSqlEvent.php +++ b/lib/private/DB/MigratorExecuteSqlEvent.php @@ -18,7 +18,7 @@ class MigratorExecuteSqlEvent extends Event { public function __construct( string $sql, int $current, - int $max + int $max, ) { $this->sql = $sql; $this->current = $current; diff --git a/lib/private/DB/QueryBuilder/CompositeExpression.php b/lib/private/DB/QueryBuilder/CompositeExpression.php index 6edf385360c..bcdbce8c5cb 100644 --- a/lib/private/DB/QueryBuilder/CompositeExpression.php +++ b/lib/private/DB/QueryBuilder/CompositeExpression.php @@ -16,7 +16,7 @@ class CompositeExpression implements ICompositeExpression, \Countable { public function __construct( private string $type, - private array $parts = [] + private array $parts = [], ) { } diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php index a8dc4d8cf14..6791430b1b0 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php @@ -15,7 +15,7 @@ class OCIFunctionBuilder extends FunctionBuilder { if (version_compare($this->connection->getServerVersion(), '20', '>=')) { return new QueryFunction('LOWER(STANDARD_HASH(' . $this->helper->quoteColumnName($input) . ", 'MD5'))"); } - return new QueryFunction('LOWER(DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw(' . $this->helper->quoteColumnName($input) .')))'); + return new QueryFunction('LOWER(DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw(' . $this->helper->quoteColumnName($input) . ')))'); } /** diff --git a/lib/private/DB/QueryBuilder/Partitioned/PartitionedResult.php b/lib/private/DB/QueryBuilder/Partitioned/PartitionedResult.php index aa9cc43b38b..b3b59e26298 100644 --- a/lib/private/DB/QueryBuilder/Partitioned/PartitionedResult.php +++ b/lib/private/DB/QueryBuilder/Partitioned/PartitionedResult.php @@ -24,7 +24,7 @@ class PartitionedResult extends ArrayResult { */ public function __construct( private array $splitOfParts, - private IResult $result + private IResult $result, ) { parent::__construct([]); } diff --git a/lib/private/DB/QueryBuilder/Sharded/CrossShardMoveHelper.php b/lib/private/DB/QueryBuilder/Sharded/CrossShardMoveHelper.php index 45f24e32685..81530b56725 100644 --- a/lib/private/DB/QueryBuilder/Sharded/CrossShardMoveHelper.php +++ b/lib/private/DB/QueryBuilder/Sharded/CrossShardMoveHelper.php @@ -16,7 +16,7 @@ use OCP\IDBConnection; */ class CrossShardMoveHelper { public function __construct( - private ShardConnectionManager $connectionManager + private ShardConnectionManager $connectionManager, ) { } diff --git a/lib/private/DirectEditing/Manager.php b/lib/private/DirectEditing/Manager.php index 4b8c6af31e2..7503ad94258 100644 --- a/lib/private/DirectEditing/Manager.php +++ b/lib/private/DirectEditing/Manager.php @@ -59,7 +59,7 @@ class Manager implements IManager { IUserSession $userSession, IRootFolder $rootFolder, IFactory $l10nFactory, - EncryptionManager $encryptionManager + EncryptionManager $encryptionManager, ) { $this->random = $random; $this->connection = $connection; diff --git a/lib/private/Encryption/DecryptAll.php b/lib/private/Encryption/DecryptAll.php index 0007467298c..70dd0c0f0b0 100644 --- a/lib/private/Encryption/DecryptAll.php +++ b/lib/private/Encryption/DecryptAll.php @@ -29,7 +29,7 @@ class DecryptAll { public function __construct( protected IManager $encryptionManager, protected IUserManager $userManager, - protected View $rootView + protected View $rootView, ) { $this->failed = []; } diff --git a/lib/private/Encryption/EncryptionWrapper.php b/lib/private/Encryption/EncryptionWrapper.php index aec93a3ce4d..7f355b603d6 100644 --- a/lib/private/Encryption/EncryptionWrapper.php +++ b/lib/private/Encryption/EncryptionWrapper.php @@ -39,7 +39,7 @@ class EncryptionWrapper { */ public function __construct(ArrayCache $arrayCache, Manager $manager, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->arrayCache = $arrayCache; $this->manager = $manager; diff --git a/lib/private/Encryption/Exceptions/EncryptionHeaderKeyExistsException.php b/lib/private/Encryption/Exceptions/EncryptionHeaderKeyExistsException.php index 07007dc0ec1..52f488e2956 100644 --- a/lib/private/Encryption/Exceptions/EncryptionHeaderKeyExistsException.php +++ b/lib/private/Encryption/Exceptions/EncryptionHeaderKeyExistsException.php @@ -14,6 +14,6 @@ class EncryptionHeaderKeyExistsException extends GenericEncryptionException { * @param string $key */ public function __construct($key) { - parent::__construct('header key "'. $key . '" already reserved by ownCloud'); + parent::__construct('header key "' . $key . '" already reserved by ownCloud'); } } diff --git a/lib/private/Encryption/Keys/Storage.php b/lib/private/Encryption/Keys/Storage.php index 532d1a51dd6..2c0ce9e5ef3 100644 --- a/lib/private/Encryption/Keys/Storage.php +++ b/lib/private/Encryption/Keys/Storage.php @@ -57,8 +57,8 @@ class Storage implements IStorage { $this->util = $util; $this->encryption_base_dir = '/files_encryption'; - $this->keys_base_dir = $this->encryption_base_dir .'/keys'; - $this->backup_base_dir = $this->encryption_base_dir .'/backup'; + $this->keys_base_dir = $this->encryption_base_dir . '/keys'; + $this->backup_base_dir = $this->encryption_base_dir . '/backup'; $this->root_dir = $this->util->getKeyStorageRoot(); $this->crypto = $crypto; $this->config = $config; diff --git a/lib/private/Encryption/Update.php b/lib/private/Encryption/Update.php index 6fee1afbe5c..0b27d63c19a 100644 --- a/lib/private/Encryption/Update.php +++ b/lib/private/Encryption/Update.php @@ -49,7 +49,7 @@ class Update { Manager $encryptionManager, File $file, LoggerInterface $logger, - $uid + $uid, ) { $this->view = $view; $this->util = $util; diff --git a/lib/private/EventSource.php b/lib/private/EventSource.php index 18af6e35832..1a005025ef9 100644 --- a/lib/private/EventSource.php +++ b/lib/private/EventSource.php @@ -51,7 +51,7 @@ class EventSource implements IEventSource { header('Content-Type: text/event-stream'); } if (!$this->request->passesStrictCookieCheck()) { - header('Location: '.\OC::$WEBROOT); + header('Location: ' . \OC::$WEBROOT); exit(); } if (!$this->request->passesCSRFCheck()) { @@ -74,7 +74,7 @@ class EventSource implements IEventSource { */ public function send($type, $data = null) { if ($data and !preg_match('/^[A-Za-z0-9_]+$/', $type)) { - throw new \BadMethodCallException('Type needs to be alphanumeric ('. $type .')'); + throw new \BadMethodCallException('Type needs to be alphanumeric (' . $type . ')'); } $this->init(); if (is_null($data)) { diff --git a/lib/private/Federation/CloudFederationProviderManager.php b/lib/private/Federation/CloudFederationProviderManager.php index 79b37b44c82..be9e66fa9ec 100644 --- a/lib/private/Federation/CloudFederationProviderManager.php +++ b/lib/private/Federation/CloudFederationProviderManager.php @@ -40,7 +40,7 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager private IClientService $httpClientService, private ICloudIdManager $cloudIdManager, private IOCMDiscoveryService $discoveryService, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/Federation/CloudFederationShare.php b/lib/private/Federation/CloudFederationShare.php index aa86905f234..22e36d87312 100644 --- a/lib/private/Federation/CloudFederationShare.php +++ b/lib/private/Federation/CloudFederationShare.php @@ -48,7 +48,7 @@ class CloudFederationShare implements ICloudFederationShare { $sharedByDisplayName = '', $shareType = '', $resourceType = '', - $sharedSecret = '' + $sharedSecret = '', ) { $this->setShareWith($shareWith); $this->setResourceName($name); diff --git a/lib/private/Federation/CloudIdManager.php b/lib/private/Federation/CloudIdManager.php index 69d48a148b3..f5c0035534c 100644 --- a/lib/private/Federation/CloudIdManager.php +++ b/lib/private/Federation/CloudIdManager.php @@ -36,7 +36,7 @@ class CloudIdManager implements ICloudIdManager { IURLGenerator $urlGenerator, IUserManager $userManager, ICacheFactory $cacheFactory, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { $this->contactsManager = $contactsManager; $this->urlGenerator = $urlGenerator; diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php index 82f9ec3be66..a4d118f8848 100644 --- a/lib/private/Files/Cache/QuerySearchHelper.php +++ b/lib/private/Files/Cache/QuerySearchHelper.php @@ -54,7 +54,7 @@ class QuerySearchHelper { CacheQueryBuilder $query, ISearchQuery $searchQuery, array $caches, - ?IMetadataQuery $metadataQuery = null + ?IMetadataQuery $metadataQuery = null, ): void { $storageFilters = array_values(array_map(function (ICache $cache) { return $cache->getQueryFilterForStorage(); diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php index 6e1c86eed47..3bd674f79e2 100644 --- a/lib/private/Files/Cache/Scanner.php +++ b/lib/private/Files/Cache/Scanner.php @@ -489,7 +489,7 @@ class Scanner extends BasicEmitter implements IScanner { $file = trim(\OC\Files\Filesystem::normalizePath($originalFile), '/'); if (trim($originalFile, '/') !== $file) { // encoding mismatch, might require compatibility wrapper - \OC::$server->get(LoggerInterface::class)->debug('Scanner: Skipping non-normalized file name "'. $originalFile . '" in path "' . $path . '".', ['app' => 'core']); + \OC::$server->get(LoggerInterface::class)->debug('Scanner: Skipping non-normalized file name "' . $originalFile . '" in path "' . $path . '".', ['app' => 'core']); $this->emit('\OC\Files\Cache\Scanner', 'normalizedNameMismatch', [$path ? $path . '/' . $originalFile : $originalFile]); // skip this entry continue; diff --git a/lib/private/Files/Cache/SearchBuilder.php b/lib/private/Files/Cache/SearchBuilder.php index 41f942cab03..e89b95b756f 100644 --- a/lib/private/Files/Cache/SearchBuilder.php +++ b/lib/private/Files/Cache/SearchBuilder.php @@ -84,7 +84,7 @@ class SearchBuilder { private $mimetypeLoader; public function __construct( - IMimeTypeLoader $mimetypeLoader + IMimeTypeLoader $mimetypeLoader, ) { $this->mimetypeLoader = $mimetypeLoader; } @@ -110,7 +110,7 @@ class SearchBuilder { public function searchOperatorArrayToDBExprArray( IQueryBuilder $builder, array $operators, - ?IMetadataQuery $metadataQuery = null + ?IMetadataQuery $metadataQuery = null, ) { return array_filter(array_map(function ($operator) use ($builder, $metadataQuery) { return $this->searchOperatorToDBExpr($builder, $operator, $metadataQuery); @@ -120,7 +120,7 @@ class SearchBuilder { public function searchOperatorToDBExpr( IQueryBuilder $builder, ISearchOperator $operator, - ?IMetadataQuery $metadataQuery = null + ?IMetadataQuery $metadataQuery = null, ) { $expr = $builder->expr(); @@ -156,7 +156,7 @@ class SearchBuilder { IQueryBuilder $builder, ISearchComparison $comparison, array $operatorMap, - ?IMetadataQuery $metadataQuery = null + ?IMetadataQuery $metadataQuery = null, ) { if ($comparison->getExtra()) { [$field, $value, $type, $paramType] = $this->getExtraOperatorField($comparison, $metadataQuery); diff --git a/lib/private/Files/Config/CachedMountFileInfo.php b/lib/private/Files/Config/CachedMountFileInfo.php index 41dbec87ef5..90a6b47f9d8 100644 --- a/lib/private/Files/Config/CachedMountFileInfo.php +++ b/lib/private/Files/Config/CachedMountFileInfo.php @@ -19,7 +19,7 @@ class CachedMountFileInfo extends CachedMountInfo implements ICachedMountFileInf ?int $mountId, string $mountProvider, string $rootInternalPath, - string $internalPath + string $internalPath, ) { parent::__construct($user, $storageId, $rootId, $mountPoint, $mountProvider, $mountId, $rootInternalPath); $this->internalPath = $internalPath; diff --git a/lib/private/Files/Config/CachedMountInfo.php b/lib/private/Files/Config/CachedMountInfo.php index 80423dcae40..79dd6c6ea1d 100644 --- a/lib/private/Files/Config/CachedMountInfo.php +++ b/lib/private/Files/Config/CachedMountInfo.php @@ -39,7 +39,7 @@ class CachedMountInfo implements ICachedMountInfo { string $mountPoint, string $mountProvider, ?int $mountId = null, - string $rootInternalPath = '' + string $rootInternalPath = '', ) { $this->user = $user; $this->storageId = $storageId; diff --git a/lib/private/Files/Config/MountProviderCollection.php b/lib/private/Files/Config/MountProviderCollection.php index 1dbc469c8c3..6a5407934c8 100644 --- a/lib/private/Files/Config/MountProviderCollection.php +++ b/lib/private/Files/Config/MountProviderCollection.php @@ -58,7 +58,7 @@ class MountProviderCollection implements IMountProviderCollection, Emitter { public function __construct( IStorageFactory $loader, IUserMountCache $mountCache, - IEventLogger $eventLogger + IEventLogger $eventLogger, ) { $this->loader = $loader; $this->mountCache = $mountCache; diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 94da770b63f..ad8061b1a8c 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -49,7 +49,7 @@ class UserMountCache implements IUserMountCache { IDBConnection $connection, IUserManager $userManager, LoggerInterface $logger, - IEventLogger $eventLogger + IEventLogger $eventLogger, ) { $this->connection = $connection; $this->userManager = $userManager; diff --git a/lib/private/Files/Mount/HomeMountPoint.php b/lib/private/Files/Mount/HomeMountPoint.php index 0aa4b54ddf0..5a648f08c89 100644 --- a/lib/private/Files/Mount/HomeMountPoint.php +++ b/lib/private/Files/Mount/HomeMountPoint.php @@ -22,7 +22,7 @@ class HomeMountPoint extends MountPoint { ?IStorageFactory $loader = null, ?array $mountOptions = null, ?int $mountId = null, - ?string $mountProvider = null + ?string $mountProvider = null, ) { parent::__construct($storage, $mountpoint, $arguments, $loader, $mountOptions, $mountId, $mountProvider); $this->user = $user; diff --git a/lib/private/Files/Mount/Manager.php b/lib/private/Files/Mount/Manager.php index d118021afa2..55de488c726 100644 --- a/lib/private/Files/Mount/Manager.php +++ b/lib/private/Files/Mount/Manager.php @@ -104,7 +104,7 @@ class Manager implements IMountManager { } } - throw new NotFoundException('No mount for path ' . $path . ' existing mounts (' . count($this->mounts) .'): ' . implode(',', array_keys($this->mounts))); + throw new NotFoundException('No mount for path ' . $path . ' existing mounts (' . count($this->mounts) . '): ' . implode(',', array_keys($this->mounts))); } /** diff --git a/lib/private/Files/Mount/MountPoint.php b/lib/private/Files/Mount/MountPoint.php index cb3a3e8a22d..7a5a87be35b 100644 --- a/lib/private/Files/Mount/MountPoint.php +++ b/lib/private/Files/Mount/MountPoint.php @@ -75,7 +75,7 @@ class MountPoint implements IMountPoint { ?IStorageFactory $loader = null, ?array $mountOptions = null, ?int $mountId = null, - ?string $mountProvider = null + ?string $mountProvider = null, ) { if (is_null($arguments)) { $arguments = []; diff --git a/lib/private/Files/Node/HookConnector.php b/lib/private/Files/Node/HookConnector.php index 8fd2ffa3369..423eea258ed 100644 --- a/lib/private/Files/Node/HookConnector.php +++ b/lib/private/Files/Node/HookConnector.php @@ -39,7 +39,7 @@ class HookConnector { private IRootFolder $root, private View $view, private IEventDispatcher $dispatcher, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 60affa4b89e..26823f65c2f 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -570,7 +570,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, - $preserveMtime = false + $preserveMtime = false, ) { if ($sourceStorage->instanceOfStorage(ObjectStoreStorage::class)) { /** @var ObjectStoreStorage $sourceStorage */ @@ -703,7 +703,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil string $writeToken, string $chunkId, $data, - $size = null + $size = null, ): ?array { if (!$this->objectStore instanceof IObjectStoreMultiPartUpload) { throw new GenericFileException('Object store does not support multipart upload'); diff --git a/lib/private/Files/ObjectStore/S3Signature.php b/lib/private/Files/ObjectStore/S3Signature.php index 4e9784ee81a..994d65cc219 100644 --- a/lib/private/Files/ObjectStore/S3Signature.php +++ b/lib/private/Files/ObjectStore/S3Signature.php @@ -41,7 +41,7 @@ class S3Signature implements SignatureInterface { public function signRequest( RequestInterface $request, - CredentialsInterface $credentials + CredentialsInterface $credentials, ) { $request = $this->prepareRequest($request, $credentials); $stringToSign = $this->createCanonicalizedString($request); @@ -56,7 +56,7 @@ class S3Signature implements SignatureInterface { RequestInterface $request, CredentialsInterface $credentials, $expires, - array $options = [] + array $options = [], ) { $query = []; // URL encoding already occurs in the URI template expansion. Undo that @@ -106,7 +106,7 @@ class S3Signature implements SignatureInterface { */ private function prepareRequest( RequestInterface $request, - CredentialsInterface $creds + CredentialsInterface $creds, ) { $modify = [ 'remove_headers' => ['X-Amz-Date'], @@ -129,7 +129,7 @@ class S3Signature implements SignatureInterface { private function createCanonicalizedString( RequestInterface $request, - $expires = null + $expires = null, ) { $buffer = $request->getMethod() . "\n"; diff --git a/lib/private/Files/Search/SearchComparison.php b/lib/private/Files/Search/SearchComparison.php index e3a8f800506..c1f0176afd9 100644 --- a/lib/private/Files/Search/SearchComparison.php +++ b/lib/private/Files/Search/SearchComparison.php @@ -20,7 +20,7 @@ class SearchComparison implements ISearchComparison { private string $field, /** @var ParamValue $value */ private \DateTime|int|string|bool|array $value, - private string $extra = '' + private string $extra = '', ) { } diff --git a/lib/private/Files/Search/SearchOrder.php b/lib/private/Files/Search/SearchOrder.php index f3f62b933a1..3dcbc02bc1a 100644 --- a/lib/private/Files/Search/SearchOrder.php +++ b/lib/private/Files/Search/SearchOrder.php @@ -12,7 +12,7 @@ class SearchOrder implements ISearchOrder { public function __construct( private string $direction, private string $field, - private string $extra = '' + private string $extra = '', ) { } diff --git a/lib/private/Files/Search/SearchQuery.php b/lib/private/Files/Search/SearchQuery.php index 3c8711facd8..1793e42d349 100644 --- a/lib/private/Files/Search/SearchQuery.php +++ b/lib/private/Files/Search/SearchQuery.php @@ -39,7 +39,7 @@ class SearchQuery implements ISearchQuery { int $offset, array $order, ?IUser $user = null, - bool $limitToHome = false + bool $limitToHome = false, ) { $this->searchOperation = $searchOperation; $this->limit = $limit; diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index e74dd1042d6..44c70bb5f3d 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -201,7 +201,7 @@ class SetupManager { $this->setupForUserWith($user, function () use ($user) { $this->mountProviderCollection->addMountForUser($user, $this->mountManager, function ( - IMountProvider $provider + IMountProvider $provider, ) use ($user) { return !in_array(get_class($provider), $this->setupUserMountProviders[$user->getUID()]); }); @@ -542,7 +542,7 @@ class SetupManager { if (!$this->listeningForProviders) { $this->listeningForProviders = true; $this->mountProviderCollection->listen('\OC\Files\Config', 'registerMountProvider', function ( - IMountProvider $provider + IMountProvider $provider, ) { foreach ($this->setupUsers as $userId) { $user = $this->userManager->get($userId); @@ -568,7 +568,7 @@ class SetupManager { $this->eventDispatcher->addListener(ShareCreatedEvent::class, function (ShareCreatedEvent $event) { $this->cache->remove($event->getShare()->getSharedWith()); }); - $this->eventDispatcher->addListener(InvalidateMountCacheEvent::class, function (InvalidateMountCacheEvent $event + $this->eventDispatcher->addListener(InvalidateMountCacheEvent::class, function (InvalidateMountCacheEvent $event, ) { if ($user = $event->getUser()) { $this->cache->remove($user->getUID()); diff --git a/lib/private/Files/Storage/CommonTest.php b/lib/private/Files/Storage/CommonTest.php index b92e493bc2c..efdd3634578 100644 --- a/lib/private/Files/Storage/CommonTest.php +++ b/lib/private/Files/Storage/CommonTest.php @@ -19,7 +19,7 @@ class CommonTest extends \OC\Files\Storage\Common { } public function getId() { - return 'test::'.$this->storage->getId(); + return 'test::' . $this->storage->getId(); } public function mkdir($path) { return $this->storage->mkdir($path); diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index 4c017082cea..87aa78887b5 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -163,13 +163,13 @@ class DAV extends Common { $lastRequestStart = 0; $this->client->on('beforeRequest', function (RequestInterface $request) use (&$lastRequestStart) { - $this->logger->debug('sending dav ' . $request->getMethod() . ' request to external storage: ' . $request->getAbsoluteUrl(), ['app' => 'dav']); + $this->logger->debug('sending dav ' . $request->getMethod() . ' request to external storage: ' . $request->getAbsoluteUrl(), ['app' => 'dav']); $lastRequestStart = microtime(true); $this->eventLogger->start('fs:storage:dav:request', 'Sending dav request to external storage'); }); $this->client->on('afterRequest', function (RequestInterface $request) use (&$lastRequestStart) { $elapsed = microtime(true) - $lastRequestStart; - $this->logger->debug('dav ' . $request->getMethod() . ' request to external storage: ' . $request->getAbsoluteUrl() . ' took ' . round($elapsed * 1000, 1) . 'ms', ['app' => 'dav']); + $this->logger->debug('dav ' . $request->getMethod() . ' request to external storage: ' . $request->getAbsoluteUrl() . ' took ' . round($elapsed * 1000, 1) . 'ms', ['app' => 'dav']); $this->eventLogger->end('fs:storage:dav:request'); }); } diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index 1ead1c342b0..3b45e996f5d 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -86,7 +86,7 @@ class Encryption extends Wrapper { ?IStorage $keyStorage = null, ?Update $update = null, ?Manager $mountManager = null, - ?ArrayCache $arrayCache = null + ?ArrayCache $arrayCache = null, ) { $this->mountPoint = $parameters['mountPoint']; $this->mount = $parameters['mount']; @@ -628,7 +628,7 @@ class Encryption extends Wrapper { Storage\IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, - $preserveMtime = true + $preserveMtime = true, ) { if ($sourceStorage === $this) { return $this->rename($sourceInternalPath, $targetInternalPath); @@ -669,7 +669,7 @@ class Encryption extends Wrapper { $sourceInternalPath, $targetInternalPath, $preserveMtime = false, - $isRename = false + $isRename = false, ) { // TODO clean this up once the underlying moveFromStorage in OC\Files\Storage\Wrapper\Common is fixed: // - call $this->storage->copyFromStorage() instead of $this->copyBetweenStorage @@ -694,7 +694,7 @@ class Encryption extends Wrapper { $sourceInternalPath, $targetInternalPath, $isRename, - $keepEncryptionVersion + $keepEncryptionVersion, ) { $isEncrypted = $this->encryptionManager->isEnabled() && $this->shouldEncrypt($targetInternalPath); $cacheInformation = [ @@ -749,7 +749,7 @@ class Encryption extends Wrapper { $sourceInternalPath, $targetInternalPath, $preserveMtime, - $isRename + $isRename, ) { // for versions we have nothing to do, because versions should always use the // key from the original file. Just create a 1:1 copy and done diff --git a/lib/private/Files/Template/TemplateManager.php b/lib/private/Files/Template/TemplateManager.php index e61b4720289..865af4eb90c 100644 --- a/lib/private/Files/Template/TemplateManager.php +++ b/lib/private/Files/Template/TemplateManager.php @@ -63,7 +63,7 @@ class TemplateManager implements ITemplateManager { IPreview $previewManager, IConfig $config, IFactory $l10nFactory, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->serverContainer = $serverContainer; $this->eventDispatcher = $eventDispatcher; diff --git a/lib/private/FilesMetadata/FilesMetadataManager.php b/lib/private/FilesMetadata/FilesMetadataManager.php index 5c1acb77ea7..f2ea6cb11a7 100644 --- a/lib/private/FilesMetadata/FilesMetadataManager.php +++ b/lib/private/FilesMetadata/FilesMetadataManager.php @@ -75,7 +75,7 @@ class FilesMetadataManager implements IFilesMetadataManager { public function refreshMetadata( Node $node, int $process = self::PROCESS_LIVE, - string $namedEvent = '' + string $namedEvent = '', ): IFilesMetadata { try { $metadata = $this->metadataRequestService->getMetadataFromFileId($node->getId()); @@ -224,7 +224,7 @@ class FilesMetadataManager implements IFilesMetadataManager { public function getMetadataQuery( IQueryBuilder $qb, string $fileTableAlias, - string $fileIdField + string $fileIdField, ): IMetadataQuery { return new MetadataQuery($qb, $this, $fileTableAlias, $fileIdField); } @@ -273,7 +273,7 @@ class FilesMetadataManager implements IFilesMetadataManager { string $key, string $type, bool $indexed = false, - int $editPermission = IMetadataValueWrapper::EDIT_FORBIDDEN + int $editPermission = IMetadataValueWrapper::EDIT_FORBIDDEN, ): void { $current = $this->getKnownMetadata(); try { diff --git a/lib/private/FilesMetadata/Job/UpdateSingleMetadata.php b/lib/private/FilesMetadata/Job/UpdateSingleMetadata.php index c4b0117db13..5746493ddef 100644 --- a/lib/private/FilesMetadata/Job/UpdateSingleMetadata.php +++ b/lib/private/FilesMetadata/Job/UpdateSingleMetadata.php @@ -29,7 +29,7 @@ class UpdateSingleMetadata extends QueuedJob { ITimeFactory $time, private IRootFolder $rootFolder, private FilesMetadataManager $filesMetadataManager, - private LoggerInterface $logger + private LoggerInterface $logger, ) { parent::__construct($time); } diff --git a/lib/private/FilesMetadata/Listener/MetadataDelete.php b/lib/private/FilesMetadata/Listener/MetadataDelete.php index c0a6fc758c1..226bd3bdafa 100644 --- a/lib/private/FilesMetadata/Listener/MetadataDelete.php +++ b/lib/private/FilesMetadata/Listener/MetadataDelete.php @@ -23,7 +23,7 @@ use Psr\Log\LoggerInterface; class MetadataDelete implements IEventListener { public function __construct( private IFilesMetadataManager $filesMetadataManager, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/FilesMetadata/Listener/MetadataUpdate.php b/lib/private/FilesMetadata/Listener/MetadataUpdate.php index 05422ba5aba..4c5c913c740 100644 --- a/lib/private/FilesMetadata/Listener/MetadataUpdate.php +++ b/lib/private/FilesMetadata/Listener/MetadataUpdate.php @@ -26,7 +26,7 @@ use Psr\Log\LoggerInterface; class MetadataUpdate implements IEventListener { public function __construct( private IFilesMetadataManager $filesMetadataManager, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/FilesMetadata/MetadataQuery.php b/lib/private/FilesMetadata/MetadataQuery.php index aac93a23446..deae433e2fc 100644 --- a/lib/private/FilesMetadata/MetadataQuery.php +++ b/lib/private/FilesMetadata/MetadataQuery.php @@ -32,7 +32,7 @@ class MetadataQuery implements IMetadataQuery { private string $fileTableAlias = 'fc', private string $fileIdField = 'fileid', private string $alias = 'meta', - private string $aliasIndexPrefix = 'meta_index' + private string $aliasIndexPrefix = 'meta_index', ) { if ($manager instanceof IFilesMetadata) { /** diff --git a/lib/private/FilesMetadata/Model/FilesMetadata.php b/lib/private/FilesMetadata/Model/FilesMetadata.php index dfeb429507a..d338bdbba8f 100644 --- a/lib/private/FilesMetadata/Model/FilesMetadata.php +++ b/lib/private/FilesMetadata/Model/FilesMetadata.php @@ -29,7 +29,7 @@ class FilesMetadata implements IFilesMetadata { private string $syncToken = ''; public function __construct( - private int $fileId = 0 + private int $fileId = 0, ) { } diff --git a/lib/private/FilesMetadata/Service/IndexRequestService.php b/lib/private/FilesMetadata/Service/IndexRequestService.php index b50fb378325..91bd9f0b11e 100644 --- a/lib/private/FilesMetadata/Service/IndexRequestService.php +++ b/lib/private/FilesMetadata/Service/IndexRequestService.php @@ -25,7 +25,7 @@ class IndexRequestService { public function __construct( private IDBConnection $dbConnection, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/FilesMetadata/Service/MetadataRequestService.php b/lib/private/FilesMetadata/Service/MetadataRequestService.php index b58912b0216..5fc02c5d00b 100644 --- a/lib/private/FilesMetadata/Service/MetadataRequestService.php +++ b/lib/private/FilesMetadata/Service/MetadataRequestService.php @@ -24,7 +24,7 @@ class MetadataRequestService { public function __construct( private IDBConnection $dbConnection, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index d18c7796805..bd46780a602 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -238,7 +238,7 @@ class Manager extends PublicEmitter implements IGroupManager { } elseif ($group = $this->get($gid)) { return $group; } elseif (mb_strlen($gid) > self::MAX_GROUP_LENGTH) { - throw new \Exception('Group name is limited to '. self::MAX_GROUP_LENGTH.' characters'); + throw new \Exception('Group name is limited to ' . self::MAX_GROUP_LENGTH . ' characters'); } else { $this->dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid)); $this->emit('\OC\Group', 'preCreate', [$gid]); diff --git a/lib/private/Group/MetaData.php b/lib/private/Group/MetaData.php index fe0d931cb09..77432eea5ff 100644 --- a/lib/private/Group/MetaData.php +++ b/lib/private/Group/MetaData.php @@ -31,7 +31,7 @@ class MetaData { private bool $isAdmin, private bool $isDelegatedAdmin, private IGroupManager $groupManager, - private IUserSession $userSession + private IUserSession $userSession, ) { } diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php index 0b72522c218..40ce012cd1a 100644 --- a/lib/private/Http/Client/Client.php +++ b/lib/private/Http/Client/Client.php @@ -61,7 +61,7 @@ class Client implements IClient { $onRedirectFunction = function ( \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, - \Psr\Http\Message\UriInterface $uri + \Psr\Http\Message\UriInterface $uri, ) use ($options) { $this->preventLocalAddress($uri->__toString(), $options); }; @@ -167,7 +167,7 @@ class Client implements IClient { throw new LocalServerException('Could not detect any host'); } if (!$this->remoteHostValidator->isValid($host)) { - throw new LocalServerException('Host "'.$host.'" violates local access rules'); + throw new LocalServerException('Host "' . $host . '" violates local access rules'); } } diff --git a/lib/private/Http/Client/DnsPinMiddleware.php b/lib/private/Http/Client/DnsPinMiddleware.php index fcf0818ebb9..6618f22d825 100644 --- a/lib/private/Http/Client/DnsPinMiddleware.php +++ b/lib/private/Http/Client/DnsPinMiddleware.php @@ -19,7 +19,7 @@ class DnsPinMiddleware { public function __construct( NegativeDnsCache $negativeDnsCache, - IpAddressClassifier $ipAddressClassifier + IpAddressClassifier $ipAddressClassifier, ) { $this->negativeDnsCache = $negativeDnsCache; $this->ipAddressClassifier = $ipAddressClassifier; @@ -100,7 +100,7 @@ class DnsPinMiddleware { return function (callable $handler) { return function ( RequestInterface $request, - array $options + array $options, ) use ($handler) { if ($options['nextcloud']['allow_local_address'] === true) { return $handler($request, $options); @@ -132,7 +132,7 @@ class DnsPinMiddleware { foreach ($targetIps as $ip) { if ($this->ipAddressClassifier->isLocalAddress($ip)) { // TODO: continue with all non-local IPs? - throw new LocalServerException('Host "'.$ip.'" ('.$hostName.':'.$port.') violates local access rules'); + throw new LocalServerException('Host "' . $ip . '" (' . $hostName . ':' . $port . ') violates local access rules'); } $curlResolves["$hostName:$port"][] = $ip; } diff --git a/lib/private/InitialStateService.php b/lib/private/InitialStateService.php index 8d364a90f84..c930ffd9466 100644 --- a/lib/private/InitialStateService.php +++ b/lib/private/InitialStateService.php @@ -47,12 +47,12 @@ class InitialStateService implements IInitialStateService { try { $this->states[$appName][$key] = json_encode($data, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { - $this->logger->error('Invalid '. $key . ' data provided to provideInitialState by ' . $appName, ['exception' => $e]); + $this->logger->error('Invalid ' . $key . ' data provided to provideInitialState by ' . $appName, ['exception' => $e]); } return; } - $this->logger->warning('Invalid '. $key . ' data provided to provideInitialState by ' . $appName); + $this->logger->warning('Invalid ' . $key . ' data provided to provideInitialState by ' . $appName); } public function provideLazyInitialState(string $appName, string $key, Closure $closure): void { diff --git a/lib/private/Installer.php b/lib/private/Installer.php index e0f7644304e..d5500c07a3c 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -58,7 +58,7 @@ class Installer { throw new \Exception('App not found in any app directory'); } - $basedir = $app['path'].'/'.$appId; + $basedir = $app['path'] . '/' . $appId; if (is_file($basedir . '/appinfo/database.xml')) { throw new \Exception('The appinfo/database.xml file is not longer supported. Used in ' . $appId); @@ -122,10 +122,10 @@ class Installer { //set remote/public handlers foreach ($info['remote'] as $name => $path) { - $config->setAppValue('core', 'remote_'.$name, $info['id'].'/'.$path); + $config->setAppValue('core', 'remote_' . $name, $info['id'] . '/' . $path); } foreach ($info['public'] as $name => $path) { - $config->setAppValue('core', 'public_'.$name, $info['id'].'/'.$path); + $config->setAppValue('core', 'public_' . $name, $info['id'] . '/' . $path); } OC_App::setAppTypes($info['id']); @@ -410,8 +410,8 @@ class Installer { if ($app === false) { return false; } - $basedir = $app['path'].'/'.$appId; - return file_exists($basedir.'/.git/'); + $basedir = $app['path'] . '/' . $appId; + return file_exists($basedir . '/.git/'); } /** @@ -453,7 +453,7 @@ class Installer { OC_Helper::rmdirr($appDir); return true; } else { - $this->logger->error('can\'t remove app '.$appId.'. It is not installed.'); + $this->logger->error('can\'t remove app ' . $appId . '. It is not installed.'); return false; } @@ -497,8 +497,8 @@ class Installer { foreach (\OC::$APPSROOTS as $app_dir) { if ($dir = opendir($app_dir['path'])) { while (false !== ($filename = readdir($dir))) { - if ($filename[0] !== '.' and is_dir($app_dir['path']."/$filename")) { - if (file_exists($app_dir['path']."/$filename/appinfo/info.xml")) { + if ($filename[0] !== '.' and is_dir($app_dir['path'] . "/$filename")) { + if (file_exists($app_dir['path'] . "/$filename/appinfo/info.xml")) { if ($config->getAppValue($filename, 'installed_version', null) === null) { $enabled = $appManager->isDefaultEnabled($filename); if (($enabled || in_array($filename, $appManager->getAlwaysEnabledApps())) @@ -571,10 +571,10 @@ class Installer { //set remote/public handlers foreach ($info['remote'] as $name => $path) { - $config->setAppValue('core', 'remote_'.$name, $app.'/'.$path); + $config->setAppValue('core', 'remote_' . $name, $app . '/' . $path); } foreach ($info['public'] as $name => $path) { - $config->setAppValue('core', 'public_'.$name, $app.'/'.$path); + $config->setAppValue('core', 'public_' . $name, $app . '/' . $path); } OC_App::setAppTypes($info['id']); diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php index 6443c43d210..a6a61555957 100644 --- a/lib/private/IntegrityCheck/Checker.php +++ b/lib/private/IntegrityCheck/Checker.php @@ -290,7 +290,7 @@ class Checker { // Check if certificate is signed by Nextcloud Root Authority $x509 = new \phpseclib\File\X509(); - $rootCertificatePublicKey = $this->fileAccessHelper->file_get_contents($this->environmentHelper->getServerRoot().'/resources/codesigning/root.crt'); + $rootCertificatePublicKey = $this->fileAccessHelper->file_get_contents($this->environmentHelper->getServerRoot() . '/resources/codesigning/root.crt'); $rootCerts = $this->splitCerts($rootCertificatePublicKey); foreach ($rootCerts as $rootCert) { @@ -383,7 +383,7 @@ class Checker { /** * @return array|null Either the results or null if no results available */ - public function getResults(): array|null { + public function getResults(): ?array { $cachedResults = $this->cache->get(self::CACHE_KEY); if (!\is_null($cachedResults) and $cachedResults !== false) { return json_decode($cachedResults, true); diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php index fc76a15b07b..7dd0704682d 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -444,7 +444,7 @@ class Factory implements IFactory { if ($preferred_language === strtolower($available_language)) { return $this->respectDefaultLanguage($app, $available_language); } - if (strtolower($available_language) === $preferred_language_parts[0].'_'.end($preferred_language_parts)) { + if (strtolower($available_language) === $preferred_language_parts[0] . '_' . end($preferred_language_parts)) { return $available_language; } } diff --git a/lib/private/Lock/AbstractLockingProvider.php b/lib/private/Lock/AbstractLockingProvider.php index aa203f6a90b..d7e5976079c 100644 --- a/lib/private/Lock/AbstractLockingProvider.php +++ b/lib/private/Lock/AbstractLockingProvider.php @@ -24,7 +24,9 @@ abstract class AbstractLockingProvider implements ILockingProvider { * * @param int $ttl how long until we clear stray locks in seconds */ - public function __construct(protected int $ttl) { + public function __construct( + protected int $ttl, + ) { } /** @inheritDoc */ diff --git a/lib/private/Lock/DBLockingProvider.php b/lib/private/Lock/DBLockingProvider.php index d19f2cf3791..cb7f5cff350 100644 --- a/lib/private/Lock/DBLockingProvider.php +++ b/lib/private/Lock/DBLockingProvider.php @@ -24,7 +24,7 @@ class DBLockingProvider extends AbstractLockingProvider { private IDBConnection $connection, private ITimeFactory $timeFactory, int $ttl = 3600, - private bool $cacheSharedLocks = true + private bool $cacheSharedLocks = true, ) { parent::__construct($ttl); } diff --git a/lib/private/Log.php b/lib/private/Log.php index 4f6003cf53d..98de9bfa858 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -42,7 +42,7 @@ class Log implements ILogger, IDataLogger { private IWriter $logger, private SystemConfig $config, private Normalizer $normalizer = new Normalizer(), - private ?IRegistry $crashReporters = null + private ?IRegistry $crashReporters = null, ) { } diff --git a/lib/private/Log/Errorlog.php b/lib/private/Log/Errorlog.php index d53b8b151a1..6188bb70fd5 100644 --- a/lib/private/Log/Errorlog.php +++ b/lib/private/Log/Errorlog.php @@ -26,6 +26,6 @@ class Errorlog extends LogDetails implements IWriter { * @param string|array $message */ public function write(string $app, $message, int $level): void { - error_log('[' . $this->tag . ']['.$app.']['.$level.'] '.$this->logDetailsAsJSON($app, $message, $level)); + error_log('[' . $this->tag . '][' . $app . '][' . $level . '] ' . $this->logDetailsAsJSON($app, $message, $level)); } } diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php index bc14de4ffdf..ba428ba185b 100644 --- a/lib/private/Log/File.php +++ b/lib/private/Log/File.php @@ -55,7 +55,7 @@ class File extends LogDetails implements IWriter, IFileBased { @chmod($this->logFile, $this->logFileMode); } if ($handle) { - fwrite($handle, $entry."\n"); + fwrite($handle, $entry . "\n"); fclose($handle); } else { // Fall back to error_log @@ -91,7 +91,7 @@ class File extends LogDetails implements IWriter, IFileBased { // Add the first character if at the start of the file, // because it doesn't hit the else in the loop if ($pos == 0) { - $line = $ch.$line; + $line = $ch . $line; } $entry = json_decode($line); // Add the line as an entry if it is passed the offset and is equal or above the log level @@ -105,7 +105,7 @@ class File extends LogDetails implements IWriter, IFileBased { $line = ''; } } else { - $line = $ch.$line; + $line = $ch . $line; } $pos--; } diff --git a/lib/private/Log/LogFactory.php b/lib/private/Log/LogFactory.php index 612d98c9746..bbe77de198c 100644 --- a/lib/private/Log/LogFactory.php +++ b/lib/private/Log/LogFactory.php @@ -49,7 +49,7 @@ class LogFactory implements ILogFactory { } protected function buildLogFile(string $logFile = ''): File { - $defaultLogFile = $this->systemConfig->getValue('datadirectory', \OC::$SERVERROOT.'/data').'/nextcloud.log'; + $defaultLogFile = $this->systemConfig->getValue('datadirectory', \OC::$SERVERROOT . '/data') . '/nextcloud.log'; if ($logFile === '') { $logFile = $this->systemConfig->getValue('logfile', $defaultLogFile); } diff --git a/lib/private/Log/Rotate.php b/lib/private/Log/Rotate.php index f2fdb83623d..839c40726b7 100644 --- a/lib/private/Log/Rotate.php +++ b/lib/private/Log/Rotate.php @@ -27,7 +27,7 @@ class Rotate extends \OCP\BackgroundJob\Job { $this->maxSize = $config->getSystemValueInt('log_rotate_size', 100 * 1024 * 1024); if ($this->shouldRotateBySize()) { $rotatedFile = $this->rotate(); - $msg = 'Log file "'.$this->filePath.'" was over '.$this->maxSize.' bytes, moved to "'.$rotatedFile.'"'; + $msg = 'Log file "' . $this->filePath . '" was over ' . $this->maxSize . ' bytes, moved to "' . $rotatedFile . '"'; \OCP\Server::get(LoggerInterface::class)->info($msg, ['app' => Rotate::class]); } } diff --git a/lib/private/Log/Systemdlog.php b/lib/private/Log/Systemdlog.php index 4e33a4e5419..46de0f7db97 100644 --- a/lib/private/Log/Systemdlog.php +++ b/lib/private/Log/Systemdlog.php @@ -58,8 +58,8 @@ class Systemdlog extends LogDetails implements IWriter { */ public function write(string $app, $message, int $level): void { $journal_level = $this->levels[$level]; - sd_journal_send('PRIORITY='.$journal_level, - 'SYSLOG_IDENTIFIER='.$this->syslogId, + sd_journal_send('PRIORITY=' . $journal_level, + 'SYSLOG_IDENTIFIER=' . $this->syslogId, 'MESSAGE=' . $this->logDetailsAsJSON($app, $message, $level)); } } diff --git a/lib/private/Mail/Attachment.php b/lib/private/Mail/Attachment.php index 8dede9714f8..2a5246c0019 100644 --- a/lib/private/Mail/Attachment.php +++ b/lib/private/Mail/Attachment.php @@ -22,7 +22,7 @@ class Attachment implements IAttachment { private ?string $body, private ?string $name, private ?string $contentType, - private ?string $path = null + private ?string $path = null, ) { } diff --git a/lib/private/Mail/Provider/Manager.php b/lib/private/Mail/Provider/Manager.php index 14ffeac287b..61791620198 100644 --- a/lib/private/Mail/Provider/Manager.php +++ b/lib/private/Mail/Provider/Manager.php @@ -125,7 +125,7 @@ class Manager implements IManager { * * @return IProvider|null */ - public function findProviderById(string $providerId): IProvider|null { + public function findProviderById(string $providerId): ?IProvider { // evaluate if we already have a cached collection of providers if (!is_array($this->providersCollection)) { @@ -178,7 +178,7 @@ class Manager implements IManager { * * @return IService|null returns service object or null if none found */ - public function findServiceById(string $userId, string $serviceId, ?string $providerId = null): IService|null { + public function findServiceById(string $userId, string $serviceId, ?string $providerId = null): ?IService { // evaluate if provider id was specified if ($providerId !== null) { @@ -222,7 +222,7 @@ class Manager implements IManager { * * @return IService|null returns service object or null if none found */ - public function findServiceByAddress(string $userId, string $address, ?string $providerId = null): IService|null { + public function findServiceByAddress(string $userId, string $address, ?string $providerId = null): ?IService { // evaluate if provider id was specified if ($providerId !== null) { diff --git a/lib/private/Memcache/Factory.php b/lib/private/Memcache/Factory.php index 370130912d6..1d5bcdac16a 100644 --- a/lib/private/Memcache/Factory.php +++ b/lib/private/Memcache/Factory.php @@ -55,7 +55,7 @@ class Factory implements ICacheFactory { ?string $localCacheClass = null, ?string $distributedCacheClass = null, ?string $lockingCacheClass = null, - string $logFile = '' + string $logFile = '', ) { $this->logFile = $logFile; diff --git a/lib/private/MemoryInfo.php b/lib/private/MemoryInfo.php index a90739a6643..9b5c709b4a9 100644 --- a/lib/private/MemoryInfo.php +++ b/lib/private/MemoryInfo.php @@ -54,7 +54,7 @@ class MemoryInfo { if (is_numeric($number)) { $memoryLimit = Util::numericToNumber($number); } else { - throw new \InvalidArgumentException($number.' is not a valid numeric string (in memory_limit ini directive)'); + throw new \InvalidArgumentException($number . ' is not a valid numeric string (in memory_limit ini directive)'); } // intended fall through diff --git a/lib/private/Migration/MetadataManager.php b/lib/private/Migration/MetadataManager.php index cdaa604ce5a..fac9127a123 100644 --- a/lib/private/Migration/MetadataManager.php +++ b/lib/private/Migration/MetadataManager.php @@ -69,7 +69,7 @@ class MetadataManager { */ public function getMigrationsAttributesFromReleaseMetadata( array $metadata, - bool $filterKnownMigrations = false + bool $filterKnownMigrations = false, ): array { $appsAttributes = []; foreach (array_keys($metadata['apps']) as $appId) { diff --git a/lib/private/NaturalSort.php b/lib/private/NaturalSort.php index 9b097340b63..09c043764a7 100644 --- a/lib/private/NaturalSort.php +++ b/lib/private/NaturalSort.php @@ -23,7 +23,7 @@ class NaturalSort { // or inject an instance of \OC\NaturalSort_DefaultCollator to force using Owncloud's default collator if (isset($injectedCollator)) { $this->collator = $injectedCollator; - \OC::$server->get(LoggerInterface::class)->debug('forced use of '.get_class($injectedCollator)); + \OC::$server->get(LoggerInterface::class)->debug('forced use of ' . get_class($injectedCollator)); } } diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php index 169c7aaf350..12bef7daaf9 100644 --- a/lib/private/NavigationManager.php +++ b/lib/private/NavigationManager.php @@ -413,7 +413,7 @@ class NavigationManager implements INavigationManager { $this->unreadCounters[$id] = $unreadCounter; } - public function get(string $id): array|null { + public function get(string $id): ?array { $this->init(); foreach ($this->closureEntries as $c) { $this->add($c()); diff --git a/lib/private/OCS/DiscoveryService.php b/lib/private/OCS/DiscoveryService.php index fc9c1bd4796..85686e59b02 100644 --- a/lib/private/OCS/DiscoveryService.php +++ b/lib/private/OCS/DiscoveryService.php @@ -27,7 +27,7 @@ class DiscoveryService implements IDiscoveryService { * @param IClientService $clientService */ public function __construct(ICacheFactory $cacheFactory, - IClientService $clientService + IClientService $clientService, ) { $this->cache = $cacheFactory->createDistributed('ocs-discovery'); $this->client = $clientService->newClient(); diff --git a/lib/private/OCS/Provider.php b/lib/private/OCS/Provider.php index 23547da9433..402b6b7059d 100644 --- a/lib/private/OCS/Provider.php +++ b/lib/private/OCS/Provider.php @@ -18,9 +18,11 @@ class Provider extends Controller { * @param IRequest $request * @param IAppManager $appManager */ - public function __construct($appName, + public function __construct( + $appName, \OCP\IRequest $request, - private \OCP\App\IAppManager $appManager) { + private \OCP\App\IAppManager $appManager, + ) { parent::__construct($appName, $request); } diff --git a/lib/private/Preview/BackgroundCleanupJob.php b/lib/private/Preview/BackgroundCleanupJob.php index 44832a78eb9..8449e73983c 100644 --- a/lib/private/Preview/BackgroundCleanupJob.php +++ b/lib/private/Preview/BackgroundCleanupJob.php @@ -172,7 +172,7 @@ class BackgroundCleanupJob extends TimedJob { private function getAllPreviewIds(string $previewRoot, int $chunkSize): \Iterator { // See `getNewPreviewLocations` for some more info about the logic here - $like = $this->connection->escapeLikeParameter($previewRoot). '/_/_/_/_/_/_/_/%'; + $like = $this->connection->escapeLikeParameter($previewRoot) . '/_/_/_/_/_/_/_/%'; $qb = $this->connection->getQueryBuilder(); $qb->select('name', 'fileid') diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php index c7eb3121825..ef68c17b896 100644 --- a/lib/private/Preview/Generator.php +++ b/lib/private/Preview/Generator.php @@ -41,7 +41,7 @@ class Generator { IPreview $previewManager, IAppData $appData, GeneratorHelper $helper, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { $this->config = $config; $this->previewManager = $previewManager; diff --git a/lib/private/Preview/MimeIconProvider.php b/lib/private/Preview/MimeIconProvider.php index 167dd21b262..80545bd4063 100644 --- a/lib/private/Preview/MimeIconProvider.php +++ b/lib/private/Preview/MimeIconProvider.php @@ -22,7 +22,7 @@ class MimeIconProvider implements IMimeIconProvider { ) { } - public function getMimeIconUrl(string $mime): null|string { + public function getMimeIconUrl(string $mime): ?string { if (!$mime) { return null; } @@ -55,7 +55,7 @@ class MimeIconProvider implements IMimeIconProvider { return null; } - private function searchfileName(string $fileName): null|string { + private function searchfileName(string $fileName): ?string { // If the file exists in the current enabled legacy // custom theme, let's return it $theme = $this->config->getSystemValue('theme', ''); diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php index 6f43687ceea..ae0aa42a522 100644 --- a/lib/private/PreviewManager.php +++ b/lib/private/PreviewManager.php @@ -62,7 +62,7 @@ class PreviewManager implements IPreview { Coordinator $bootstrapCoordinator, IServerContainer $container, IBinaryFinder $binaryFinder, - IMagickSupport $imagickSupport + IMagickSupport $imagickSupport, ) { $this->config = $config; $this->rootFolder = $rootFolder; diff --git a/lib/private/Profiler/FileProfilerStorage.php b/lib/private/Profiler/FileProfilerStorage.php index b4494ef7a37..a4021d064a9 100644 --- a/lib/private/Profiler/FileProfilerStorage.php +++ b/lib/private/Profiler/FileProfilerStorage.php @@ -96,7 +96,7 @@ class FileProfilerStorage { } if (\function_exists('gzcompress')) { - $file = 'compress.zlib://'.$file; + $file = 'compress.zlib://' . $file; } return $this->createProfileFromData($token, unserialize(file_get_contents($file))); @@ -140,7 +140,7 @@ class FileProfilerStorage { $context = stream_context_create(); if (\function_exists('gzcompress')) { - $file = 'compress.zlib://'.$file; + $file = 'compress.zlib://' . $file; stream_context_set_option($context, 'zlib', 'level', 3); } @@ -178,7 +178,7 @@ class FileProfilerStorage { $folderA = substr($token, -2, 2); $folderB = substr($token, -4, 2); - return $this->folder.'/'.$folderA.'/'.$folderB.'/'.$token; + return $this->folder . '/' . $folderA . '/' . $folderB . '/' . $token; } /** @@ -187,7 +187,7 @@ class FileProfilerStorage { * @return string The index filename */ protected function getIndexFilename(): string { - return $this->folder.'/index.csv'; + return $this->folder . '/index.csv'; } /** @@ -220,12 +220,12 @@ class FileProfilerStorage { $buffer = fread($file, $chunkSize); if (false === ($upTo = strrpos($buffer, "\n"))) { - $line = $buffer.$line; + $line = $buffer . $line; continue; } $position += $upTo; - $line = substr($buffer, $upTo + 1).$line; + $line = substr($buffer, $upTo + 1) . $line; fseek($file, max(0, $position), \SEEK_SET); if ($line !== '') { @@ -258,7 +258,7 @@ class FileProfilerStorage { } if (\function_exists('gzcompress')) { - $file = 'compress.zlib://'.$file; + $file = 'compress.zlib://' . $file; } $profile->addChild($this->createProfileFromData($token, unserialize(file_get_contents($file)), $profile)); diff --git a/lib/private/Repair.php b/lib/private/Repair.php index 9d079aabd29..42d3cfb4910 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -77,7 +77,7 @@ class Repair implements IOutput { public function __construct( private IEventDispatcher $dispatcher, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/Repair/Collation.php b/lib/private/Repair/Collation.php index 9557aabd718..5a309892bf0 100644 --- a/lib/private/Repair/Collation.php +++ b/lib/private/Repair/Collation.php @@ -33,7 +33,7 @@ class Collation implements IRepairStep { IConfig $config, LoggerInterface $logger, IDBConnection $connection, - $ignoreFailures + $ignoreFailures, ) { $this->connection = $connection; $this->config = $config; diff --git a/lib/private/Repair/Events/RepairAdvanceEvent.php b/lib/private/Repair/Events/RepairAdvanceEvent.php index c4be72ce530..476db9e4702 100644 --- a/lib/private/Repair/Events/RepairAdvanceEvent.php +++ b/lib/private/Repair/Events/RepairAdvanceEvent.php @@ -16,7 +16,7 @@ class RepairAdvanceEvent extends Event { public function __construct( int $increment, - string $description + string $description, ) { $this->increment = $increment; $this->description = $description; diff --git a/lib/private/Repair/Events/RepairErrorEvent.php b/lib/private/Repair/Events/RepairErrorEvent.php index 8cd5d41b1b4..e5be8a5a031 100644 --- a/lib/private/Repair/Events/RepairErrorEvent.php +++ b/lib/private/Repair/Events/RepairErrorEvent.php @@ -14,7 +14,7 @@ class RepairErrorEvent extends Event { private string $message; public function __construct( - string $message + string $message, ) { $this->message = $message; } diff --git a/lib/private/Repair/Events/RepairInfoEvent.php b/lib/private/Repair/Events/RepairInfoEvent.php index c48b295a9a9..ce8eb2f99e6 100644 --- a/lib/private/Repair/Events/RepairInfoEvent.php +++ b/lib/private/Repair/Events/RepairInfoEvent.php @@ -14,7 +14,7 @@ class RepairInfoEvent extends Event { private string $message; public function __construct( - string $message + string $message, ) { $this->message = $message; } diff --git a/lib/private/Repair/Events/RepairStartEvent.php b/lib/private/Repair/Events/RepairStartEvent.php index e154df5e6e1..47e713d57d9 100644 --- a/lib/private/Repair/Events/RepairStartEvent.php +++ b/lib/private/Repair/Events/RepairStartEvent.php @@ -16,7 +16,7 @@ class RepairStartEvent extends Event { public function __construct( int $max, - string $current + string $current, ) { $this->max = $max; $this->current = $current; diff --git a/lib/private/Repair/Events/RepairStepEvent.php b/lib/private/Repair/Events/RepairStepEvent.php index 7140d13687d..27e1efbdb08 100644 --- a/lib/private/Repair/Events/RepairStepEvent.php +++ b/lib/private/Repair/Events/RepairStepEvent.php @@ -14,7 +14,7 @@ class RepairStepEvent extends Event { private string $stepName; public function __construct( - string $stepName + string $stepName, ) { $this->stepName = $stepName; } diff --git a/lib/private/Repair/Events/RepairWarningEvent.php b/lib/private/Repair/Events/RepairWarningEvent.php index 403eec87158..6893a7212ec 100644 --- a/lib/private/Repair/Events/RepairWarningEvent.php +++ b/lib/private/Repair/Events/RepairWarningEvent.php @@ -14,7 +14,7 @@ class RepairWarningEvent extends Event { private string $message; public function __construct( - string $message + string $message, ) { $this->message = $message; } diff --git a/lib/private/Repair/RepairDavShares.php b/lib/private/Repair/RepairDavShares.php index 792fdd4033e..36e3c397a39 100644 --- a/lib/private/Repair/RepairDavShares.php +++ b/lib/private/Repair/RepairDavShares.php @@ -38,7 +38,7 @@ class RepairDavShares implements IRepairStep { IConfig $config, IDBConnection $dbc, IGroupManager $groupManager, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->config = $config; $this->dbc = $dbc; diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index 6ff6d1ddd94..715f7623440 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -26,7 +26,7 @@ class RepairMimeTypes implements IRepairStep { public function __construct( protected IConfig $config, protected IAppConfig $appConfig, - protected IDBConnection $connection + protected IDBConnection $connection, ) { } diff --git a/lib/private/RichObjectStrings/Validator.php b/lib/private/RichObjectStrings/Validator.php index 197f48ed48c..c7e4dcf50b9 100644 --- a/lib/private/RichObjectStrings/Validator.php +++ b/lib/private/RichObjectStrings/Validator.php @@ -76,7 +76,7 @@ class Validator implements IValidator { $missingKeys = array_diff($requiredParameters, array_keys($parameter)); if (!empty($missingKeys)) { - throw new InvalidObjectExeption('Object is invalid, missing keys:'.json_encode($missingKeys)); + throw new InvalidObjectExeption('Object is invalid, missing keys:' . json_encode($missingKeys)); } foreach ($parameter as $key => $value) { diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php index ba369eecac0..7ec2aac021c 100644 --- a/lib/private/Route/Router.php +++ b/lib/private/Route/Router.php @@ -155,7 +155,7 @@ class Router implements IRouter { $this->root->addCollection($collection); // Also add the OCS collection - $collection = $this->getCollection($app.'.ocs'); + $collection = $this->getCollection($app . '.ocs'); $collection->addPrefix('/ocsapp'); $this->root->addCollection($collection); } diff --git a/lib/private/Search/Filter/BooleanFilter.php b/lib/private/Search/Filter/BooleanFilter.php index 92572a60073..894dc13b657 100644 --- a/lib/private/Search/Filter/BooleanFilter.php +++ b/lib/private/Search/Filter/BooleanFilter.php @@ -19,7 +19,7 @@ class BooleanFilter implements IFilter { $this->value = match ($value) { 'true', 'yes', 'y', '1' => true, 'false', 'no', 'n', '0', '' => false, - default => throw new InvalidArgumentException('Invalid boolean value '. $value), + default => throw new InvalidArgumentException('Invalid boolean value ' . $value), }; } diff --git a/lib/private/Search/Filter/DateTimeFilter.php b/lib/private/Search/Filter/DateTimeFilter.php index 367af80b505..48c1725a5e1 100644 --- a/lib/private/Search/Filter/DateTimeFilter.php +++ b/lib/private/Search/Filter/DateTimeFilter.php @@ -17,7 +17,7 @@ class DateTimeFilter implements IFilter { public function __construct(string $value) { if (filter_var($value, FILTER_VALIDATE_INT)) { - $value = '@'.$value; + $value = '@' . $value; } $this->value = new DateTimeImmutable($value); diff --git a/lib/private/Search/Filter/FloatFilter.php b/lib/private/Search/Filter/FloatFilter.php index 97d767e62cb..f2384552943 100644 --- a/lib/private/Search/Filter/FloatFilter.php +++ b/lib/private/Search/Filter/FloatFilter.php @@ -18,7 +18,7 @@ class FloatFilter implements IFilter { public function __construct(string $value) { $this->value = filter_var($value, FILTER_VALIDATE_FLOAT); if ($this->value === false) { - throw new InvalidArgumentException('Invalid float value '. $value); + throw new InvalidArgumentException('Invalid float value ' . $value); } } diff --git a/lib/private/Search/Filter/GroupFilter.php b/lib/private/Search/Filter/GroupFilter.php index e7694a6daa2..fe0b2ce42d8 100644 --- a/lib/private/Search/Filter/GroupFilter.php +++ b/lib/private/Search/Filter/GroupFilter.php @@ -23,7 +23,7 @@ class GroupFilter implements IFilter { ) { $group = $groupManager->get($value); if ($group === null) { - throw new InvalidArgumentException('Group '.$value.' not found'); + throw new InvalidArgumentException('Group ' . $value . ' not found'); } $this->group = $group; } diff --git a/lib/private/Search/Filter/IntegerFilter.php b/lib/private/Search/Filter/IntegerFilter.php index 825c7ddd3eb..028b7d0678f 100644 --- a/lib/private/Search/Filter/IntegerFilter.php +++ b/lib/private/Search/Filter/IntegerFilter.php @@ -18,7 +18,7 @@ class IntegerFilter implements IFilter { public function __construct(string $value) { $this->value = filter_var($value, FILTER_VALIDATE_INT); if ($this->value === false) { - throw new InvalidArgumentException('Invalid integer value '. $value); + throw new InvalidArgumentException('Invalid integer value ' . $value); } } diff --git a/lib/private/Search/Filter/UserFilter.php b/lib/private/Search/Filter/UserFilter.php index fbbc793e633..4f2061a4ba6 100644 --- a/lib/private/Search/Filter/UserFilter.php +++ b/lib/private/Search/Filter/UserFilter.php @@ -23,7 +23,7 @@ class UserFilter implements IFilter { ) { $user = $userManager->get($value); if ($user === null) { - throw new InvalidArgumentException('User '.$value.' not found'); + throw new InvalidArgumentException('User ' . $value . ' not found'); } $this->user = $user; } diff --git a/lib/private/Search/FilterFactory.php b/lib/private/Search/FilterFactory.php index 1466042291d..07063c604f4 100644 --- a/lib/private/Search/FilterFactory.php +++ b/lib/private/Search/FilterFactory.php @@ -28,7 +28,7 @@ final class FilterFactory { FilterDefinition::TYPE_PERSON => self::getPerson($filter), FilterDefinition::TYPE_STRING => new Filter\StringFilter($filter), FilterDefinition::TYPE_STRINGS => new Filter\StringsFilter(... (array)$filter), - default => throw new RuntimeException('Invalid filter type '. $type), + default => throw new RuntimeException('Invalid filter type ' . $type), }; } diff --git a/lib/private/Search/SearchComposer.php b/lib/private/Search/SearchComposer.php index 8108c6bcde4..d23662f7055 100644 --- a/lib/private/Search/SearchComposer.php +++ b/lib/private/Search/SearchComposer.php @@ -59,7 +59,7 @@ class SearchComposer { private Coordinator $bootstrapCoordinator, private ContainerInterface $container, private IURLGenerator $urlGenerator, - private LoggerInterface $logger + private LoggerInterface $logger, ) { $this->commonFilters = [ IFilter::BUILTIN_TERM => new FilterDefinition(IFilter::BUILTIN_TERM, FilterDefinition::TYPE_STRING), @@ -130,7 +130,7 @@ class SearchComposer { } foreach ($provider->getSupportedFilters() as $filterName) { if ($this->getFilterDefinition($filterName, $providerId) === null) { - throw new InvalidArgumentException('Invalid filter '. $filterName); + throw new InvalidArgumentException('Invalid filter ' . $filterName); } } } @@ -202,10 +202,10 @@ class SearchComposer { private function fetchIcon(string $appId, string $providerId): string { $icons = [ - [$providerId, $providerId.'.svg'], + [$providerId, $providerId . '.svg'], [$providerId, 'app.svg'], - [$appId, $providerId.'.svg'], - [$appId, $appId.'.svg'], + [$appId, $providerId . '.svg'], + [$appId, $appId . '.svg'], [$appId, 'app.svg'], ['core', 'places/default-app-icon.svg'], ]; diff --git a/lib/private/Search/UnsupportedFilter.php b/lib/private/Search/UnsupportedFilter.php index bf251a91d31..ea520e6b872 100644 --- a/lib/private/Search/UnsupportedFilter.php +++ b/lib/private/Search/UnsupportedFilter.php @@ -12,6 +12,6 @@ use Exception; final class UnsupportedFilter extends Exception { public function __construct(string $filerName, $providerId) { - parent::__construct('Provider '.$providerId.' doesn’t support filter '.$filerName.'.'); + parent::__construct('Provider ' . $providerId . ' doesn’t support filter ' . $filerName . '.'); } } diff --git a/lib/private/Security/Bruteforce/Backend/MemoryCacheBackend.php b/lib/private/Security/Bruteforce/Backend/MemoryCacheBackend.php index bf076240bf8..9a0723db47e 100644 --- a/lib/private/Security/Bruteforce/Backend/MemoryCacheBackend.php +++ b/lib/private/Security/Bruteforce/Backend/MemoryCacheBackend.php @@ -137,7 +137,7 @@ class MemoryCacheBackend implements IBackend { $existingAttempts = array_values($existingAttempts); // Store the new attempt - $existingAttempts[] = $timestamp . '#' . $this->hash($action) . '#' . $this->hash($metadata); + $existingAttempts[] = $timestamp . '#' . $this->hash($action) . '#' . $this->hash($metadata); $this->cache->set($identifier, json_encode($existingAttempts), 12 * 3600); } diff --git a/lib/private/Security/CSP/ContentSecurityPolicyManager.php b/lib/private/Security/CSP/ContentSecurityPolicyManager.php index 77ecceb03c3..e9d6b2945a8 100644 --- a/lib/private/Security/CSP/ContentSecurityPolicyManager.php +++ b/lib/private/Security/CSP/ContentSecurityPolicyManager.php @@ -52,13 +52,13 @@ class ContentSecurityPolicyManager implements IContentSecurityPolicyManager { EmptyContentSecurityPolicy $originalPolicy, ): ContentSecurityPolicy { foreach ((object)(array)$originalPolicy as $name => $value) { - $setter = 'set'.ucfirst($name); + $setter = 'set' . ucfirst($name); if (\is_array($value)) { - $getter = 'get'.ucfirst($name); + $getter = 'get' . ucfirst($name); $currentValues = \is_array($defaultPolicy->$getter()) ? $defaultPolicy->$getter() : []; $defaultPolicy->$setter(array_values(array_unique(array_merge($currentValues, $value)))); } elseif (\is_bool($value)) { - $getter = 'is'.ucfirst($name); + $getter = 'is' . ucfirst($name); $currentValue = $defaultPolicy->$getter(); // true wins over false if ($value > $currentValue) { diff --git a/lib/private/Security/Crypto.php b/lib/private/Security/Crypto.php index b03f8a4ddce..f7f62aadb7b 100644 --- a/lib/private/Security/Crypto.php +++ b/lib/private/Security/Crypto.php @@ -78,9 +78,9 @@ class Crypto implements ICrypto { $ciphertext = bin2hex($encrypted); $iv = bin2hex($iv); - $hmac = bin2hex($this->calculateHMAC($ciphertext.$iv, substr($keyMaterial, 32))); + $hmac = bin2hex($this->calculateHMAC($ciphertext . $iv, substr($keyMaterial, 32))); - return $ciphertext.'|'.$iv.'|'.$hmac.'|3'; + return $ciphertext . '|' . $iv . '|' . $hmac . '|3'; } /** diff --git a/lib/private/Security/Hasher.php b/lib/private/Security/Hasher.php index 3ab0e1bbcac..ba661f5a356 100644 --- a/lib/private/Security/Hasher.php +++ b/lib/private/Security/Hasher.php @@ -106,7 +106,7 @@ class Hasher implements IHasher { // Verify whether it matches a legacy PHPass or SHA1 string $hashLength = \strlen($hash); - if (($hashLength === 60 && password_verify($message.$this->legacySalt, $hash)) || + if (($hashLength === 60 && password_verify($message . $this->legacySalt, $hash)) || ($hashLength === 40 && hash_equals($hash, sha1($message)))) { $newHash = $this->hash($message); return true; diff --git a/lib/private/Security/Normalizer/IpAddress.php b/lib/private/Security/Normalizer/IpAddress.php index dc7c784fa4c..e9232c5fe9f 100644 --- a/lib/private/Security/Normalizer/IpAddress.php +++ b/lib/private/Security/Normalizer/IpAddress.php @@ -38,7 +38,7 @@ class IpAddress { $binary = \inet_pton($ip); $mask = inet_pton('FFFF:FFFF:FFFF:FFFF::'); - return inet_ntop($binary & $mask).'/64'; + return inet_ntop($binary & $mask) . '/64'; } /** @@ -67,12 +67,12 @@ class IpAddress { */ public function getSubnet(): string { if (filter_var($this->ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { - return $this->ip.'/32'; + return $this->ip . '/32'; } $ipv4 = $this->getEmbeddedIpv4($this->ip); if ($ipv4 !== null) { - return $ipv4.'/32'; + return $ipv4 . '/32'; } return $this->getIPv6Subnet($this->ip); diff --git a/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php b/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php index 34fddff539b..8adcd8e168c 100644 --- a/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php +++ b/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php @@ -20,7 +20,7 @@ class DatabaseBackend implements IBackend { public function __construct( private IConfig $config, private IDBConnection $dbConnection, - private ITimeFactory $timeFactory + private ITimeFactory $timeFactory, ) { } @@ -35,7 +35,7 @@ class DatabaseBackend implements IBackend { * @throws Exception */ private function getExistingAttemptCount( - string $identifier + string $identifier, ): int { $currentTime = $this->timeFactory->getDateTime(); diff --git a/lib/private/Security/VerificationToken/VerificationToken.php b/lib/private/Security/VerificationToken/VerificationToken.php index f99e6745952..1995b482597 100644 --- a/lib/private/Security/VerificationToken/VerificationToken.php +++ b/lib/private/Security/VerificationToken/VerificationToken.php @@ -25,7 +25,7 @@ class VerificationToken implements IVerificationToken { private ICrypto $crypto, private ITimeFactory $timeFactory, private ISecureRandom $secureRandom, - private IJobList $jobList + private IJobList $jobList, ) { } @@ -53,7 +53,7 @@ class VerificationToken implements IVerificationToken { } try { - $decryptedToken = $this->crypto->decrypt($encryptedToken, $passwordPrefix.$this->config->getSystemValueString('secret')); + $decryptedToken = $this->crypto->decrypt($encryptedToken, $passwordPrefix . $this->config->getSystemValueString('secret')); } catch (\Exception $e) { // Retry with empty secret as a fallback for instances where the secret might not have been set by accident try { @@ -85,11 +85,11 @@ class VerificationToken implements IVerificationToken { ): string { $token = $this->secureRandom->generate( 21, - ISecureRandom::CHAR_DIGITS. - ISecureRandom::CHAR_LOWER. + ISecureRandom::CHAR_DIGITS . + ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER ); - $tokenValue = $this->timeFactory->getTime() .':'. $token; + $tokenValue = $this->timeFactory->getTime() . ':' . $token; $encryptedValue = $this->crypto->encrypt($tokenValue, $passwordPrefix . $this->config->getSystemValueString('secret')); $this->config->setUserValue($user->getUID(), 'core', $subject, $encryptedValue); $jobArgs = json_encode([ diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 3d4ea8ea39f..c96c04f34ff 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -53,7 +53,7 @@ class Manager implements IManager { IServerContainer $container, AuthorizedGroupMapper $mapper, IGroupManager $groupManager, - ISubAdmin $subAdmin + ISubAdmin $subAdmin, ) { $this->log = $log; $this->l10nFactory = $l10nFactory; diff --git a/lib/private/Setup.php b/lib/private/Setup.php index fb054bca4e0..fa10f238bde 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -44,7 +44,7 @@ class Setup { protected Defaults $defaults, protected LoggerInterface $logger, protected ISecureRandom $random, - protected Installer $installer + protected Installer $installer, ) { $this->l10n = $l10nFactory->get('lib'); } @@ -377,7 +377,7 @@ class Setup { //and we are done $config->setSystemValue('installed', true); if (self::shouldRemoveCanInstallFile()) { - unlink(\OC::$configDir.'/CAN_INSTALL'); + unlink(\OC::$configDir . '/CAN_INSTALL'); } $bootstrapCoordinator = \OCP\Server::get(\OC\AppFramework\Bootstrap\Coordinator::class); @@ -561,11 +561,11 @@ class Setup { } public function shouldRemoveCanInstallFile(): bool { - return \OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir.'/CAN_INSTALL'); + return \OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir . '/CAN_INSTALL'); } public function canInstallFileExists(): bool { - return is_file(\OC::$configDir.'/CAN_INSTALL'); + return is_file(\OC::$configDir . '/CAN_INSTALL'); } protected function outputDebug(?IOutput $output, string $message): void { diff --git a/lib/private/Setup/AbstractDatabase.php b/lib/private/Setup/AbstractDatabase.php index b1d93f55cc0..dbbb587206b 100644 --- a/lib/private/Setup/AbstractDatabase.php +++ b/lib/private/Setup/AbstractDatabase.php @@ -133,7 +133,7 @@ abstract class AbstractDatabase { abstract public function setupDatabase($username); public function runMigrations(?IOutput $output = null) { - if (!is_dir(\OC::$SERVERROOT.'/core/Migrations')) { + if (!is_dir(\OC::$SERVERROOT . '/core/Migrations')) { return; } $ms = new MigrationService('core', \OC::$server->get(Connection::class), $output); diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php index 93aee667d18..2708ada31c1 100644 --- a/lib/private/Setup/MySQL.php +++ b/lib/private/Setup/MySQL.php @@ -41,7 +41,7 @@ class MySQL extends AbstractDatabase { //fill the database if needed $query = 'select count(*) from information_schema.tables where table_schema=? AND table_name = ?'; - $connection->executeQuery($query, [$this->dbName, $this->tablePrefix.'users']); + $connection->executeQuery($query, [$this->dbName, $this->tablePrefix . 'users']); $connection->close(); $connection = $this->connect(); diff --git a/lib/private/SetupCheck/SetupCheckManager.php b/lib/private/SetupCheck/SetupCheckManager.php index 41f393fef7a..721885848e2 100644 --- a/lib/private/SetupCheck/SetupCheckManager.php +++ b/lib/private/SetupCheck/SetupCheckManager.php @@ -29,12 +29,12 @@ class SetupCheckManager implements ISetupCheckManager { foreach ($setupChecks as $setupCheck) { /** @var ISetupCheck $setupCheckObject */ $setupCheckObject = Server::get($setupCheck->getService()); - $this->logger->debug('Running check '.get_class($setupCheckObject)); + $this->logger->debug('Running check ' . get_class($setupCheckObject)); try { $setupResult = $setupCheckObject->run(); } catch (\Throwable $t) { $setupResult = SetupResult::error("An exception occured while running the setup check:\n$t"); - $this->logger->error('Exception running check '.get_class($setupCheckObject).': '.$t->getMessage(), ['exception' => $t]); + $this->logger->error('Exception running check ' . get_class($setupCheckObject) . ': ' . $t->getMessage(), ['exception' => $t]); } $setupResult->setName($setupCheckObject->getName()); $category = $setupCheckObject->getCategory(); diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 0af264fb968..56a4c6410c5 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -54,8 +54,8 @@ class Share extends Constants { return true; } \OC::$server->get(LoggerInterface::class)->warning( - 'Sharing backend '.$class.' not registered, '.self::$backendTypes[$itemType]['class'] - .' is already registered for '.$itemType, + 'Sharing backend ' . $class . ' not registered, ' . self::$backendTypes[$itemType]['class'] + . ' is already registered for ' . $itemType, ['app' => 'files_sharing']); } return false; diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 5457e8024a4..d82e57415d3 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -54,7 +54,7 @@ use Psr\Log\LoggerInterface; */ class Manager implements IManager { - private IL10N|null $l; + private ?IL10N $l; private LegacyHooks $legacyHooks; public function __construct( @@ -75,7 +75,7 @@ class Manager implements IManager { private IUserSession $userSession, private KnownUserService $knownUserService, private ShareDisableChecker $shareDisableChecker, - private IDateTimeZone $dateTimeZone + private IDateTimeZone $dateTimeZone, ) { $this->l = $this->l10nFactory->get('lib'); // The constructor of LegacyHooks registers the listeners of share events diff --git a/lib/private/SystemTag/SystemTagManager.php b/lib/private/SystemTag/SystemTagManager.php index e99213b618b..1a0d8fb618a 100644 --- a/lib/private/SystemTag/SystemTagManager.php +++ b/lib/private/SystemTag/SystemTagManager.php @@ -110,7 +110,7 @@ class SystemTagManager implements ISystemTagManager { $query->andWhere( $query->expr()->like( 'name', - $query->createNamedParameter('%' . $this->connection->escapeLikeParameter($nameSearchPattern). '%') + $query->createNamedParameter('%' . $this->connection->escapeLikeParameter($nameSearchPattern) . '%') ) ); } @@ -146,7 +146,7 @@ class SystemTagManager implements ISystemTagManager { $result->closeCursor(); if (!$row) { throw new TagNotFoundException( - 'Tag ("' . $truncatedTagName . '", '. $userVisible . ', ' . $userAssignable . ') does not exist' + 'Tag ("' . $truncatedTagName . '", ' . $userVisible . ', ' . $userAssignable . ') does not exist' ); } @@ -171,7 +171,7 @@ class SystemTagManager implements ISystemTagManager { $query->execute(); } catch (UniqueConstraintViolationException $e) { throw new TagAlreadyExistsException( - 'Tag ("' . $truncatedTagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists', + 'Tag ("' . $truncatedTagName . '", ' . $userVisible . ', ' . $userAssignable . ') already exists', 0, $e ); @@ -239,7 +239,7 @@ class SystemTagManager implements ISystemTagManager { } } catch (UniqueConstraintViolationException $e) { throw new TagAlreadyExistsException( - 'Tag ("' . $newName . '", '. $userVisible . ', ' . $userAssignable . ') already exists', + 'Tag ("' . $newName . '", ' . $userVisible . ', ' . $userAssignable . ') already exists', 0, $e ); diff --git a/lib/private/SystemTag/SystemTagsInFilesDetector.php b/lib/private/SystemTag/SystemTagsInFilesDetector.php index a8dfec264a0..9268b7ab098 100644 --- a/lib/private/SystemTag/SystemTagsInFilesDetector.php +++ b/lib/private/SystemTag/SystemTagsInFilesDetector.php @@ -26,7 +26,7 @@ class SystemTagsInFilesDetector { Folder $folder, string $filteredMediaType = '', int $limit = 0, - int $offset = 0 + int $offset = 0, ): array { $operator = new SearchComparison(ISearchComparison::COMPARE_LIKE, 'systemtag', '%'); // Currently query has to have exactly one search condition. If no media type is provided, diff --git a/lib/private/Tags.php b/lib/private/Tags.php index 6a31ac94ef6..350c49bca2c 100644 --- a/lib/private/Tags.php +++ b/lib/private/Tags.php @@ -506,7 +506,7 @@ class Tags implements ITags { if (is_string($tag) && !is_numeric($tag)) { $tag = trim($tag); if ($tag === '') { - $this->logger->debug(__METHOD__.', Cannot add an empty tag'); + $this->logger->debug(__METHOD__ . ', Cannot add an empty tag'); return false; } if (!$this->hasTag($tag)) { @@ -546,7 +546,7 @@ class Tags implements ITags { if (is_string($tag) && !is_numeric($tag)) { $tag = trim($tag); if ($tag === '') { - $this->logger->debug(__METHOD__.', Tag name is empty'); + $this->logger->debug(__METHOD__ . ', Tag name is empty'); return false; } $tagId = $this->getTagId($tag); diff --git a/lib/private/TaskProcessing/Db/Task.php b/lib/private/TaskProcessing/Db/Task.php index 6787c11344a..4d919deaf94 100644 --- a/lib/private/TaskProcessing/Db/Task.php +++ b/lib/private/TaskProcessing/Db/Task.php @@ -98,7 +98,7 @@ class Task extends Entity { public function toRow(): array { return array_combine(self::$columns, array_map(function ($field) { - return $this->{'get'.ucfirst($field)}(); + return $this->{'get' . ucfirst($field)}(); }, self::$fields)); } diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index 29153ca56f9..36089f50f7f 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -312,7 +312,7 @@ class Manager implements IManager { $resources = []; $files = []; for ($i = 0; $i < $input['numberOfImages']; $i++) { - $file = $folder->newFile(time() . '-' . rand(1, 100000) . '-' . $i); + $file = $folder->newFile(time() . '-' . rand(1, 100000) . '-' . $i); $files[] = $file; $resource = $file->write(); if ($resource !== false && $resource !== true && is_resource($resource)) { @@ -593,7 +593,7 @@ class Manager implements IManager { $type->validateInput($io[$key]); if ($type === EShapeType::Enum) { if (!isset($enumValues[$key])) { - throw new ValidationException('Provider did not provide enum values for an enum slot: "' . $key .'"'); + throw new ValidationException('Provider did not provide enum values for an enum slot: "' . $key . '"'); } $type->validateEnum($io[$key], $enumValues[$key]); } @@ -1048,7 +1048,7 @@ class Manager implements IManager { public function getTasks( ?string $userId, ?string $taskTypeId = null, ?string $appId = null, ?string $customId = null, - ?int $status = null, ?int $scheduleAfter = null, ?int $endedBefore = null + ?int $status = null, ?int $scheduleAfter = null, ?int $endedBefore = null, ): array { try { $taskEntities = $this->taskMapper->findTasks($userId, $taskTypeId, $appId, $customId, $status, $scheduleAfter, $endedBefore); @@ -1203,7 +1203,7 @@ class Manager implements IManager { $provider = $this->getPreferredProvider($task->getTaskTypeId()); // calculate expected completion time $completionExpectedAt = new \DateTime('now'); - $completionExpectedAt->add(new \DateInterval('PT'.$provider->getExpectedRuntime().'S')); + $completionExpectedAt->add(new \DateInterval('PT' . $provider->getExpectedRuntime() . 'S')); $task->setCompletionExpectedAt($completionExpectedAt); } diff --git a/lib/private/Teams/TeamManager.php b/lib/private/Teams/TeamManager.php index 3d5f9f6d2a2..223579a1182 100644 --- a/lib/private/Teams/TeamManager.php +++ b/lib/private/Teams/TeamManager.php @@ -62,7 +62,7 @@ class TeamManager implements ITeamManager { return $providers[$providerId]; } - throw new \RuntimeException('No provider found for id ' .$providerId); + throw new \RuntimeException('No provider found for id ' . $providerId); } public function getSharedWith(string $teamId, string $userId): array { diff --git a/lib/private/Template/Base.php b/lib/private/Template/Base.php index b48c10143cf..602c8e6257e 100644 --- a/lib/private/Template/Base.php +++ b/lib/private/Template/Base.php @@ -46,15 +46,15 @@ class Base { */ protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) { // Check if the app is in the app folder or in the root - if ($app_dir !== false && file_exists($app_dir.'/templates/')) { + if ($app_dir !== false && file_exists($app_dir . '/templates/')) { return [ - $serverRoot.'/themes/'.$theme.'/apps/'.$app.'/templates/', - $app_dir.'/templates/', + $serverRoot . '/themes/' . $theme . '/apps/' . $app . '/templates/', + $app_dir . '/templates/', ]; } return [ - $serverRoot.'/themes/'.$theme.'/'.$app.'/templates/', - $serverRoot.'/'.$app.'/templates/', + $serverRoot . '/themes/' . $theme . '/' . $app . '/templates/', + $serverRoot . '/' . $app . '/templates/', ]; } @@ -65,8 +65,8 @@ class Base { */ protected function getCoreTemplateDirs($theme, $serverRoot) { return [ - $serverRoot.'/themes/'.$theme.'/core/templates/', - $serverRoot.'/core/templates/', + $serverRoot . '/themes/' . $theme . '/core/templates/', + $serverRoot . '/core/templates/', ]; } diff --git a/lib/private/Template/CSSResourceLocator.php b/lib/private/Template/CSSResourceLocator.php index e9aa38ef2cc..b501fd69874 100644 --- a/lib/private/Template/CSSResourceLocator.php +++ b/lib/private/Template/CSSResourceLocator.php @@ -19,8 +19,8 @@ class CSSResourceLocator extends ResourceLocator { */ public function doFind($style) { $app = substr($style, 0, strpos($style, '/')); - if ($this->appendIfExist($this->serverroot, $style.'.css') - || $this->appendIfExist($this->serverroot, 'core/'.$style.'.css') + if ($this->appendIfExist($this->serverroot, $style . '.css') + || $this->appendIfExist($this->serverroot, 'core/' . $style . '.css') ) { return; } @@ -41,17 +41,17 @@ class CSSResourceLocator extends ResourceLocator { // turned into cwd. $app_path = realpath($app_path); - $this->append($app_path, $style.'.css', $app_url); + $this->append($app_path, $style . '.css', $app_url); } /** * @param string $style */ public function doFindTheme($style) { - $theme_dir = 'themes/'.$this->theme.'/'; - $this->appendIfExist($this->serverroot, $theme_dir.'apps/'.$style.'.css') - || $this->appendIfExist($this->serverroot, $theme_dir.$style.'.css') - || $this->appendIfExist($this->serverroot, $theme_dir.'core/'.$style.'.css'); + $theme_dir = 'themes/' . $this->theme . '/'; + $this->appendIfExist($this->serverroot, $theme_dir . 'apps/' . $style . '.css') + || $this->appendIfExist($this->serverroot, $theme_dir . $style . '.css') + || $this->appendIfExist($this->serverroot, $theme_dir . 'core/' . $style . '.css'); } public function append($root, $file, $webRoot = null, $throw = true, $scss = false) { diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index a4984eaf930..1dec8634aca 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -282,7 +282,7 @@ class JSConfigHelper { // Echo it foreach ($array as $setting => $value) { - $result .= 'var '. $setting . '='. $value . ';' . PHP_EOL; + $result .= 'var ' . $setting . '=' . $value . ';' . PHP_EOL; } return $result; diff --git a/lib/private/Template/JSResourceLocator.php b/lib/private/Template/JSResourceLocator.php index b9a2fce6cd5..aad999f939a 100644 --- a/lib/private/Template/JSResourceLocator.php +++ b/lib/private/Template/JSResourceLocator.php @@ -26,7 +26,7 @@ class JSResourceLocator extends ResourceLocator { * @param string $script */ public function doFind($script) { - $theme_dir = 'themes/'.$this->theme.'/'; + $theme_dir = 'themes/' . $this->theme . '/'; // Extracting the appId and the script file name $app = substr($script, 0, strpos($script, '/')); @@ -52,29 +52,29 @@ class JSResourceLocator extends ResourceLocator { // For language files we try to load them all, so themes can overwrite // single l10n strings without having to translate all of them. $found = 0; - $found += $this->appendScriptIfExist($this->serverroot, 'core/'.$script); - $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.'core/'.$script); + $found += $this->appendScriptIfExist($this->serverroot, 'core/' . $script); + $found += $this->appendScriptIfExist($this->serverroot, $theme_dir . 'core/' . $script); $found += $this->appendScriptIfExist($this->serverroot, $script); - $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.$script); + $found += $this->appendScriptIfExist($this->serverroot, $theme_dir . $script); $found += $this->appendScriptIfExist($appRoot, $script, $appWebRoot); - $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.'apps/'.$script); + $found += $this->appendScriptIfExist($this->serverroot, $theme_dir . 'apps/' . $script); if ($found) { return; } - } elseif ($this->appendScriptIfExist($this->serverroot, $theme_dir.'apps/'.$script) - || $this->appendScriptIfExist($this->serverroot, $theme_dir.$script) + } elseif ($this->appendScriptIfExist($this->serverroot, $theme_dir . 'apps/' . $script) + || $this->appendScriptIfExist($this->serverroot, $theme_dir . $script) || $this->appendScriptIfExist($this->serverroot, $script) - || $this->appendScriptIfExist($this->serverroot, $theme_dir."dist/$app-$scriptName") + || $this->appendScriptIfExist($this->serverroot, $theme_dir . "dist/$app-$scriptName") || $this->appendScriptIfExist($this->serverroot, "dist/$app-$scriptName") || $this->appendScriptIfExist($appRoot, $script, $appWebRoot) - || $this->cacheAndAppendCombineJsonIfExist($this->serverroot, $script.'.json') - || $this->cacheAndAppendCombineJsonIfExist($appRoot, $script.'.json', $appWebRoot) - || $this->appendScriptIfExist($this->serverroot, $theme_dir.'core/'.$script) - || $this->appendScriptIfExist($this->serverroot, 'core/'.$script) - || (strpos($scriptName, '/') === -1 && ($this->appendScriptIfExist($this->serverroot, $theme_dir."dist/core-$scriptName") + || $this->cacheAndAppendCombineJsonIfExist($this->serverroot, $script . '.json') + || $this->cacheAndAppendCombineJsonIfExist($appRoot, $script . '.json', $appWebRoot) + || $this->appendScriptIfExist($this->serverroot, $theme_dir . 'core/' . $script) + || $this->appendScriptIfExist($this->serverroot, 'core/' . $script) + || (strpos($scriptName, '/') === -1 && ($this->appendScriptIfExist($this->serverroot, $theme_dir . "dist/core-$scriptName") || $this->appendScriptIfExist($this->serverroot, "dist/core-$scriptName"))) - || $this->cacheAndAppendCombineJsonIfExist($this->serverroot, 'core/'.$script.'.json') + || $this->cacheAndAppendCombineJsonIfExist($this->serverroot, 'core/' . $script . '.json') ) { return; } @@ -108,7 +108,7 @@ class JSResourceLocator extends ResourceLocator { } protected function cacheAndAppendCombineJsonIfExist($root, $file, $app = 'core') { - if (is_file($root.'/'.$file)) { + if (is_file($root . '/' . $file)) { if ($this->jsCombiner->process($root, $file, $app)) { $this->append($this->serverroot, $this->jsCombiner->getCachedJS($app, $file), false, false); } else { diff --git a/lib/private/Template/ResourceLocator.php b/lib/private/Template/ResourceLocator.php index 377f0e0b6a8..fa52f8e5c0d 100755 --- a/lib/private/Template/ResourceLocator.php +++ b/lib/private/Template/ResourceLocator.php @@ -75,7 +75,7 @@ abstract class ResourceLocator { * @return bool True if the resource was found, false otherwise */ protected function appendIfExist($root, $file, $webRoot = null) { - if ($root !== false && is_file($root.'/'.$file)) { + if ($root !== false && is_file($root . '/' . $file)) { $this->append($root, $file, $webRoot, false); return true; } diff --git a/lib/private/Template/TemplateFileLocator.php b/lib/private/Template/TemplateFileLocator.php index 164fcd503c1..38583d158a3 100644 --- a/lib/private/Template/TemplateFileLocator.php +++ b/lib/private/Template/TemplateFileLocator.php @@ -29,13 +29,13 @@ class TemplateFileLocator { } foreach ($this->dirs as $dir) { - $file = $dir.$template.'.php'; + $file = $dir . $template . '.php'; if (is_file($file)) { $this->path = $dir; return $file; } } - throw new \Exception('template file not found: template:'.$template); + throw new \Exception('template file not found: template:' . $template); } public function getPath() { diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 0ef4ec197cf..6c7cec90740 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -242,7 +242,7 @@ class TemplateLayout extends \OC_Template { foreach ($jsFiles as $info) { $web = $info[1]; $file = $info[2]; - $this->append('jsfiles', $web.'/'.$file . $this->getVersionHashSuffix()); + $this->append('jsfiles', $web . '/' . $file . $this->getVersionHashSuffix()); } try { @@ -275,14 +275,14 @@ class TemplateLayout extends \OC_Template { $file = $info[2]; if (str_ends_with($file, 'print.css')) { - $this->append('printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix()); + $this->append('printcssfiles', $web . '/' . $file . $this->getVersionHashSuffix()); } else { $suffix = $this->getVersionHashSuffix($web, $file); if (!str_contains($file, '?v=')) { - $this->append('cssfiles', $web.'/'.$file . $suffix); + $this->append('cssfiles', $web . '/' . $file . $suffix); } else { - $this->append('cssfiles', $web.'/'.$file . '-' . substr($suffix, 3)); + $this->append('cssfiles', $web . '/' . $file . '-' . substr($suffix, 3)); } } } diff --git a/lib/private/TextProcessing/Db/Task.php b/lib/private/TextProcessing/Db/Task.php index 31c9aab345b..d4ebc19e74a 100644 --- a/lib/private/TextProcessing/Db/Task.php +++ b/lib/private/TextProcessing/Db/Task.php @@ -70,7 +70,7 @@ class Task extends Entity { public function toRow(): array { return array_combine(self::$columns, array_map(function ($field) { - return $this->{'get'.ucfirst($field)}(); + return $this->{'get' . ucfirst($field)}(); }, self::$fields)); } diff --git a/lib/private/TextProcessing/Manager.php b/lib/private/TextProcessing/Manager.php index 9801a99ddec..8d34b5fba01 100644 --- a/lib/private/TextProcessing/Manager.php +++ b/lib/private/TextProcessing/Manager.php @@ -167,7 +167,7 @@ class Manager implements IManager { $task->setStatus(OCPTask::STATUS_RUNNING); if ($provider instanceof IProviderWithExpectedRuntime) { $completionExpectedAt = new \DateTime('now'); - $completionExpectedAt->add(new \DateInterval('PT'.$provider->getExpectedRuntime().'S')); + $completionExpectedAt->add(new \DateInterval('PT' . $provider->getExpectedRuntime() . 'S')); $task->setCompletionExpectedAt($completionExpectedAt); } if ($task->getId() === null) { @@ -209,7 +209,7 @@ class Manager implements IManager { [$provider,] = $providers; if ($provider instanceof IProviderWithExpectedRuntime) { $completionExpectedAt = new \DateTime('now'); - $completionExpectedAt->add(new \DateInterval('PT'.$provider->getExpectedRuntime().'S')); + $completionExpectedAt->add(new \DateInterval('PT' . $provider->getExpectedRuntime() . 'S')); $task->setCompletionExpectedAt($completionExpectedAt); } $taskEntity = DbTask::fromPublicTask($task); diff --git a/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php b/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php index 2a71256c492..4a336d56077 100644 --- a/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php +++ b/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php @@ -23,7 +23,6 @@ class RemoveOldTasksBackgroundJob extends TimedJob { ITimeFactory $timeFactory, private TaskMapper $taskMapper, private LoggerInterface $logger, - ) { parent::__construct($timeFactory); $this->setInterval(60 * 60 * 24); diff --git a/lib/private/TextToImage/Db/Task.php b/lib/private/TextToImage/Db/Task.php index d7eb0a22014..cc92c865220 100644 --- a/lib/private/TextToImage/Db/Task.php +++ b/lib/private/TextToImage/Db/Task.php @@ -71,7 +71,7 @@ class Task extends Entity { public function toRow(): array { return array_combine(self::$columns, array_map(function ($field) { - return $this->{'get'.ucfirst($field)}(); + return $this->{'get' . ucfirst($field)}(); }, self::$fields)); } diff --git a/lib/private/TextToImage/Db/TaskMapper.php b/lib/private/TextToImage/Db/TaskMapper.php index 4c0357884e3..b34c749eb66 100644 --- a/lib/private/TextToImage/Db/TaskMapper.php +++ b/lib/private/TextToImage/Db/TaskMapper.php @@ -91,7 +91,7 @@ class TaskMapper extends QBMapper { */ public function deleteOlderThan(int $timeout): array { $datetime = $this->timeFactory->getDateTime(); - $datetime->sub(new \DateInterval('PT'.$timeout.'S')); + $datetime->sub(new \DateInterval('PT' . $timeout . 'S')); $qb = $this->db->getQueryBuilder(); $qb->select('*') ->from($this->tableName) diff --git a/lib/private/TextToImage/Manager.php b/lib/private/TextToImage/Manager.php index 88dc108f380..eec6cc3d241 100644 --- a/lib/private/TextToImage/Manager.php +++ b/lib/private/TextToImage/Manager.php @@ -103,11 +103,11 @@ class Manager implements IManager { $providers = $this->getPreferredProviders(); foreach ($providers as $provider) { - $this->logger->debug('Trying to run Text2Image provider '.$provider::class); + $this->logger->debug('Trying to run Text2Image provider ' . $provider::class); try { $task->setStatus(Task::STATUS_RUNNING); $completionExpectedAt = new \DateTime('now'); - $completionExpectedAt->add(new \DateInterval('PT'.$provider->getExpectedRuntime().'S')); + $completionExpectedAt->add(new \DateInterval('PT' . $provider->getExpectedRuntime() . 'S')); $task->setCompletionExpectedAt($completionExpectedAt); if ($task->getId() === null) { $this->logger->debug('Inserting Text2Image task into DB'); @@ -198,7 +198,7 @@ class Manager implements IManager { $this->logger->debug('Scheduling Text2Image Task'); $task->setStatus(Task::STATUS_SCHEDULED); $completionExpectedAt = new \DateTime('now'); - $completionExpectedAt->add(new \DateInterval('PT'.$this->getPreferredProviders()[0]->getExpectedRuntime().'S')); + $completionExpectedAt->add(new \DateInterval('PT' . $this->getPreferredProviders()[0]->getExpectedRuntime() . 'S')); $task->setCompletionExpectedAt($completionExpectedAt); $taskEntity = DbTask::fromPublicTask($task); $this->taskMapper->insert($taskEntity); diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index 24454806e02..ad12fae5144 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -43,7 +43,7 @@ class URLGenerator implements IURLGenerator { IUserSession $userSession, ICacheFactory $cacheFactory, IRequest $request, - Router $router + Router $router, ) { $this->config = $config; $this->userSession = $userSession; @@ -96,7 +96,7 @@ class URLGenerator implements IURLGenerator { public function linkToOCSRouteAbsolute(string $routeName, array $arguments = []): string { // Returns `/subfolder/index.php/ocsapp/…` with `'htaccess.IgnoreFrontController' => false` in config.php // And `/subfolder/ocsapp/…` with `'htaccess.IgnoreFrontController' => true` in config.php - $route = $this->router->generate('ocs.'.$routeName, $arguments, false); + $route = $this->router->generate('ocs.' . $routeName, $arguments, false); // Cut off `/subfolder` if (\OC::$WEBROOT !== '' && str_starts_with($route, \OC::$WEBROOT)) { @@ -176,8 +176,8 @@ class URLGenerator implements IURLGenerator { * Returns the path to the image. */ public function imagePath(string $appName, string $file): string { - $cache = $this->cacheFactory->createDistributed('imagePath-'.md5($this->getBaseUrl()).'-'); - $cacheKey = $appName.'-'.$file; + $cache = $this->cacheFactory->createDistributed('imagePath-' . md5($this->getBaseUrl()) . '-'); + $cacheKey = $appName . '-' . $file; if ($key = $cache->get($cacheKey)) { return $key; } diff --git a/lib/private/Updater.php b/lib/private/Updater.php index 2722c172f1a..2ea680efcf5 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -57,7 +57,7 @@ class Updater extends BasicEmitter { private IAppConfig $appConfig, private Checker $checker, private ?LoggerInterface $log, - private Installer $installer + private Installer $installer, ) { } @@ -82,7 +82,7 @@ class Updater extends BasicEmitter { } // Clear CAN_INSTALL file if not on git - if (\OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir.'/CAN_INSTALL')) { + if (\OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir . '/CAN_INSTALL')) { if (!unlink(\OC::$configDir . '/CAN_INSTALL')) { $this->log->error('Could not cleanup CAN_INSTALL from your config folder. Please remove this file manually.'); } @@ -100,13 +100,13 @@ class Updater extends BasicEmitter { $this->log->error($exception->getMessage(), [ 'exception' => $exception, ]); - $this->emit('\OC\Updater', 'failure', [$exception->getMessage() . ': ' .$exception->getHint()]); + $this->emit('\OC\Updater', 'failure', [$exception->getMessage() . ': ' . $exception->getHint()]); $success = false; } catch (\Exception $exception) { $this->log->error($exception->getMessage(), [ 'exception' => $exception, ]); - $this->emit('\OC\Updater', 'failure', [get_class($exception) . ': ' .$exception->getMessage()]); + $this->emit('\OC\Updater', 'failure', [get_class($exception) . ': ' . $exception->getMessage()]); $success = false; } @@ -410,29 +410,29 @@ class Updater extends BasicEmitter { $dispatcher->addListener( MigratorExecuteSqlEvent::class, function (MigratorExecuteSqlEvent $event) use ($log): void { - $log->info(get_class($event).': ' . $event->getSql() . ' (' . $event->getCurrentStep() . ' of ' . $event->getMaxStep() . ')', ['app' => 'updater']); + $log->info(get_class($event) . ': ' . $event->getSql() . ' (' . $event->getCurrentStep() . ' of ' . $event->getMaxStep() . ')', ['app' => 'updater']); } ); $repairListener = function (Event $event) use ($log): void { if ($event instanceof RepairStartEvent) { - $log->info(get_class($event).': Starting ... ' . $event->getMaxStep() . ' (' . $event->getCurrentStepName() . ')', ['app' => 'updater']); + $log->info(get_class($event) . ': Starting ... ' . $event->getMaxStep() . ' (' . $event->getCurrentStepName() . ')', ['app' => 'updater']); } elseif ($event instanceof RepairAdvanceEvent) { $desc = $event->getDescription(); if (empty($desc)) { $desc = ''; } - $log->info(get_class($event).': ' . $desc . ' (' . $event->getIncrement() . ')', ['app' => 'updater']); + $log->info(get_class($event) . ': ' . $desc . ' (' . $event->getIncrement() . ')', ['app' => 'updater']); } elseif ($event instanceof RepairFinishEvent) { $log->info(get_class($event), ['app' => 'updater']); } elseif ($event instanceof RepairStepEvent) { - $log->info(get_class($event).': Repair step: ' . $event->getStepName(), ['app' => 'updater']); + $log->info(get_class($event) . ': Repair step: ' . $event->getStepName(), ['app' => 'updater']); } elseif ($event instanceof RepairInfoEvent) { - $log->info(get_class($event).': Repair info: ' . $event->getMessage(), ['app' => 'updater']); + $log->info(get_class($event) . ': Repair info: ' . $event->getMessage(), ['app' => 'updater']); } elseif ($event instanceof RepairWarningEvent) { - $log->warning(get_class($event).': Repair warning: ' . $event->getMessage(), ['app' => 'updater']); + $log->warning(get_class($event) . ': Repair warning: ' . $event->getMessage(), ['app' => 'updater']); } elseif ($event instanceof RepairErrorEvent) { - $log->error(get_class($event).': Repair error: ' . $event->getMessage(), ['app' => 'updater']); + $log->error(get_class($event) . ': Repair error: ' . $event->getMessage(), ['app' => 'updater']); } }; diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 9a84b102a99..925d0e53921 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -201,7 +201,7 @@ class Manager extends PublicEmitter implements IUserManager { $result = $this->checkPasswordNoLogging($loginName, $password); if ($result === false) { - \OCP\Server::get(LoggerInterface::class)->warning('Login failed: \''. $loginName .'\' (Remote IP: \''. \OC::$server->getRequest()->getRemoteAddress(). '\')', ['app' => 'core']); + \OCP\Server::get(LoggerInterface::class)->warning('Login failed: \'' . $loginName . '\' (Remote IP: \'' . \OC::$server->getRequest()->getRemoteAddress() . '\')', ['app' => 'core']); } return $result; diff --git a/lib/private/User/OutOfOfficeData.php b/lib/private/User/OutOfOfficeData.php index b1739126443..0d4e142567e 100644 --- a/lib/private/User/OutOfOfficeData.php +++ b/lib/private/User/OutOfOfficeData.php @@ -13,14 +13,16 @@ use OCP\IUser; use OCP\User\IOutOfOfficeData; class OutOfOfficeData implements IOutOfOfficeData { - public function __construct(private string $id, + public function __construct( + private string $id, private IUser $user, private int $startDate, private int $endDate, private string $shortMessage, private string $message, private ?string $replacementUserId, - private ?string $replacementUserDisplayName) { + private ?string $replacementUserDisplayName, + ) { } public function getId(): string { diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 6f7ceb08532..f2c38825338 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -524,7 +524,7 @@ class User implements IUser { if ($quota !== 'none' and $quota !== 'default') { $bytesQuota = OC_Helper::computerFileSize($quota); if ($bytesQuota === false) { - throw new InvalidArgumentException('Failed to set quota to invalid value '.$quota); + throw new InvalidArgumentException('Failed to set quota to invalid value ' . $quota); } $quota = OC_Helper::humanFileSize($bytesQuota); } diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index e5c2c34294d..a9f8b24d831 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -239,7 +239,7 @@ class OC_App { /** * Get the path where to install apps */ - public static function getInstallPath(): string|null { + public static function getInstallPath(): ?string { foreach (OC::$APPSROOTS as $dir) { if (isset($dir['writable']) && $dir['writable'] === true) { return $dir['path']; diff --git a/lib/private/legacy/OC_Defaults.php b/lib/private/legacy/OC_Defaults.php index 54640a892c9..cc0ac687ccc 100644 --- a/lib/private/legacy/OC_Defaults.php +++ b/lib/private/legacy/OC_Defaults.php @@ -223,8 +223,8 @@ class OC_Defaults { if ($this->themeExist('getShortFooter')) { $footer = $this->theme->getShortFooter(); } else { - $footer = '<a href="'. $this->getBaseUrl() . '" target="_blank"' . - ' rel="noreferrer noopener">' .$this->getEntity() . '</a>'. + $footer = '<a href="' . $this->getBaseUrl() . '" target="_blank"' . + ' rel="noreferrer noopener">' . $this->getEntity() . '</a>' . ' – ' . $this->getSlogan(); } diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php index 126472e3061..f75b89fea67 100644 --- a/lib/private/legacy/OC_Files.php +++ b/lib/private/legacy/OC_Files.php @@ -53,7 +53,7 @@ class OC_Files { http_response_code(206); header('Accept-Ranges: bytes', true); if (count($rangeArray) > 1) { - $type = 'multipart/byteranges; boundary='.self::getBoundary(); + $type = 'multipart/byteranges; boundary=' . self::getBoundary(); // no Content-Length header here } else { header(sprintf('Content-Range: bytes %d-%d/%d', $rangeArray[0]['from'], $rangeArray[0]['to'], $fileSize), true); @@ -63,7 +63,7 @@ class OC_Files { OC_Response::setContentLengthHeader($fileSize); } } - header('Content-Type: '.$type, true); + header('Content-Type: ' . $type, true); header('X-Accel-Buffering: no'); } @@ -336,12 +336,12 @@ class OC_Files { $type = \OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType($filename)); foreach ($rangeArray as $range) { - echo "\r\n--".self::getBoundary()."\r\n". - 'Content-type: '.$type."\r\n". - 'Content-range: bytes '.$range['from'].'-'.$range['to'].'/'.$range['size']."\r\n\r\n"; + echo "\r\n--" . self::getBoundary() . "\r\n" . + 'Content-type: ' . $type . "\r\n" . + 'Content-range: bytes ' . $range['from'] . '-' . $range['to'] . '/' . $range['size'] . "\r\n\r\n"; $view->readfilePart($filename, $range['from'], $range['to']); } - echo "\r\n--".self::getBoundary()."--\r\n"; + echo "\r\n--" . self::getBoundary() . "--\r\n"; } } catch (\OCP\Files\UnseekableException $ex) { // file is unseekable diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index 6da063ef2ce..0e55eff8f8c 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -463,7 +463,7 @@ class OC_Helper { } $fullPath = Filesystem::normalizePath($view->getAbsolutePath($path)); - $cacheKey = $fullPath. '::' . ($includeMountPoints ? 'include' : 'exclude'); + $cacheKey = $fullPath . '::' . ($includeMountPoints ? 'include' : 'exclude'); if ($useCache) { $cached = $memcache->get($cacheKey); if ($cached) { diff --git a/lib/private/legacy/OC_JSON.php b/lib/private/legacy/OC_JSON.php index a9682e2cce7..e510595a3cb 100644 --- a/lib/private/legacy/OC_JSON.php +++ b/lib/private/legacy/OC_JSON.php @@ -46,7 +46,7 @@ class OC_JSON { */ public static function callCheck() { if (!\OC::$server->getRequest()->passesStrictCookieCheck()) { - header('Location: '.\OC::$WEBROOT); + header('Location: ' . \OC::$WEBROOT); exit(); } diff --git a/lib/private/legacy/OC_Response.php b/lib/private/legacy/OC_Response.php index 8c8890c74c4..86274f5fcb7 100644 --- a/lib/private/legacy/OC_Response.php +++ b/lib/private/legacy/OC_Response.php @@ -43,7 +43,7 @@ class OC_Response { $lfh = new \OC\LargeFileHelper; $length = $lfh->formatUnsignedInteger($length); } - header('Content-Length: '.$length); + header('Content-Length: ' . $length); } /** @@ -59,7 +59,7 @@ class OC_Response { * @see \OCP\AppFramework\Http\Response::getHeaders */ $policy = 'default-src \'self\'; ' - . 'script-src \'self\' \'nonce-'.\OC::$server->getContentSecurityPolicyNonceManager()->getNonce().'\'; ' + . 'script-src \'self\' \'nonce-' . \OC::$server->getContentSecurityPolicyNonceManager()->getNonce() . '\'; ' . 'style-src \'self\' \'unsafe-inline\'; ' . 'frame-src *; ' . 'img-src * data: blob:; ' diff --git a/lib/private/legacy/OC_Template.php b/lib/private/legacy/OC_Template.php index 47803041cb5..1026e536b97 100644 --- a/lib/private/legacy/OC_Template.php +++ b/lib/private/legacy/OC_Template.php @@ -11,7 +11,7 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\EventDispatcher\IEventDispatcher; use Psr\Log\LoggerInterface; -require_once __DIR__.'/template/functions.php'; +require_once __DIR__ . '/template/functions.php'; /** * This class provides the templates for ownCloud. @@ -128,15 +128,15 @@ class OC_Template extends \OC\Template\Base { // Add custom headers $headers = ''; foreach (OC_Util::$headers as $header) { - $headers .= '<'.\OCP\Util::sanitizeHTML($header['tag']); + $headers .= '<' . \OCP\Util::sanitizeHTML($header['tag']); if (strcasecmp($header['tag'], 'script') === 0 && in_array('src', array_map('strtolower', array_keys($header['attributes'])))) { $headers .= ' defer'; } foreach ($header['attributes'] as $name => $value) { - $headers .= ' '.\OCP\Util::sanitizeHTML($name).'="'.\OCP\Util::sanitizeHTML($value).'"'; + $headers .= ' ' . \OCP\Util::sanitizeHTML($name) . '="' . \OCP\Util::sanitizeHTML($value) . '"'; } if ($header['text'] !== null) { - $headers .= '>'.\OCP\Util::sanitizeHTML($header['text']).'</'.\OCP\Util::sanitizeHTML($header['tag']).'>'; + $headers .= '>' . \OCP\Util::sanitizeHTML($header['text']) . '</' . \OCP\Util::sanitizeHTML($header['tag']) . '>'; } else { $headers .= '/>'; } @@ -162,7 +162,7 @@ class OC_Template extends \OC\Template\Base { * do this. */ public function inc($file, $additionalParams = null) { - return $this->load($this->path.$file.'.php', $additionalParams); + return $this->load($this->path . $file . '.php', $additionalParams); } /** diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index e152feb639e..0c8fcc56f32 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -156,7 +156,7 @@ class OC_Util { } if (!empty($skeletonDirectory)) { - $logger->debug('copying skeleton for '.$userId.' from '.$skeletonDirectory.' to '.$userDirectory->getFullPath('/'), ['app' => 'files_skeleton']); + $logger->debug('copying skeleton for ' . $userId . ' from ' . $skeletonDirectory . ' to ' . $userDirectory->getFullPath('/'), ['app' => 'files_skeleton']); self::copyr($skeletonDirectory, $userDirectory); // update the file cache $userDirectory->getStorage()->getScanner()->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE); @@ -783,7 +783,7 @@ class OC_Util { $id = \OC::$server->getSystemConfig()->getValue('instanceid', null); if (is_null($id)) { // We need to guarantee at least one letter in instanceid so it can be used as the session_name - $id = 'oc' . \OC::$server->get(ISecureRandom::class)->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); + $id = 'oc' . \OC::$server->get(ISecureRandom::class)->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER . \OCP\Security\ISecureRandom::CHAR_DIGITS); \OC::$server->getSystemConfig()->setValue('instanceid', $id); } return $id; diff --git a/lib/private/legacy/template/functions.php b/lib/private/legacy/template/functions.php index a9a1f10a116..37df801c3c4 100644 --- a/lib/private/legacy/template/functions.php +++ b/lib/private/legacy/template/functions.php @@ -22,12 +22,12 @@ function p($string) { function emit_css_tag($href, $opts = '') { $s = '<link rel="stylesheet"'; if (!empty($href)) { - $s .= ' href="' . $href .'"'; + $s .= ' href="' . $href . '"'; } if (!empty($opts)) { - $s .= ' '.$opts; + $s .= ' ' . $opts; } - print_unescaped($s.">\n"); + print_unescaped($s . ">\n"); } /** @@ -58,16 +58,16 @@ function emit_script_tag(string $src, string $script_content = '', string $conte $s = '<script nonce="' . $nonceManager->getNonce() . '"'; if (!empty($src)) { // emit script tag for deferred loading from $src - $s .= $defer_str.' src="' . $src .'"' . $type . '>'; + $s .= $defer_str . ' src="' . $src . '"' . $type . '>'; } elseif ($script_content !== '') { // emit script tag for inline script from $script_content without defer (see MDN) - $s .= ">\n".$script_content."\n"; + $s .= ">\n" . $script_content . "\n"; } else { // no $src nor $src_content, really useless empty tag $s .= '>'; } $s .= '</script>'; - print_unescaped($s."\n"); + print_unescaped($s . "\n"); } /** @@ -314,7 +314,7 @@ function html_select_options($options, $selected, $params = []) { $label = $label[$label_name]; } $select = in_array($value, $selected) ? ' selected="selected"' : ''; - $html .= '<option value="' . \OCP\Util::sanitizeHTML($value) . '"' . $select . '>' . \OCP\Util::sanitizeHTML($label) . '</option>'."\n"; + $html .= '<option value="' . \OCP\Util::sanitizeHTML($value) . '"' . $select . '>' . \OCP\Util::sanitizeHTML($label) . '</option>' . "\n"; } return $html; } diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php index 580288fbff7..1182f611b29 100644 --- a/lib/public/App/IAppManager.php +++ b/lib/public/App/IAppManager.php @@ -51,7 +51,7 @@ interface IAppManager { * @return string|null * @since 29.0.0 */ - public function getAppIcon(string $appId, bool $dark = false): string|null; + public function getAppIcon(string $appId, bool $dark = false): ?string; /** * Check if an app is enabled for user diff --git a/lib/public/AppFramework/AuthPublicShareController.php b/lib/public/AppFramework/AuthPublicShareController.php index b79f530dc4d..28a92fedcc9 100644 --- a/lib/public/AppFramework/AuthPublicShareController.php +++ b/lib/public/AppFramework/AuthPublicShareController.php @@ -192,7 +192,7 @@ abstract class AuthPublicShareController extends PublicShareController { if (str_ends_with($class, 'Controller')) { $class = substr($class, 0, -10); } - return $app .'.'. $class .'.'. $function; + return $app . '.' . $class . '.' . $function; } /** diff --git a/lib/public/AppFramework/Controller.php b/lib/public/AppFramework/Controller.php index 99fed5350e5..7c25b3382e7 100644 --- a/lib/public/AppFramework/Controller.php +++ b/lib/public/AppFramework/Controller.php @@ -135,7 +135,7 @@ abstract class Controller { return $responder($response); } - throw new \DomainException('No responder registered for format '. + throw new \DomainException('No responder registered for format ' . $format . '!'); } } diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index cd09a6b11b6..ef4516221e6 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -296,7 +296,7 @@ abstract class QBMapper { */ protected function mapRowToEntity(array $row): Entity { unset($row['DOCTRINE_ROWNUM']); // remove doctrine/dbal helper column - return \call_user_func($this->entityClass .'::fromRow', $row); + return \call_user_func($this->entityClass . '::fromRow', $row); } diff --git a/lib/public/AppFramework/Http/Attribute/AuthorizedAdminSetting.php b/lib/public/AppFramework/Http/Attribute/AuthorizedAdminSetting.php index e81f195b298..83101143fc9 100644 --- a/lib/public/AppFramework/Http/Attribute/AuthorizedAdminSetting.php +++ b/lib/public/AppFramework/Http/Attribute/AuthorizedAdminSetting.php @@ -25,7 +25,7 @@ class AuthorizedAdminSetting { * @since 27.0.0 */ public function __construct( - protected string $settings + protected string $settings, ) { } diff --git a/lib/public/AppFramework/Http/Attribute/BruteForceProtection.php b/lib/public/AppFramework/Http/Attribute/BruteForceProtection.php index 9fd97cdc3ed..0fc1a3b9b6d 100644 --- a/lib/public/AppFramework/Http/Attribute/BruteForceProtection.php +++ b/lib/public/AppFramework/Http/Attribute/BruteForceProtection.php @@ -23,7 +23,7 @@ class BruteForceProtection { * @since 27.0.0 */ public function __construct( - protected string $action + protected string $action, ) { } diff --git a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php index 0a6258be941..584191b9aaa 100644 --- a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php +++ b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php @@ -448,7 +448,7 @@ class EmptyContentSecurityPolicy { if ($this->strictDynamicAllowed) { $scriptSrc .= '\'strict-dynamic\' '; } - $scriptSrc .= '\'nonce-'.$this->jsNonce.'\''; + $scriptSrc .= '\'nonce-' . $this->jsNonce . '\''; $allowedScriptDomains = array_flip($this->allowedScriptDomains); unset($allowedScriptDomains['\'self\'']); $this->allowedScriptDomains = array_flip($allowedScriptDomains); diff --git a/lib/public/AppFramework/Http/Events/BeforeLoginTemplateRenderedEvent.php b/lib/public/AppFramework/Http/Events/BeforeLoginTemplateRenderedEvent.php index d18cad25acc..b724b3a72ad 100644 --- a/lib/public/AppFramework/Http/Events/BeforeLoginTemplateRenderedEvent.php +++ b/lib/public/AppFramework/Http/Events/BeforeLoginTemplateRenderedEvent.php @@ -20,7 +20,9 @@ class BeforeLoginTemplateRenderedEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private TemplateResponse $response) { + public function __construct( + private TemplateResponse $response, + ) { parent::__construct(); } diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php index 940f0f124e8..d1860402359 100644 --- a/lib/public/AppFramework/Http/Response.php +++ b/lib/public/AppFramework/Http/Response.php @@ -96,7 +96,7 @@ class Response { /** @var ITimeFactory $time */ $time = \OCP\Server::get(ITimeFactory::class); $expires->setTimestamp($time->getTime()); - $expires->add(new \DateInterval('PT'.$cacheSeconds.'S')); + $expires->add(new \DateInterval('PT' . $cacheSeconds . 'S')); $this->addHeader('Expires', $expires->format(\DateTimeInterface::RFC2822)); } else { $this->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); diff --git a/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengeFailed.php b/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengeFailed.php index 15e5ed92509..42ca855df35 100644 --- a/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengeFailed.php +++ b/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengeFailed.php @@ -20,7 +20,8 @@ class TwoFactorProviderChallengeFailed extends Event { */ public function __construct( private IUser $user, - private IProvider $provider) { + private IProvider $provider, + ) { parent::__construct(); } diff --git a/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengePassed.php b/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengePassed.php index 2dc91a98880..396fbf9e9a5 100644 --- a/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengePassed.php +++ b/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengePassed.php @@ -20,7 +20,8 @@ class TwoFactorProviderChallengePassed extends Event { */ public function __construct( private IUser $user, - private IProvider $provider) { + private IProvider $provider, + ) { parent::__construct(); } diff --git a/lib/public/AutoloadNotAllowedException.php b/lib/public/AutoloadNotAllowedException.php index 6e897b49406..a296ea3356a 100644 --- a/lib/public/AutoloadNotAllowedException.php +++ b/lib/public/AutoloadNotAllowedException.php @@ -18,6 +18,6 @@ class AutoloadNotAllowedException extends \DomainException { * @since 8.2.0 */ public function __construct($path) { - parent::__construct('Autoload path not allowed: '.$path); + parent::__construct('Autoload path not allowed: ' . $path); } } diff --git a/lib/public/Comments/ICommentsManager.php b/lib/public/Comments/ICommentsManager.php index af9d0fe61f0..0ff762e51d0 100644 --- a/lib/public/Comments/ICommentsManager.php +++ b/lib/public/Comments/ICommentsManager.php @@ -97,7 +97,7 @@ interface ICommentsManager { $objectId, $limit = 0, $offset = 0, - ?\DateTime $notOlderThan = null + ?\DateTime $notOlderThan = null, ); /** @@ -118,7 +118,7 @@ interface ICommentsManager { int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array; /** @@ -140,7 +140,7 @@ interface ICommentsManager { int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array; /** @@ -240,7 +240,7 @@ interface ICommentsManager { string $objectId, string $verb, string $actorType, - array $actors + array $actors, ): array; /** diff --git a/lib/public/Files/Events/Node/AbstractNodeEvent.php b/lib/public/Files/Events/Node/AbstractNodeEvent.php index 64b0e3a3aa5..7afb71277f6 100644 --- a/lib/public/Files/Events/Node/AbstractNodeEvent.php +++ b/lib/public/Files/Events/Node/AbstractNodeEvent.php @@ -21,7 +21,7 @@ abstract class AbstractNodeEvent extends Event implements IWebhookCompatibleEven * @since 20.0.0 */ public function __construct( - private Node $node + private Node $node, ) { } diff --git a/lib/public/Files/Events/Node/AbstractNodesEvent.php b/lib/public/Files/Events/Node/AbstractNodesEvent.php index 7941a9e596a..8fa8795d1df 100644 --- a/lib/public/Files/Events/Node/AbstractNodesEvent.php +++ b/lib/public/Files/Events/Node/AbstractNodesEvent.php @@ -22,7 +22,7 @@ abstract class AbstractNodesEvent extends Event implements IWebhookCompatibleEve */ public function __construct( private Node $source, - private Node $target + private Node $target, ) { } diff --git a/lib/public/Files/Lock/LockContext.php b/lib/public/Files/Lock/LockContext.php index 48d9f804fc4..5e61d3e2ec5 100644 --- a/lib/public/Files/Lock/LockContext.php +++ b/lib/public/Files/Lock/LockContext.php @@ -33,7 +33,7 @@ final class LockContext { public function __construct( Node $node, int $type, - string $owner + string $owner, ) { $this->node = $node; $this->type = $type; diff --git a/lib/public/Files/Template/Field.php b/lib/public/Files/Template/Field.php index dd65ef857ea..ec195ca3504 100644 --- a/lib/public/Files/Template/Field.php +++ b/lib/public/Files/Template/Field.php @@ -22,7 +22,7 @@ abstract class Field implements \JsonSerializable { */ public function __construct( private string $index, - private FieldType $type + private FieldType $type, ) { } diff --git a/lib/public/Files/Template/FieldFactory.php b/lib/public/Files/Template/FieldFactory.php index 4c0fff6b46f..f14d44a8573 100644 --- a/lib/public/Files/Template/FieldFactory.php +++ b/lib/public/Files/Template/FieldFactory.php @@ -21,7 +21,7 @@ class FieldFactory { */ public static function createField( string $index, - FieldType $type + FieldType $type, ): Field { return match ($type) { FieldType::RichText => new RichTextField($index, $type), diff --git a/lib/public/Files/Template/RegisterTemplateCreatorEvent.php b/lib/public/Files/Template/RegisterTemplateCreatorEvent.php index 4f739b1f9d3..c931f3e2a78 100644 --- a/lib/public/Files/Template/RegisterTemplateCreatorEvent.php +++ b/lib/public/Files/Template/RegisterTemplateCreatorEvent.php @@ -17,7 +17,7 @@ class RegisterTemplateCreatorEvent extends Event { * @since 30.0.0 */ public function __construct( - private ITemplateManager $templateManager + private ITemplateManager $templateManager, ) { } diff --git a/lib/public/Files/Template/TemplateFileCreator.php b/lib/public/Files/Template/TemplateFileCreator.php index b8174ec3ea0..9a4bd2fae43 100644 --- a/lib/public/Files/Template/TemplateFileCreator.php +++ b/lib/public/Files/Template/TemplateFileCreator.php @@ -34,7 +34,7 @@ final class TemplateFileCreator implements \JsonSerializable { * @since 21.0.0 */ public function __construct( - string $appId, string $actionName, string $fileExtension + string $appId, string $actionName, string $fileExtension, ) { $this->appId = $appId; $this->actionName = $actionName; diff --git a/lib/public/FilesMetadata/AMetadataEvent.php b/lib/public/FilesMetadata/AMetadataEvent.php index 637073a2ffd..8fef0d85db9 100644 --- a/lib/public/FilesMetadata/AMetadataEvent.php +++ b/lib/public/FilesMetadata/AMetadataEvent.php @@ -23,7 +23,7 @@ abstract class AMetadataEvent extends Event { */ public function __construct( protected Node $node, - protected IFilesMetadata $metadata + protected IFilesMetadata $metadata, ) { parent::__construct(); } diff --git a/lib/public/FilesMetadata/Event/MetadataNamedEvent.php b/lib/public/FilesMetadata/Event/MetadataNamedEvent.php index 6b40bc2f379..453eae1d6af 100644 --- a/lib/public/FilesMetadata/Event/MetadataNamedEvent.php +++ b/lib/public/FilesMetadata/Event/MetadataNamedEvent.php @@ -38,7 +38,7 @@ class MetadataNamedEvent extends AMetadataEvent { public function __construct( Node $node, IFilesMetadata $metadata, - private string $name = '' + private string $name = '', ) { parent::__construct($node, $metadata); } diff --git a/lib/public/FilesMetadata/IFilesMetadataManager.php b/lib/public/FilesMetadata/IFilesMetadataManager.php index ba2a5bd2450..4b1a6d32e8e 100644 --- a/lib/public/FilesMetadata/IFilesMetadataManager.php +++ b/lib/public/FilesMetadata/IFilesMetadataManager.php @@ -50,7 +50,7 @@ interface IFilesMetadataManager { public function refreshMetadata( Node $node, int $process = self::PROCESS_LIVE, - string $namedEvent = '' + string $namedEvent = '', ): IFilesMetadata; /** @@ -112,7 +112,7 @@ interface IFilesMetadataManager { public function getMetadataQuery( IQueryBuilder $qb, string $fileTableAlias, - string $fileIdField + string $fileIdField, ): IMetadataQuery; /** diff --git a/lib/public/INavigationManager.php b/lib/public/INavigationManager.php index d22e96aa9d3..2bd70c04d65 100644 --- a/lib/public/INavigationManager.php +++ b/lib/public/INavigationManager.php @@ -87,7 +87,7 @@ interface INavigationManager { * @param string $id ID of the navigation entry * @since 31.0.0 */ - public function get(string $id): array|null; + public function get(string $id): ?array; /** * Returns the id of the user's default entry diff --git a/lib/public/Log/RotationTrait.php b/lib/public/Log/RotationTrait.php index 1481ed71833..03100613c4c 100644 --- a/lib/public/Log/RotationTrait.php +++ b/lib/public/Log/RotationTrait.php @@ -29,7 +29,7 @@ trait RotationTrait { * @since 14.0.0 */ protected function rotate():string { - $rotatedFile = $this->filePath.'.1'; + $rotatedFile = $this->filePath . '.1'; rename($this->filePath, $rotatedFile); return $rotatedFile; } diff --git a/lib/public/Mail/Provider/Address.php b/lib/public/Mail/Provider/Address.php index 44a5544ee4b..751fb99d930 100644 --- a/lib/public/Mail/Provider/Address.php +++ b/lib/public/Mail/Provider/Address.php @@ -28,7 +28,7 @@ class Address implements \OCP\Mail\Provider\IAddress { */ public function __construct( protected ?string $address = null, - protected ?string $label = null + protected ?string $label = null, ) { } @@ -53,7 +53,7 @@ class Address implements \OCP\Mail\Provider\IAddress { * * @return string|null returns the mail address or null if one is not set */ - public function getAddress(): string|null { + public function getAddress(): ?string { return $this->address; } @@ -78,7 +78,7 @@ class Address implements \OCP\Mail\Provider\IAddress { * * @return string|null returns the mail address label/name or null if one is not set */ - public function getLabel(): string|null { + public function getLabel(): ?string { return $this->label; } diff --git a/lib/public/Mail/Provider/Attachment.php b/lib/public/Mail/Provider/Attachment.php index cb7b9b0d241..af7340a3ccf 100644 --- a/lib/public/Mail/Provider/Attachment.php +++ b/lib/public/Mail/Provider/Attachment.php @@ -32,7 +32,7 @@ class Attachment implements \OCP\Mail\Provider\IAttachment { protected ?string $contents, protected ?string $name, protected ?string $type, - protected bool $embedded = false + protected bool $embedded = false, ) { } @@ -57,7 +57,7 @@ class Attachment implements \OCP\Mail\Provider\IAttachment { * * @return string | null returns the attachment file name or null if not set */ - public function getName(): string|null { + public function getName(): ?string { return $this->name; } @@ -82,7 +82,7 @@ class Attachment implements \OCP\Mail\Provider\IAttachment { * * @return string | null returns the attachment mime type or null if not set */ - public function getType(): string|null { + public function getType(): ?string { return $this->type; } @@ -107,7 +107,7 @@ class Attachment implements \OCP\Mail\Provider\IAttachment { * * @return string | null returns the attachment contents or null if not set */ - public function getContents(): string|null { + public function getContents(): ?string { return $this->contents; } diff --git a/lib/public/Mail/Provider/IAddress.php b/lib/public/Mail/Provider/IAddress.php index b5748a51cc0..121467390dc 100644 --- a/lib/public/Mail/Provider/IAddress.php +++ b/lib/public/Mail/Provider/IAddress.php @@ -36,7 +36,7 @@ interface IAddress { * * @return string returns the mail address */ - public function getAddress(): string|null; + public function getAddress(): ?string; /** * sets the mail address label/name @@ -56,6 +56,6 @@ interface IAddress { * * @return string returns the mail address label/name */ - public function getLabel(): string|null; + public function getLabel(): ?string; } diff --git a/lib/public/Mail/Provider/IAttachment.php b/lib/public/Mail/Provider/IAttachment.php index e27f5ee066b..ff266994919 100644 --- a/lib/public/Mail/Provider/IAttachment.php +++ b/lib/public/Mail/Provider/IAttachment.php @@ -36,7 +36,7 @@ interface IAttachment { * * @return string | null returns the attachment file name or null if one is not set */ - public function getName(): string|null; + public function getName(): ?string; /** * sets the attachment mime type @@ -56,7 +56,7 @@ interface IAttachment { * * @return string | null returns the attachment mime type or null if not set */ - public function getType(): string|null; + public function getType(): ?string; /** * sets the attachment contents (actual data) @@ -76,7 +76,7 @@ interface IAttachment { * * @return string | null returns the attachment contents or null if not set */ - public function getContents(): string|null; + public function getContents(): ?string; /** * sets the embedded status of the attachment diff --git a/lib/public/Mail/Provider/IManager.php b/lib/public/Mail/Provider/IManager.php index ff01f93d2a4..3c639ef21ef 100644 --- a/lib/public/Mail/Provider/IManager.php +++ b/lib/public/Mail/Provider/IManager.php @@ -63,7 +63,7 @@ interface IManager { * * @return IProvider|null */ - public function findProviderById(string $providerId): IProvider|null; + public function findProviderById(string $providerId): ?IProvider; /** * retrieve all services for all registered mail providers @@ -87,7 +87,7 @@ interface IManager { * * @return IService|null returns service object or null if none found */ - public function findServiceById(string $userId, string $serviceId, ?string $providerId = null): IService|null; + public function findServiceById(string $userId, string $serviceId, ?string $providerId = null): ?IService; /** * retrieve a service for a specific mail address @@ -101,6 +101,6 @@ interface IManager { * * @return IService|null returns service object or null if none found */ - public function findServiceByAddress(string $userId, string $address, ?string $providerId = null): IService|null; + public function findServiceByAddress(string $userId, string $address, ?string $providerId = null): ?IService; } diff --git a/lib/public/Mail/Provider/IMessage.php b/lib/public/Mail/Provider/IMessage.php index 2ad3b422b9d..e3dfbe6981d 100644 --- a/lib/public/Mail/Provider/IMessage.php +++ b/lib/public/Mail/Provider/IMessage.php @@ -45,7 +45,7 @@ interface IMessage { * * @return IAddress|null sender's mail address object */ - public function getFrom(): IAddress|null; + public function getFrom(): ?IAddress; /** * sets the sender's reply to address of this message @@ -65,7 +65,7 @@ interface IMessage { * * @return IAddress|null sender's reply to mail address object */ - public function getReplyTo(): IAddress|null; + public function getReplyTo(): ?IAddress; /** * sets the recipient(s) of this message @@ -145,7 +145,7 @@ interface IMessage { * * @return string|null subject of message or null if one is not set */ - public function getSubject(): string|null; + public function getSubject(): ?string; /** * sets the plain text or html body of this message @@ -168,7 +168,7 @@ interface IMessage { * * @return string|null html/plain body of this message or null if one is not set */ - public function getBody(): string|null; + public function getBody(): ?string; /** * sets the html body of this message @@ -188,7 +188,7 @@ interface IMessage { * * @return string|null html body of this message or null if one is not set */ - public function getBodyHtml(): string|null; + public function getBodyHtml(): ?string; /** * sets the plain text body of this message @@ -208,7 +208,7 @@ interface IMessage { * * @return string|null plain text body of this message or null if one is not set */ - public function getBodyPlain(): string|null; + public function getBodyPlain(): ?string; /** * sets the attachments of this message diff --git a/lib/public/Mail/Provider/IProvider.php b/lib/public/Mail/Provider/IProvider.php index e94ee73217a..d89022d7cbf 100644 --- a/lib/public/Mail/Provider/IProvider.php +++ b/lib/public/Mail/Provider/IProvider.php @@ -68,7 +68,7 @@ interface IProvider { * * @return IService|null returns service object or null if none found */ - public function findServiceById(string $userId, string $serviceId): IService|null; + public function findServiceById(string $userId, string $serviceId): ?IService; /** * retrieve a service for a specific mail address @@ -80,7 +80,7 @@ interface IProvider { * * @return IService|null returns service object or null if none found */ - public function findServiceByAddress(string $userId, string $address): IService|null; + public function findServiceByAddress(string $userId, string $address): ?IService; /** * construct a new empty service object diff --git a/lib/public/Mail/Provider/Message.php b/lib/public/Mail/Provider/Message.php index 7814fb849d5..f7a21c05ed3 100644 --- a/lib/public/Mail/Provider/Message.php +++ b/lib/public/Mail/Provider/Message.php @@ -65,7 +65,7 @@ class Message implements \OCP\Mail\Provider\IMessage { * * @return IAddress|null sender's mail address object */ - public function getFrom(): IAddress|null { + public function getFrom(): ?IAddress { // evaluate if data store field exists and return value(s) or null otherwise return (isset($this->data['from'])) ? $this->data['from'] : null; } @@ -93,7 +93,7 @@ class Message implements \OCP\Mail\Provider\IMessage { * * @return IAddress|null sender's reply to mail address object */ - public function getReplyTo(): IAddress|null { + public function getReplyTo(): ?IAddress { // evaluate if data store field exists and return value(s) or null otherwise return (isset($this->data['replyTo'])) ? $this->data['replyTo'] : null; } @@ -205,7 +205,7 @@ class Message implements \OCP\Mail\Provider\IMessage { * * @return string|null subject of message or null if one is not set */ - public function getSubject(): string|null { + public function getSubject(): ?string { // evaluate if data store field exists and return value(s) or null otherwise return (isset($this->data['subject'])) ? $this->data['subject'] : null; } @@ -240,7 +240,7 @@ class Message implements \OCP\Mail\Provider\IMessage { * * @return string|null html/plain body of this message or null if one is not set */ - public function getBody(): string|null { + public function getBody(): ?string { // evaluate if data store field(s) exists and return value if (isset($this->data['bodyHtml'])) { return $this->data['bodyHtml']; @@ -274,7 +274,7 @@ class Message implements \OCP\Mail\Provider\IMessage { * * @return string|null html body of this message or null if one is not set */ - public function getBodyHtml(): string|null { + public function getBodyHtml(): ?string { // evaluate if data store field exists and return value(s) or null otherwise return (isset($this->data['bodyHtml'])) ? $this->data['bodyHtml'] : null; } @@ -302,7 +302,7 @@ class Message implements \OCP\Mail\Provider\IMessage { * * @return string|null plain text body of this message or null if one is not set */ - public function getBodyPlain(): string|null { + public function getBodyPlain(): ?string { // evaluate if data store field exists and return value(s) or null otherwise return (isset($this->data['bodyPlain'])) ? $this->data['bodyPlain'] : null; } diff --git a/lib/public/Migration/Attributes/GenericMigrationAttribute.php b/lib/public/Migration/Attributes/GenericMigrationAttribute.php index 6f187635ff7..e63f78088e8 100644 --- a/lib/public/Migration/Attributes/GenericMigrationAttribute.php +++ b/lib/public/Migration/Attributes/GenericMigrationAttribute.php @@ -22,7 +22,7 @@ class GenericMigrationAttribute extends MigrationAttribute implements JsonSerial * @since 30.0.0 */ public function __construct( - private readonly array $details = [] + private readonly array $details = [], ) { parent::__construct( $details['table'] ?? '', diff --git a/lib/public/Preview/IMimeIconProvider.php b/lib/public/Preview/IMimeIconProvider.php index da4896bec87..4a407f48577 100644 --- a/lib/public/Preview/IMimeIconProvider.php +++ b/lib/public/Preview/IMimeIconProvider.php @@ -18,5 +18,5 @@ interface IMimeIconProvider { * if no preview is available. * @since 28.0.0 */ - public function getMimeIconUrl(string $mime): string|null; + public function getMimeIconUrl(string $mime): ?string; } diff --git a/lib/public/Settings/Events/DeclarativeSettingsRegisterFormEvent.php b/lib/public/Settings/Events/DeclarativeSettingsRegisterFormEvent.php index 951e4ad9298..e861afdd580 100644 --- a/lib/public/Settings/Events/DeclarativeSettingsRegisterFormEvent.php +++ b/lib/public/Settings/Events/DeclarativeSettingsRegisterFormEvent.php @@ -22,7 +22,9 @@ class DeclarativeSettingsRegisterFormEvent extends Event { /** * @since 29.0.0 */ - public function __construct(private IDeclarativeManager $manager) { + public function __construct( + private IDeclarativeManager $manager, + ) { parent::__construct(); } diff --git a/lib/public/Share/IShare.php b/lib/public/Share/IShare.php index c2843c078e3..cdad084ac92 100644 --- a/lib/public/Share/IShare.php +++ b/lib/public/Share/IShare.php @@ -368,7 +368,7 @@ interface IShare { * @return \OCP\Share\IShare The modified object * @since 9.0.0 */ - public function setExpirationDate(\DateTime|null $expireDate); + public function setExpirationDate(?\DateTime $expireDate); /** * Get the expiration date diff --git a/lib/public/TaskProcessing/Events/AbstractTaskProcessingEvent.php b/lib/public/TaskProcessing/Events/AbstractTaskProcessingEvent.php index 84dbb8915f8..55f33327e9f 100644 --- a/lib/public/TaskProcessing/Events/AbstractTaskProcessingEvent.php +++ b/lib/public/TaskProcessing/Events/AbstractTaskProcessingEvent.php @@ -19,7 +19,7 @@ abstract class AbstractTaskProcessingEvent extends Event { * @since 30.0.0 */ public function __construct( - private readonly Task $task + private readonly Task $task, ) { parent::__construct(); } diff --git a/lib/public/TaskProcessing/IManager.php b/lib/public/TaskProcessing/IManager.php index c26a5d67339..2d5fe1d9ba6 100644 --- a/lib/public/TaskProcessing/IManager.php +++ b/lib/public/TaskProcessing/IManager.php @@ -182,7 +182,7 @@ interface IManager { */ public function getTasks( ?string $userId, ?string $taskTypeId = null, ?string $appId = null, ?string $customId = null, - ?int $status = null, ?int $scheduleAfter = null, ?int $endedBefore = null + ?int $status = null, ?int $scheduleAfter = null, ?int $endedBefore = null, ): array; /** diff --git a/lib/public/Teams/Team.php b/lib/public/Teams/Team.php index 07fc3f9ccd3..8ece28bf648 100644 --- a/lib/public/Teams/Team.php +++ b/lib/public/Teams/Team.php @@ -18,7 +18,11 @@ class Team implements \JsonSerializable { /** * @since 29.0.0 */ - public function __construct(private string $teamId, private string $displayName, private ?string $link) { + public function __construct( + private string $teamId, + private string $displayName, + private ?string $link, + ) { } /** diff --git a/lib/public/TextProcessing/Events/AbstractTextProcessingEvent.php b/lib/public/TextProcessing/Events/AbstractTextProcessingEvent.php index e42f64ca28c..8b944254020 100644 --- a/lib/public/TextProcessing/Events/AbstractTextProcessingEvent.php +++ b/lib/public/TextProcessing/Events/AbstractTextProcessingEvent.php @@ -20,7 +20,7 @@ abstract class AbstractTextProcessingEvent extends Event { * @since 27.1.0 */ public function __construct( - private Task $task + private Task $task, ) { parent::__construct(); } diff --git a/lib/public/TextToImage/Events/AbstractTextToImageEvent.php b/lib/public/TextToImage/Events/AbstractTextToImageEvent.php index 75920487412..df850e1be33 100644 --- a/lib/public/TextToImage/Events/AbstractTextToImageEvent.php +++ b/lib/public/TextToImage/Events/AbstractTextToImageEvent.php @@ -21,7 +21,7 @@ abstract class AbstractTextToImageEvent extends Event { * @since 28.0.0 */ public function __construct( - private Task $task + private Task $task, ) { parent::__construct(); } diff --git a/lib/public/Translation/LanguageTuple.php b/lib/public/Translation/LanguageTuple.php index 883daa01da3..07507ece687 100644 --- a/lib/public/Translation/LanguageTuple.php +++ b/lib/public/Translation/LanguageTuple.php @@ -24,7 +24,7 @@ class LanguageTuple implements JsonSerializable { private string $from, private string $fromLabel, private string $to, - private string $toLabel + private string $toLabel, ) { } diff --git a/lib/public/User/Events/OutOfOfficeChangedEvent.php b/lib/public/User/Events/OutOfOfficeChangedEvent.php index b1cdb3abdd7..10865ef7ed5 100644 --- a/lib/public/User/Events/OutOfOfficeChangedEvent.php +++ b/lib/public/User/Events/OutOfOfficeChangedEvent.php @@ -21,7 +21,9 @@ class OutOfOfficeChangedEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private IOutOfOfficeData $data) { + public function __construct( + private IOutOfOfficeData $data, + ) { parent::__construct(); } diff --git a/lib/public/User/Events/OutOfOfficeClearedEvent.php b/lib/public/User/Events/OutOfOfficeClearedEvent.php index 3eb8a9016e7..4153ce98ab5 100644 --- a/lib/public/User/Events/OutOfOfficeClearedEvent.php +++ b/lib/public/User/Events/OutOfOfficeClearedEvent.php @@ -21,7 +21,9 @@ class OutOfOfficeClearedEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private IOutOfOfficeData $data) { + public function __construct( + private IOutOfOfficeData $data, + ) { parent::__construct(); } diff --git a/lib/public/User/Events/OutOfOfficeEndedEvent.php b/lib/public/User/Events/OutOfOfficeEndedEvent.php index e5cbc174d09..0817994f069 100644 --- a/lib/public/User/Events/OutOfOfficeEndedEvent.php +++ b/lib/public/User/Events/OutOfOfficeEndedEvent.php @@ -19,7 +19,9 @@ class OutOfOfficeEndedEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private IOutOfOfficeData $data) { + public function __construct( + private IOutOfOfficeData $data, + ) { parent::__construct(); } diff --git a/lib/public/User/Events/OutOfOfficeScheduledEvent.php b/lib/public/User/Events/OutOfOfficeScheduledEvent.php index 0cf071baf59..f830d2af209 100644 --- a/lib/public/User/Events/OutOfOfficeScheduledEvent.php +++ b/lib/public/User/Events/OutOfOfficeScheduledEvent.php @@ -21,7 +21,9 @@ class OutOfOfficeScheduledEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private IOutOfOfficeData $data) { + public function __construct( + private IOutOfOfficeData $data, + ) { parent::__construct(); } diff --git a/lib/public/User/Events/OutOfOfficeStartedEvent.php b/lib/public/User/Events/OutOfOfficeStartedEvent.php index 9550f5072e0..1b5c69b3cfb 100644 --- a/lib/public/User/Events/OutOfOfficeStartedEvent.php +++ b/lib/public/User/Events/OutOfOfficeStartedEvent.php @@ -19,7 +19,9 @@ class OutOfOfficeStartedEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private IOutOfOfficeData $data) { + public function __construct( + private IOutOfOfficeData $data, + ) { parent::__construct(); } diff --git a/lib/public/UserMigration/IMigrator.php b/lib/public/UserMigration/IMigrator.php index 3083233a4c4..8ce2cca8f98 100644 --- a/lib/public/UserMigration/IMigrator.php +++ b/lib/public/UserMigration/IMigrator.php @@ -25,7 +25,7 @@ interface IMigrator { public function export( IUser $user, IExportDestination $exportDestination, - OutputInterface $output + OutputInterface $output, ): void; /** @@ -37,7 +37,7 @@ interface IMigrator { public function import( IUser $user, IImportSource $importSource, - OutputInterface $output + OutputInterface $output, ): void; /** @@ -75,6 +75,6 @@ interface IMigrator { * @since 24.0.0 */ public function canImport( - IImportSource $importSource + IImportSource $importSource, ): bool; } diff --git a/lib/public/UserMigration/TMigratorBasicVersionHandling.php b/lib/public/UserMigration/TMigratorBasicVersionHandling.php index f679c8e87ae..b33425a023d 100644 --- a/lib/public/UserMigration/TMigratorBasicVersionHandling.php +++ b/lib/public/UserMigration/TMigratorBasicVersionHandling.php @@ -31,7 +31,7 @@ trait TMigratorBasicVersionHandling { * @since 24.0.0 */ public function canImport( - IImportSource $importSource + IImportSource $importSource, ): bool { $version = $importSource->getMigratorVersion($this->getId()); if ($version === null) { diff --git a/lib/public/Util.php b/lib/public/Util.php index 4bd2c61dfbe..520e4616de5 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -302,7 +302,7 @@ class Util { $user_part = $config->getSystemValueString('mail_from_address', $user_part); $host_name = self::getServerHostName(); $host_name = $config->getSystemValueString('mail_domain', $host_name); - $defaultEmailAddress = $user_part.'@'.$host_name; + $defaultEmailAddress = $user_part . '@' . $host_name; $mailer = \OC::$server->get(IMailer::class); if ($mailer->validateMailAddress($defaultEmailAddress)) { @@ -310,7 +310,7 @@ class Util { } // in case we cannot build a valid email address from the hostname let's fallback to 'localhost.localdomain' - return $user_part.'@localhost.localdomain'; + return $user_part . '@localhost.localdomain'; } /** diff --git a/ocs/providers.php b/ocs/providers.php index af9863a32f2..6333a91fdb2 100644 --- a/ocs/providers.php +++ b/ocs/providers.php @@ -11,7 +11,7 @@ header('Content-type: application/xml'); $request = \OC::$server->getRequest(); -$url = $request->getServerProtocol() . '://' . substr($request->getServerHost() . $request->getRequestUri(), 0, -17).'ocs/v1.php/'; +$url = $request->getServerProtocol() . '://' . substr($request->getServerHost() . $request->getRequestUri(), 0, -17) . 'ocs/v1.php/'; $writer = new XMLWriter(); $writer->openURI('php://output'); diff --git a/ocs/v1.php b/ocs/v1.php index 90d7971c549..7205f4a26b7 100644 --- a/ocs/v1.php +++ b/ocs/v1.php @@ -46,12 +46,12 @@ try { OC::handleLogin(\OC::$server->getRequest()); } - OC::$server->get(\OC\Route\Router::class)->match('/ocsapp'.\OC::$server->getRequest()->getRawPathInfo()); + OC::$server->get(\OC\Route\Router::class)->match('/ocsapp' . \OC::$server->getRequest()->getRawPathInfo()); } catch (MaxDelayReached $ex) { ApiHelper::respond(Http::STATUS_TOO_MANY_REQUESTS, $ex->getMessage()); } catch (ResourceNotFoundException $e) { $txt = 'Invalid query, please check the syntax. API specifications are here:' - .' http://www.freedesktop.org/wiki/Specifications/open-collaboration-services.'."\n"; + . ' http://www.freedesktop.org/wiki/Specifications/open-collaboration-services.' . "\n"; ApiHelper::respond(OCSController::RESPOND_NOT_FOUND, $txt); } catch (MethodNotAllowedException $e) { ApiHelper::setContentType(); @@ -61,7 +61,7 @@ try { } catch (\Exception $e) { \OCP\Server::get(LoggerInterface::class)->error($e->getMessage(), ['exception' => $e]); - $txt = 'Internal Server Error'."\n"; + $txt = 'Internal Server Error' . "\n"; try { if (\OC::$server->getSystemConfig()->getValue('debug', false)) { $txt .= $e->getMessage(); diff --git a/public.php b/public.php index d9320227dfd..f6d0b0a7940 100644 --- a/public.php +++ b/public.php @@ -78,7 +78,7 @@ try { OC_App::loadApp($app); OC_User::setIncognitoMode(true); - $baseuri = OC::$WEBROOT . '/public.php/'.$service.'/'; + $baseuri = OC::$WEBROOT . '/public.php/' . $service . '/'; require_once $file; } catch (Exception $ex) { $status = 500; diff --git a/remote.php b/remote.php index 9b56e6c97f9..bc97de7bcb3 100644 --- a/remote.php +++ b/remote.php @@ -131,17 +131,17 @@ try { switch ($app) { case 'core': - $file = OC::$SERVERROOT .'/'. $file; + $file = OC::$SERVERROOT . '/' . $file; break; default: if (!$appManager->isInstalled($app)) { throw new RemoteException('App not installed: ' . $app); } $appManager->loadApp($app); - $file = $appManager->getAppPath($app) .'/'. ($parts[1] ?? ''); + $file = $appManager->getAppPath($app) . '/' . ($parts[1] ?? ''); break; } - $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; + $baseuri = OC::$WEBROOT . '/remote.php/' . $service . '/'; require_once $file; } catch (Exception $ex) { handleException($ex); diff --git a/tests/Core/Command/Log/FileTest.php b/tests/Core/Command/Log/FileTest.php index 08ff01e019d..9c7e0297d53 100644 --- a/tests/Core/Command/Log/FileTest.php +++ b/tests/Core/Command/Log/FileTest.php @@ -91,7 +91,7 @@ class FileTest extends TestCase { $this->config->method('getSystemValue') ->willReturnMap([ ['log_type', 'file', 'log_type_value'], - ['datadirectory', \OC::$SERVERROOT.'/data', '/data/directory/'], + ['datadirectory', \OC::$SERVERROOT . '/data', '/data/directory/'], ['logfile', '/data/directory/nextcloud.log', '/var/log/nextcloud.log'], ['log_rotate_size', 100 * 1024 * 1024, 5 * 1024 * 1024], ]); diff --git a/tests/Core/Command/Maintenance/ModeTest.php b/tests/Core/Command/Maintenance/ModeTest.php index 59b8bbfc045..a4c33474745 100644 --- a/tests/Core/Command/Maintenance/ModeTest.php +++ b/tests/Core/Command/Maintenance/ModeTest.php @@ -123,7 +123,7 @@ class ModeTest extends TestCase { string $option, bool $currentMaintenanceState, $expectedMaintenanceState, - string $expectedOutput + string $expectedOutput, ): void { $this->config->expects($this->any()) ->method('getSystemValueBool') diff --git a/tests/Core/Command/SystemTag/AddTest.php b/tests/Core/Command/SystemTag/AddTest.php index 4dd0df7ffe0..7ae832e4079 100644 --- a/tests/Core/Command/SystemTag/AddTest.php +++ b/tests/Core/Command/SystemTag/AddTest.php @@ -95,7 +95,7 @@ class AddTest extends TestCase { $this->systemTagManager->method('createTag') ->willReturnCallback(function ($tagName, $userVisible, $userAssignable) { throw new TagAlreadyExistsException( - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists' + 'Tag ("' . $tagName . '", ' . $userVisible . ', ' . $userAssignable . ') already exists' ); }); diff --git a/tests/Core/Command/SystemTag/EditTest.php b/tests/Core/Command/SystemTag/EditTest.php index 1857da25ab0..f2695591905 100644 --- a/tests/Core/Command/SystemTag/EditTest.php +++ b/tests/Core/Command/SystemTag/EditTest.php @@ -87,7 +87,7 @@ class EditTest extends TestCase { $this->output->expects($this->once()) ->method('writeln') ->with( - '<info>Tag updated ("'.$newTagName.'", '.$newTagUserVisible.', '.$newTagUserAssignable.')</info>' + '<info>Tag updated ("' . $newTagName . '", ' . $newTagUserVisible . ', ' . $newTagUserAssignable . ')</info>' ); $this->invokePrivate($this->command, 'execute', [$this->input, $this->output]); @@ -135,7 +135,7 @@ class EditTest extends TestCase { $this->systemTagManager->method('updateTag') ->willReturnCallback(function ($tagId, $tagName, $userVisible, $userAssignable) { throw new TagAlreadyExistsException( - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists' + 'Tag ("' . $tagName . '", ' . $userVisible . ', ' . $userAssignable . ') already exists' ); }); @@ -151,7 +151,7 @@ class EditTest extends TestCase { $this->output->expects($this->once()) ->method('writeln') ->with( - '<error>Tag ("' . $newTagName . '", '. $newTagUserVisible . ', ' . $newTagUserAssignable . ') already exists</error>' + '<error>Tag ("' . $newTagName . '", ' . $newTagUserVisible . ', ' . $newTagUserAssignable . ') already exists</error>' ); $this->invokePrivate($this->command, 'execute', [$this->input, $this->output]); diff --git a/tests/Core/Controller/AppPasswordControllerTest.php b/tests/Core/Controller/AppPasswordControllerTest.php index f0246561145..b33033edac3 100644 --- a/tests/Core/Controller/AppPasswordControllerTest.php +++ b/tests/Core/Controller/AppPasswordControllerTest.php @@ -128,7 +128,7 @@ class AppPasswordControllerTest extends TestCase { $this->random->method('generate') ->with( 72, - ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS )->willReturn('myToken'); $this->tokenProvider->expects($this->once()) @@ -169,7 +169,7 @@ class AppPasswordControllerTest extends TestCase { $this->random->method('generate') ->with( 72, - ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS )->willReturn('myToken'); $this->tokenProvider->expects($this->once()) diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php index 3a1123c940b..0dca611b020 100644 --- a/tests/Core/Controller/AvatarControllerTest.php +++ b/tests/Core/Controller/AvatarControllerTest.php @@ -309,7 +309,7 @@ class AvatarControllerTest extends \Test\TestCase { * Fetch tmp avatar */ public function testTmpAvatarValid(): void { - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $response = $this->avatarController->getTmpAvatar(); $this->assertEquals(Http::STATUS_OK, $response->getStatus()); @@ -331,14 +331,14 @@ class AvatarControllerTest extends \Test\TestCase { public function testPostAvatarFile(): void { //Create temp file $fileName = tempnam('', 'avatarTest'); - $copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.jpg', $fileName); + $copyRes = copy(\OC::$SERVERROOT . '/tests/data/testimage.jpg', $fileName); $this->assertTrue($copyRes); //Create file in cache - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); //Create request return - $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT.'/tests/data/testimage.jpg')]]; + $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT . '/tests/data/testimage.jpg')]]; $this->request->method('getUploadedFile')->willReturn($reqRet); $response = $this->avatarController->postAvatar(null); @@ -369,14 +369,14 @@ class AvatarControllerTest extends \Test\TestCase { public function testPostAvatarFileGif(): void { //Create temp file $fileName = tempnam('', 'avatarTest'); - $copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.gif', $fileName); + $copyRes = copy(\OC::$SERVERROOT . '/tests/data/testimage.gif', $fileName); $this->assertTrue($copyRes); //Create file in cache - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.gif')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.gif')); //Create request return - $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT.'/tests/data/testimage.gif')]]; + $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT . '/tests/data/testimage.gif')]]; $this->request->method('getUploadedFile')->willReturn($reqRet); $response = $this->avatarController->postAvatar(null); @@ -396,7 +396,7 @@ class AvatarControllerTest extends \Test\TestCase { ->disableOriginalConstructor()->getMock(); $file->expects($this->once()) ->method('getContent') - ->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + ->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $file->expects($this->once()) ->method('getMimeType') ->willReturn('image/jpeg'); @@ -474,7 +474,7 @@ class AvatarControllerTest extends \Test\TestCase { ->disableOriginalConstructor()->getMock(); $file->expects($this->once()) ->method('getContent') - ->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + ->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $file->expects($this->once()) ->method('getMimeType') ->willReturn('image/jpeg'); @@ -512,7 +512,7 @@ class AvatarControllerTest extends \Test\TestCase { * Test with non square crop */ public function testPostCroppedAvatarNoSquareCrop(): void { - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->avatarMock->method('set')->will($this->throwException(new \OC\NotSquareException)); $this->avatarManager->method('getAvatar')->willReturn($this->avatarMock); @@ -525,7 +525,7 @@ class AvatarControllerTest extends \Test\TestCase { * Check for proper reply on proper crop argument */ public function testPostCroppedAvatarValidCrop(): void { - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->avatarManager->method('getAvatar')->willReturn($this->avatarMock); $response = $this->avatarController->postCroppedAvatar(['x' => 0, 'y' => 0, 'w' => 10, 'h' => 10]); @@ -537,7 +537,7 @@ class AvatarControllerTest extends \Test\TestCase { * Test what happens if the cropping of the avatar fails */ public function testPostCroppedAvatarException(): void { - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->avatarMock->method('set')->will($this->throwException(new \Exception('foo'))); $this->avatarManager->method('getAvatar')->willReturn($this->avatarMock); @@ -554,7 +554,7 @@ class AvatarControllerTest extends \Test\TestCase { * Check for proper reply on proper crop argument */ public function testFileTooBig(): void { - $fileName = \OC::$SERVERROOT.'/tests/data/testimage.jpg'; + $fileName = \OC::$SERVERROOT . '/tests/data/testimage.jpg'; //Create request return $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [21 * 1024 * 1024]]; $this->request->method('getUploadedFile')->willReturn($reqRet); diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php index a38f73c85a6..7f9f11db7e3 100644 --- a/tests/Core/Controller/ClientFlowLoginControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php @@ -137,7 +137,7 @@ class ClientFlowLoginControllerTest extends TestCase { ->method('generate') ->with( 64, - ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS ) ->willReturn('StateToken'); $this->session @@ -207,7 +207,7 @@ class ClientFlowLoginControllerTest extends TestCase { ->method('generate') ->with( 64, - ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS ) ->willReturn('StateToken'); $this->session @@ -448,8 +448,8 @@ class ClientFlowLoginControllerTest extends TestCase { [128] ) ->willReturnMap([ - [72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS, 'MyGeneratedToken'], - [128, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS, 'MyAccessCode'], + [72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS, 'MyGeneratedToken'], + [128, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS, 'MyAccessCode'], ]); $user = $this->createMock(IUser::class); $user diff --git a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php index 093b8a3442d..98c7821791d 100644 --- a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php @@ -161,7 +161,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase { ->willReturn($flow); $this->random->method('generate') - ->with(64, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS) + ->with(64, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS) ->willReturn('random'); $this->session->expects($this->once()) ->method('set') diff --git a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php index 2fb61a2ef08..1c31efee8f7 100644 --- a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php +++ b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php @@ -296,7 +296,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase { $this->secureRandom->expects($this->once()) ->method('generate') - ->with(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS) + ->with(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS) ->willReturn('test_pass'); // session token diff --git a/tests/enable_all.php b/tests/enable_all.php index db01de6ec41..54e5614e55a 100644 --- a/tests/enable_all.php +++ b/tests/enable_all.php @@ -5,7 +5,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -require_once __DIR__.'/../lib/base.php'; +require_once __DIR__ . '/../lib/base.php'; function enableApp($app) { try { diff --git a/tests/lib/AllConfigTest.php b/tests/lib/AllConfigTest.php index f8b2e8e857f..5d2091780a0 100644 --- a/tests/lib/AllConfigTest.php +++ b/tests/lib/AllConfigTest.php @@ -231,7 +231,7 @@ class AllConfigTest extends \Test\TestCase { $connectionMock = $this->createMock(IDBConnection::class); $connectionMock->expects($this->once()) ->method('executeQuery') - ->with($this->equalTo('SELECT `configvalue` FROM `*PREFIX*preferences` '. + ->with($this->equalTo('SELECT `configvalue` FROM `*PREFIX*preferences` ' . 'WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?'), $this->equalTo(['userSetUnchanged', 'appSetUnchanged', 'keySetUnchanged'])) ->willReturn($resultMock); diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php index 5c79a75bf0d..266a60bf159 100644 --- a/tests/lib/App/AppManagerTest.php +++ b/tests/lib/App/AppManagerTest.php @@ -142,7 +142,7 @@ class AppManagerTest extends TestCase { /** * @dataProvider dataGetAppIcon */ - public function testGetAppIcon($callback, ?bool $dark, string|null $expected): void { + public function testGetAppIcon($callback, ?bool $dark, ?string $expected): void { $this->urlGenerator->expects($this->atLeastOnce()) ->method('imagePath') ->willReturnCallback($callback); diff --git a/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php b/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php index fdc8b45cf70..e7652d5c50c 100644 --- a/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php +++ b/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php @@ -74,7 +74,7 @@ class AppDiscoverFetcherTest extends FetcherBase { /** * @dataProvider dataGetETag */ - public function testGetEtag(string|null $expected, bool $throws, string $content = ''): void { + public function testGetEtag(?string $expected, bool $throws, string $content = ''): void { $folder = $this->createMock(ISimpleFolder::class); if (!$throws) { $file = $this->createMock(ISimpleFile::class); diff --git a/tests/lib/App/InfoParserTest.php b/tests/lib/App/InfoParserTest.php index 914741d05b1..66ff10266e2 100644 --- a/tests/lib/App/InfoParserTest.php +++ b/tests/lib/App/InfoParserTest.php @@ -26,7 +26,7 @@ class InfoParserTest extends TestCase { if (!is_null($expectedJson)) { $expectedData = json_decode(file_get_contents(OC::$SERVERROOT . "/tests/data/app/$expectedJson"), true); } - $data = $parser->parse(OC::$SERVERROOT. "/tests/data/app/$xmlFile"); + $data = $parser->parse(OC::$SERVERROOT . "/tests/data/app/$xmlFile"); $this->assertEquals($expectedData, $data); } diff --git a/tests/lib/AppConfigTest.php b/tests/lib/AppConfigTest.php index e6929484dc5..e8c10fe654b 100644 --- a/tests/lib/AppConfigTest.php +++ b/tests/lib/AppConfigTest.php @@ -309,7 +309,7 @@ class AppConfigTest extends TestCase { * @dataProvider providerGetKeys */ public function testIsSensitive( - string $appId, string $configKey, string $configValue, int $type, bool $lazy, bool $sensitive + string $appId, string $configKey, string $configValue, int $type, bool $lazy, bool $sensitive, ): void { $config = $this->generateAppConfig(); $this->assertEquals($sensitive, $config->isSensitive($appId, $configKey, $lazy)); @@ -352,7 +352,7 @@ class AppConfigTest extends TestCase { /** * @dataProvider providerGetKeys */ - public function testIsLazy(string $appId, string $configKey, string $configValue, int $type, bool $lazy + public function testIsLazy(string $appId, string $configKey, string $configValue, int $type, bool $lazy, ): void { $config = $this->generateAppConfig(); $this->assertEquals($lazy, $config->isLazy($appId, $configKey)); diff --git a/tests/lib/AppFramework/Http/DownloadResponseTest.php b/tests/lib/AppFramework/Http/DownloadResponseTest.php index 8ac5954e00d..ee89e8e55d1 100644 --- a/tests/lib/AppFramework/Http/DownloadResponseTest.php +++ b/tests/lib/AppFramework/Http/DownloadResponseTest.php @@ -34,7 +34,7 @@ class DownloadResponseTest extends \Test\TestCase { $response = new ChildDownloadResponse($input, 'content'); $headers = $response->getHeaders(); - $this->assertEquals('attachment; filename="'.$expected.'"', $headers['Content-Disposition']); + $this->assertEquals('attachment; filename="' . $expected . '"', $headers['Content-Disposition']); } public function filenameEncodingProvider() : array { diff --git a/tests/lib/AppFramework/Routing/RoutingTest.php b/tests/lib/AppFramework/Routing/RoutingTest.php index 32b57e7bf21..8522382ddcc 100644 --- a/tests/lib/AppFramework/Routing/RoutingTest.php +++ b/tests/lib/AppFramework/Routing/RoutingTest.php @@ -441,7 +441,7 @@ class RoutingTest extends \Test\TestCase { $controllerName, $actionName, array $requirements = [], - array $defaults = [] + array $defaults = [], ) { $route = $this->getMockBuilder(Route::class) ->onlyMethods(['method', 'requirements', 'defaults']) diff --git a/tests/lib/AppTest.php b/tests/lib/AppTest.php index e6759170fb1..41643b49ddc 100644 --- a/tests/lib/AppTest.php +++ b/tests/lib/AppTest.php @@ -621,14 +621,14 @@ class AppTest extends \Test\TestCase { public function testParseAppInfoL10N(): void { $parser = new InfoParser(); - $data = $parser->parse(\OC::$SERVERROOT. '/tests/data/app/description-multi-lang.xml'); + $data = $parser->parse(\OC::$SERVERROOT . '/tests/data/app/description-multi-lang.xml'); $this->assertEquals('English', \OC_App::parseAppInfo($data, 'en')['description']); $this->assertEquals('German', \OC_App::parseAppInfo($data, 'de')['description']); } public function testParseAppInfoL10NSingleLanguage(): void { $parser = new InfoParser(); - $data = $parser->parse(\OC::$SERVERROOT. '/tests/data/app/description-single-lang.xml'); + $data = $parser->parse(\OC::$SERVERROOT . '/tests/data/app/description-single-lang.xml'); $this->assertEquals('English', \OC_App::parseAppInfo($data, 'en')['description']); } } diff --git a/tests/lib/Archive/TestBase.php b/tests/lib/Archive/TestBase.php index 3f2d8c9561e..fda485d2dc1 100644 --- a/tests/lib/Archive/TestBase.php +++ b/tests/lib/Archive/TestBase.php @@ -28,10 +28,10 @@ abstract class TestBase extends \Test\TestCase { $this->instance = $this->getExisting(); $allFiles = $this->instance->getFiles(); $expected = ['lorem.txt','logo-wide.png','dir/', 'dir/lorem.txt']; - $this->assertEquals(4, count($allFiles), 'only found '.count($allFiles).' out of 4 expected files'); + $this->assertEquals(4, count($allFiles), 'only found ' . count($allFiles) . ' out of 4 expected files'); foreach ($expected as $file) { - $this->assertContains($file, $allFiles, 'cant find '. $file . ' in archive'); - $this->assertTrue($this->instance->fileExists($file), 'file '.$file.' does not exist in archive'); + $this->assertContains($file, $allFiles, 'cant find ' . $file . ' in archive'); + $this->assertTrue($this->instance->fileExists($file), 'file ' . $file . ' does not exist in archive'); } $this->assertFalse($this->instance->fileExists('non/existing/file')); @@ -39,21 +39,21 @@ abstract class TestBase extends \Test\TestCase { $expected = ['lorem.txt','logo-wide.png', 'dir/']; $this->assertEquals(3, count($rootContent)); foreach ($expected as $file) { - $this->assertContains($file, $rootContent, 'cant find '. $file . ' in archive'); + $this->assertContains($file, $rootContent, 'cant find ' . $file . ' in archive'); } $dirContent = $this->instance->getFolder('dir/'); $expected = ['lorem.txt']; $this->assertEquals(1, count($dirContent)); foreach ($expected as $file) { - $this->assertContains($file, $dirContent, 'cant find '. $file . ' in archive'); + $this->assertContains($file, $dirContent, 'cant find ' . $file . ' in archive'); } } public function testContent(): void { $this->instance = $this->getExisting(); - $dir = \OC::$SERVERROOT.'/tests/data'; - $textFile = $dir.'/lorem.txt'; + $dir = \OC::$SERVERROOT . '/tests/data'; + $textFile = $dir . '/lorem.txt'; $this->assertEquals(file_get_contents($textFile), $this->instance->getFile('lorem.txt')); $tmpFile = \OC::$server->getTempManager()->getTemporaryFile('.txt'); @@ -62,8 +62,8 @@ abstract class TestBase extends \Test\TestCase { } public function testWrite(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; - $textFile = $dir.'/lorem.txt'; + $dir = \OC::$SERVERROOT . '/tests/data'; + $textFile = $dir . '/lorem.txt'; $this->instance = $this->getNew(); $this->assertEquals(0, count($this->instance->getFiles())); $this->instance->addFile('lorem.txt', $textFile); @@ -77,24 +77,24 @@ abstract class TestBase extends \Test\TestCase { } public function testReadStream(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; + $dir = \OC::$SERVERROOT . '/tests/data'; $this->instance = $this->getExisting(); $fh = $this->instance->getStream('lorem.txt', 'r'); $this->assertTrue((bool)$fh); $content = fread($fh, $this->instance->filesize('lorem.txt')); fclose($fh); - $this->assertEquals(file_get_contents($dir.'/lorem.txt'), $content); + $this->assertEquals(file_get_contents($dir . '/lorem.txt'), $content); } public function testWriteStream(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; + $dir = \OC::$SERVERROOT . '/tests/data'; $this->instance = $this->getNew(); $fh = $this->instance->getStream('lorem.txt', 'w'); - $source = fopen($dir.'/lorem.txt', 'r'); + $source = fopen($dir . '/lorem.txt', 'r'); \OCP\Files::streamCopy($source, $fh); fclose($source); fclose($fh); $this->assertTrue($this->instance->fileExists('lorem.txt')); - $this->assertEquals(file_get_contents($dir.'/lorem.txt'), $this->instance->getFile('lorem.txt')); + $this->assertEquals(file_get_contents($dir . '/lorem.txt'), $this->instance->getFile('lorem.txt')); } public function testFolder(): void { $this->instance = $this->getNew(); @@ -108,19 +108,19 @@ abstract class TestBase extends \Test\TestCase { $this->assertFalse($this->instance->fileExists('/test/')); } public function testExtract(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; + $dir = \OC::$SERVERROOT . '/tests/data'; $this->instance = $this->getExisting(); $tmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); $this->instance->extract($tmpDir); - $this->assertEquals(true, file_exists($tmpDir.'lorem.txt')); - $this->assertEquals(true, file_exists($tmpDir.'dir/lorem.txt')); - $this->assertEquals(true, file_exists($tmpDir.'logo-wide.png')); - $this->assertEquals(file_get_contents($dir.'/lorem.txt'), file_get_contents($tmpDir.'lorem.txt')); + $this->assertEquals(true, file_exists($tmpDir . 'lorem.txt')); + $this->assertEquals(true, file_exists($tmpDir . 'dir/lorem.txt')); + $this->assertEquals(true, file_exists($tmpDir . 'logo-wide.png')); + $this->assertEquals(file_get_contents($dir . '/lorem.txt'), file_get_contents($tmpDir . 'lorem.txt')); \OCP\Files::rmdirr($tmpDir); } public function testMoveRemove(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; - $textFile = $dir.'/lorem.txt'; + $dir = \OC::$SERVERROOT . '/tests/data'; + $textFile = $dir . '/lorem.txt'; $this->instance = $this->getNew(); $this->instance->addFile('lorem.txt', $textFile); $this->assertFalse($this->instance->fileExists('target.txt')); @@ -132,7 +132,7 @@ abstract class TestBase extends \Test\TestCase { $this->assertFalse($this->instance->fileExists('target.txt')); } public function testRecursive(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; + $dir = \OC::$SERVERROOT . '/tests/data'; $this->instance = $this->getNew(); $this->instance->addRecursive('/dir', $dir); $this->assertTrue($this->instance->fileExists('/dir/lorem.txt')); diff --git a/tests/lib/Archive/ZIPTest.php b/tests/lib/Archive/ZIPTest.php index 62467ca230e..25707e4b051 100644 --- a/tests/lib/Archive/ZIPTest.php +++ b/tests/lib/Archive/ZIPTest.php @@ -16,6 +16,6 @@ class ZIPTest extends TestBase { } protected function getNew() { - return new ZIP(\OC::$server->getTempManager()->getTempBaseDir().'/newArchive.zip'); + return new ZIP(\OC::$server->getTempManager()->getTempBaseDir() . '/newArchive.zip'); } } diff --git a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php index be90d60c64f..6097c1f482d 100644 --- a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php +++ b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php @@ -307,7 +307,7 @@ class PublicKeyTokenProviderTest extends TestCase { $this->mapper->expects($this->exactly(2)) ->method('invalidate') ->withConsecutive( - [hash('sha512', 'token7'.'1f4h9s')], + [hash('sha512', 'token7' . '1f4h9s')], [hash('sha512', 'token7')] ); @@ -443,7 +443,7 @@ class PublicKeyTokenProviderTest extends TestCase { $this->mapper->method('getToken') ->with( $this->callback(function (string $token) { - return hash('sha512', 'unhashedTokentokentokentokentoken'.'1f4h9s') === $token; + return hash('sha512', 'unhashedTokentokentokentokentoken' . '1f4h9s') === $token; }) )->willReturn($token); @@ -457,7 +457,7 @@ class PublicKeyTokenProviderTest extends TestCase { ->method('getToken') ->withConsecutive( [$this->callback(function (string $token): bool { - return hash('sha512', 'unhashedTokentokentokentokentoken'.'1f4h9s') === $token; + return hash('sha512', 'unhashedTokentokentokentokentoken' . '1f4h9s') === $token; })], [$this->callback(function (string $token): bool { return hash('sha512', 'unhashedTokentokentokentokentoken') === $token; @@ -481,7 +481,7 @@ class PublicKeyTokenProviderTest extends TestCase { $this->mapper->method('getToken') ->with( $this->callback(function (string $token) { - return hash('sha512', 'tokentokentokentokentoken'.'1f4h9s') === $token; + return hash('sha512', 'tokentokentokentokentoken' . '1f4h9s') === $token; }) )->willReturn($actual); diff --git a/tests/lib/Collaboration/Collaborators/GroupPluginTest.php b/tests/lib/Collaboration/Collaborators/GroupPluginTest.php index e52ae95bf34..8fe71234906 100644 --- a/tests/lib/Collaboration/Collaborators/GroupPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/GroupPluginTest.php @@ -440,7 +440,7 @@ class GroupPluginTest extends TestCase { array $exactExpected, array $expected, bool $reachedEnd, - $singleGroup + $singleGroup, ): void { $this->config->expects($this->any()) ->method('getAppValue') diff --git a/tests/lib/Collaboration/Collaborators/SearchTest.php b/tests/lib/Collaboration/Collaborators/SearchTest.php index 88bdfa6047e..3e43d6331b2 100644 --- a/tests/lib/Collaboration/Collaborators/SearchTest.php +++ b/tests/lib/Collaboration/Collaborators/SearchTest.php @@ -42,7 +42,7 @@ class SearchTest extends TestCase { array $mockedRemotesResult, array $mockedMailResult, array $expected, - bool $expectedMoreResults + bool $expectedMoreResults, ): void { $searchResult = new SearchResult(); diff --git a/tests/lib/Collaboration/Collaborators/UserPluginTest.php b/tests/lib/Collaboration/Collaborators/UserPluginTest.php index c6a266b55d6..453f16c6686 100644 --- a/tests/lib/Collaboration/Collaborators/UserPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/UserPluginTest.php @@ -441,7 +441,7 @@ class UserPluginTest extends TestCase { $reachedEnd, $singleUser, array $users = [], - $shareeEnumerationPhone = false + $shareeEnumerationPhone = false, ): void { $this->mockConfig(['core' => [ 'shareapi_only_share_with_group_members' => $shareWithGroupOnly ? 'yes' : 'no', diff --git a/tests/lib/Comments/FakeManager.php b/tests/lib/Comments/FakeManager.php index b22264cb216..155bbc59dce 100644 --- a/tests/lib/Comments/FakeManager.php +++ b/tests/lib/Comments/FakeManager.php @@ -26,7 +26,7 @@ class FakeManager implements ICommentsManager { $objectId, $limit = 0, $offset = 0, - ?\DateTime $notOlderThan = null + ?\DateTime $notOlderThan = null, ) { } @@ -36,7 +36,7 @@ class FakeManager implements ICommentsManager { int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array { return []; } @@ -48,7 +48,7 @@ class FakeManager implements ICommentsManager { int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array { return []; } diff --git a/tests/lib/ConfigTest.php b/tests/lib/ConfigTest.php index 94ee8da5dec..3be066c6839 100644 --- a/tests/lib/ConfigTest.php +++ b/tests/lib/ConfigTest.php @@ -23,7 +23,7 @@ class ConfigTest extends TestCase { parent::setUp(); $this->randomTmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); - $this->configFile = $this->randomTmpDir.'testconfig.php'; + $this->configFile = $this->randomTmpDir . 'testconfig.php'; file_put_contents($this->configFile, self::TESTCONTENT); } @@ -155,7 +155,7 @@ class ConfigTest extends TestCase { public function testConfigMerge(): void { // Create additional config $additionalConfig = '<?php $CONFIG=array("php53"=>"totallyOutdated");'; - $additionalConfigPath = $this->randomTmpDir.'additionalConfig.testconfig.php'; + $additionalConfigPath = $this->randomTmpDir . 'additionalConfig.testconfig.php'; file_put_contents($additionalConfigPath, $additionalConfig); // Reinstantiate the config to force a read-in of the additional configs diff --git a/tests/lib/ErrorHandlerTest.php b/tests/lib/ErrorHandlerTest.php index 0846d09fd47..b45525e7962 100644 --- a/tests/lib/ErrorHandlerTest.php +++ b/tests/lib/ErrorHandlerTest.php @@ -54,7 +54,7 @@ class ErrorHandlerTest extends TestCase { * @param string $password */ public function testRemovePasswordFromError($username, $password): void { - $url = 'http://'.$username.':'.$password.'@owncloud.org'; + $url = 'http://' . $username . ':' . $password . '@owncloud.org'; $expectedResult = 'http://xxx:xxx@owncloud.org'; $this->logger->expects(self::once()) ->method('log') diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php index a6f25026193..29f9334ae15 100644 --- a/tests/lib/Files/Config/UserMountCacheTest.php +++ b/tests/lib/Files/Config/UserMountCacheTest.php @@ -120,7 +120,7 @@ class UserMountCacheTest extends TestCase { } private function keyForMount(MountPoint $mount): string { - return $mount->getStorageRootId().'::'.$mount->getMountPoint(); + return $mount->getStorageRootId() . '::' . $mount->getMountPoint(); } public function testNewMounts(): void { diff --git a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php index bbeabcf0f43..3dbdc3afc27 100644 --- a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php +++ b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php @@ -81,8 +81,8 @@ class ObjectStoreStorageTest extends Storage { $this->instance->rename($source, $target); - $this->assertTrue($this->instance->file_exists($target), $target.' was not created'); - $this->assertFalse($this->instance->file_exists($source), $source.' still exists'); + $this->assertTrue($this->instance->file_exists($target), $target . ' was not created'); + $this->assertFalse($this->instance->file_exists($source), $source . ' still exists'); $this->assertSameAsLorem($target); $targetId = $this->instance->getCache()->getId(ltrim($target, '/')); diff --git a/tests/lib/Files/Storage/StoragesTest.php b/tests/lib/Files/Storage/StoragesTest.php index d157d288f2c..e5a6469cdbe 100644 --- a/tests/lib/Files/Storage/StoragesTest.php +++ b/tests/lib/Files/Storage/StoragesTest.php @@ -37,8 +37,8 @@ abstract class StoragesTest extends TestCase { $this->storage1->moveFromStorage($this->storage2, $source, $target); - $this->assertTrue($this->storage1->file_exists($target), $target.' was not created'); - $this->assertFalse($this->storage2->file_exists($source), $source.' still exists'); + $this->assertTrue($this->storage1->file_exists($target), $target . ' was not created'); + $this->assertFalse($this->storage2->file_exists($source), $source . ' still exists'); $this->assertEquals('foo', $this->storage1->file_get_contents($target)); } @@ -75,8 +75,8 @@ abstract class StoragesTest extends TestCase { $this->storage1->copyFromStorage($this->storage2, $source, $target); - $this->assertTrue($this->storage1->file_exists($target), $target.' was not created'); - $this->assertTrue($this->storage2->file_exists($source), $source.' was deleted'); + $this->assertTrue($this->storage1->file_exists($target), $target . ' was not created'); + $this->assertTrue($this->storage2->file_exists($source), $source . ' was deleted'); $this->assertEquals('foo', $this->storage1->file_get_contents($target)); } diff --git a/tests/lib/Files/Storage/Wrapper/EncodingTest.php b/tests/lib/Files/Storage/Wrapper/EncodingTest.php index 4256337f08e..f52e3689155 100644 --- a/tests/lib/Files/Storage/Wrapper/EncodingTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncodingTest.php @@ -114,7 +114,7 @@ class EncodingTest extends \Test\Files\Storage\Storage { return [ [self::NFD_NAME, self::NFC_NAME], [self::NFD_NAME . '/' . self::NFD_NAME, self::NFC_NAME . '/' . self::NFC_NAME], - [self::NFD_NAME . '/' . self::NFC_NAME . '/' .self::NFD_NAME, self::NFC_NAME . '/' . self::NFC_NAME . '/' . self::NFC_NAME], + [self::NFD_NAME . '/' . self::NFC_NAME . '/' . self::NFD_NAME, self::NFC_NAME . '/' . self::NFC_NAME . '/' . self::NFC_NAME], ]; } diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php index 2a131a1ea39..851182ab3eb 100644 --- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php @@ -948,7 +948,7 @@ class EncryptionTest extends Storage { $encryptMountPoint, $encryptionModule, $encryptionModuleShouldEncrypt, - $expected + $expected, ): void { $encryptionManager = $this->createMock(\OC\Encryption\Manager::class); $util = $this->createMock(Util::class); diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 0a029889fb1..53da32b24db 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -1996,7 +1996,7 @@ class ViewTest extends \Test\TestCase { public function testLockBasicOperationUnlocksAfterException( $operation, $operationArgs, - $path + $path, ): void { if ($operation === 'touch') { $this->markTestSkipped('touch handles storage exceptions internally'); @@ -2081,7 +2081,7 @@ class ViewTest extends \Test\TestCase { $operation, $operationArgs, $path, - $hookType + $hookType, ): void { $view = new View('/' . $this->user . '/files/'); diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php index 9c5bf1a6eb2..237bb1299e5 100644 --- a/tests/lib/Http/Client/ClientTest.php +++ b/tests/lib/Http/Client/ClientTest.php @@ -486,7 +486,7 @@ class ClientTest extends \Test\TestCase { 'on_redirect' => function ( \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, - \Psr\Http\Message\UriInterface $uri + \Psr\Http\Message\UriInterface $uri, ) { }, ], @@ -545,7 +545,7 @@ class ClientTest extends \Test\TestCase { 'on_redirect' => function ( \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, - \Psr\Http\Message\UriInterface $uri + \Psr\Http\Message\UriInterface $uri, ) { }, ], @@ -605,7 +605,7 @@ class ClientTest extends \Test\TestCase { 'on_redirect' => function ( \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, - \Psr\Http\Message\UriInterface $uri + \Psr\Http\Message\UriInterface $uri, ) { }, ], diff --git a/tests/lib/ImageTest.php b/tests/lib/ImageTest.php index 76b110df521..5de5435335a 100644 --- a/tests/lib/ImageTest.php +++ b/tests/lib/ImageTest.php @@ -14,27 +14,27 @@ use OCP\IConfig; class ImageTest extends \Test\TestCase { public static function tearDownAfterClass(): void { - @unlink(OC::$SERVERROOT.'/tests/data/testimage2.png'); - @unlink(OC::$SERVERROOT.'/tests/data/testimage2.jpg'); + @unlink(OC::$SERVERROOT . '/tests/data/testimage2.png'); + @unlink(OC::$SERVERROOT . '/tests/data/testimage2.jpg'); parent::tearDownAfterClass(); } public function testConstructDestruct(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertInstanceOf('\OC\Image', $img); $this->assertInstanceOf('\OCP\IImage', $img); unset($img); - $imgcreate = imagecreatefromjpeg(OC::$SERVERROOT.'/tests/data/testimage.jpg'); + $imgcreate = imagecreatefromjpeg(OC::$SERVERROOT . '/tests/data/testimage.jpg'); $img = new Image(); $img->setResource($imgcreate); $this->assertInstanceOf('\OC\Image', $img); $this->assertInstanceOf('\OCP\IImage', $img); unset($img); - $base64 = base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif')); + $base64 = base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif')); $img = new Image(); $img->loadFromBase64($base64); $this->assertInstanceOf('\OC\Image', $img); @@ -49,7 +49,7 @@ class ImageTest extends \Test\TestCase { public function testValid(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertTrue($img->valid()); $text = base64_encode('Lorem ipsum dolor sir amet …'); @@ -63,32 +63,32 @@ class ImageTest extends \Test\TestCase { public function testMimeType(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertEquals('image/png', $img->mimeType()); $img = new Image(); $this->assertEquals('', $img->mimeType()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertEquals('image/jpeg', $img->mimeType()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertEquals('image/gif', $img->mimeType()); } public function testWidth(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertEquals(128, $img->width()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertEquals(1680, $img->width()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertEquals(64, $img->width()); $img = new Image(); @@ -97,15 +97,15 @@ class ImageTest extends \Test\TestCase { public function testHeight(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertEquals(128, $img->height()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertEquals(1050, $img->height()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertEquals(64, $img->height()); $img = new Image(); @@ -114,22 +114,22 @@ class ImageTest extends \Test\TestCase { public function testSave(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $img->resize(16); - $img->save(OC::$SERVERROOT.'/tests/data/testimage2.png'); - $this->assertEquals(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage2.png'), $img->data()); + $img->save(OC::$SERVERROOT . '/tests/data/testimage2.png'); + $this->assertEquals(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage2.png'), $img->data()); $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.jpg'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.jpg'); $img->resize(128); - $img->save(OC::$SERVERROOT.'/tests/data/testimage2.jpg'); - $this->assertEquals(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage2.jpg'), $img->data()); + $img->save(OC::$SERVERROOT . '/tests/data/testimage2.jpg'); + $this->assertEquals(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage2.jpg'), $img->data()); } public function testData(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); - $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.png')); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); + $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.png')); // Preserve transparency imagealphablending($raw, true); imagesavealpha($raw, true); @@ -149,8 +149,8 @@ class ImageTest extends \Test\TestCase { ->with('preview_max_memory', 256) ->willReturn(256); $img = new Image(null, $appConfig, $config); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.jpg'); - $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.jpg'); + $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); imageinterlace($raw, true); ob_start(); imagejpeg($raw, null, 80); @@ -158,8 +158,8 @@ class ImageTest extends \Test\TestCase { $this->assertEquals($expected, $img->data()); $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.gif'); - $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif')); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.gif'); + $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif')); ob_start(); imagegif($raw); $expected = ob_get_clean(); @@ -176,36 +176,36 @@ class ImageTest extends \Test\TestCase { */ public function testToString(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $expected = base64_encode($img->data()); $this->assertEquals($expected, (string)$img); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $expected = base64_encode($img->data()); $this->assertEquals($expected, (string)$img); $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.gif'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.gif'); $expected = base64_encode($img->data()); $this->assertEquals($expected, (string)$img); } public function testResize(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertTrue($img->resize(32)); $this->assertEquals(32, $img->width()); $this->assertEquals(32, $img->height()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertTrue($img->resize(840)); $this->assertEquals(840, $img->width()); $this->assertEquals(525, $img->height()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertTrue($img->resize(100)); $this->assertEquals(100, $img->width()); $this->assertEquals(100, $img->height()); @@ -213,19 +213,19 @@ class ImageTest extends \Test\TestCase { public function testPreciseResize(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertTrue($img->preciseResize(128, 512)); $this->assertEquals(128, $img->width()); $this->assertEquals(512, $img->height()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertTrue($img->preciseResize(64, 840)); $this->assertEquals(64, $img->width()); $this->assertEquals(840, $img->height()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertTrue($img->preciseResize(1000, 1337)); $this->assertEquals(1000, $img->width()); $this->assertEquals(1337, $img->height()); @@ -233,19 +233,19 @@ class ImageTest extends \Test\TestCase { public function testCenterCrop(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $img->centerCrop(); $this->assertEquals(128, $img->width()); $this->assertEquals(128, $img->height()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $img->centerCrop(); $this->assertEquals(1050, $img->width()); $this->assertEquals(1050, $img->height()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $img->centerCrop(512); $this->assertEquals(512, $img->width()); $this->assertEquals(512, $img->height()); @@ -253,19 +253,19 @@ class ImageTest extends \Test\TestCase { public function testCrop(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertTrue($img->crop(0, 0, 50, 20)); $this->assertEquals(50, $img->width()); $this->assertEquals(20, $img->height()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertTrue($img->crop(500, 700, 550, 300)); $this->assertEquals(550, $img->width()); $this->assertEquals(300, $img->height()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertTrue($img->crop(10, 10, 15, 15)); $this->assertEquals(15, $img->width()); $this->assertEquals(15, $img->height()); @@ -311,7 +311,7 @@ class ImageTest extends \Test\TestCase { */ public function testScaleDownToFitWhenSmallerAlready($filename): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/' . $filename); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/' . $filename); $currentWidth = $img->width(); $currentHeight = $img->height(); // We pick something larger than the image we want to scale down @@ -344,7 +344,7 @@ class ImageTest extends \Test\TestCase { */ public function testScaleDownWhenBigger($filename, $asked, $expected): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/' . $filename); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/' . $filename); //$this->assertTrue($img->scaleDownToFit($asked[0], $asked[1])); $img->scaleDownToFit($asked[0], $asked[1]); $this->assertEquals($expected[0], $img->width()); @@ -364,7 +364,7 @@ class ImageTest extends \Test\TestCase { */ public function testConvert($mimeType): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $tempFile = tempnam(sys_get_temp_dir(), 'img-test'); $img->save($tempFile, $mimeType); @@ -373,12 +373,12 @@ class ImageTest extends \Test\TestCase { public function testMemoryLimitFromFile(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage-badheader.jpg'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage-badheader.jpg'); $this->assertFalse($img->valid()); } public function testMemoryLimitFromData(): void { - $data = file_get_contents(OC::$SERVERROOT.'/tests/data/testimage-badheader.jpg'); + $data = file_get_contents(OC::$SERVERROOT . '/tests/data/testimage-badheader.jpg'); $img = new Image(); $img->loadFromData($data); $this->assertFalse($img->valid()); diff --git a/tests/lib/InfoXmlTest.php b/tests/lib/InfoXmlTest.php index 461a2ecafa8..e579a4b4efd 100644 --- a/tests/lib/InfoXmlTest.php +++ b/tests/lib/InfoXmlTest.php @@ -125,7 +125,7 @@ class InfoXmlTest extends TestCase { if (isset($appInfo['commands'])) { foreach ($appInfo['commands'] as $command) { - $this->assertTrue(class_exists($command), 'Asserting command "'. $command . '"exists'); + $this->assertTrue(class_exists($command), 'Asserting command "' . $command . '"exists'); $this->assertInstanceOf($command, \OC::$server->query($command)); } } diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php index 8d579cda529..6b6da1cc30c 100644 --- a/tests/lib/IntegrityCheck/CheckerTest.php +++ b/tests/lib/IntegrityCheck/CheckerTest.php @@ -89,8 +89,8 @@ class CheckerTest extends TestCase { ->with('NotExistingApp/appinfo') ->willReturn(true); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -108,8 +108,8 @@ class CheckerTest extends TestCase { ->method('file_put_contents') ->will($this->throwException(new \Exception('Exception message'))); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -139,8 +139,8 @@ class CheckerTest extends TestCase { }) ); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -201,7 +201,7 @@ class CheckerTest extends TestCase { ) ->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $this->assertSame([], $this->checker->verifyAppSignature('SomeApp')); @@ -240,7 +240,7 @@ class CheckerTest extends TestCase { ) ->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ @@ -285,7 +285,7 @@ class CheckerTest extends TestCase { ) ->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); @@ -345,7 +345,7 @@ class CheckerTest extends TestCase { ) ->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); @@ -405,7 +405,7 @@ class CheckerTest extends TestCase { ['/resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ @@ -449,7 +449,7 @@ class CheckerTest extends TestCase { ['/resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $this->assertSame([], $this->checker->verifyAppSignature('SomeApp')); @@ -470,8 +470,8 @@ class CheckerTest extends TestCase { ->with(__DIR__ . '/core') ->willReturn(true); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -494,8 +494,8 @@ class CheckerTest extends TestCase { ->with(__DIR__ . '/core') ->willReturn(false); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -529,8 +529,8 @@ class CheckerTest extends TestCase { }) ); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/core.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/core.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/core.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -564,8 +564,8 @@ class CheckerTest extends TestCase { }) ); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/core.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/core.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/core.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -594,8 +594,8 @@ class CheckerTest extends TestCase { }) ); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/core.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/core.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/core.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -629,8 +629,8 @@ class CheckerTest extends TestCase { }) ); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/core.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/core.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/core.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -689,7 +689,7 @@ class CheckerTest extends TestCase { [\OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $this->assertSame([], $this->checker->verifyCoreSignature()); @@ -727,7 +727,7 @@ class CheckerTest extends TestCase { ) ->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $this->assertSame([], $this->checker->verifyCoreSignature()); @@ -774,12 +774,12 @@ class CheckerTest extends TestCase { ->method('getServerRoot') ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified'); - $signatureDataFile = file_get_contents(__DIR__ .'/../../data/integritycheck/mimetypeListModified/core/signature.json'); + $signatureDataFile = file_get_contents(__DIR__ . '/../../data/integritycheck/mimetypeListModified/core/signature.json'); $this->fileAccessHelper ->method('file_get_contents') ->willReturnMap([ [\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/core/signature.json', $signatureDataFile], - [\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/resources/codesigning/root.crt', file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')], + [\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/resources/codesigning/root.crt', file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt')], ]); $this->assertSame([], $this->checker->verifyCoreSignature()); @@ -816,7 +816,7 @@ class CheckerTest extends TestCase { [\OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $this->assertSame([], $this->checker->verifyCoreSignature()); @@ -853,7 +853,7 @@ class CheckerTest extends TestCase { [\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ @@ -896,7 +896,7 @@ class CheckerTest extends TestCase { [\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ @@ -954,7 +954,7 @@ class CheckerTest extends TestCase { [\OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ @@ -997,7 +997,7 @@ class CheckerTest extends TestCase { [\OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ diff --git a/tests/lib/L10N/L10nTest.php b/tests/lib/L10N/L10nTest.php index 26f39e41c13..32b81cf06a7 100644 --- a/tests/lib/L10N/L10nTest.php +++ b/tests/lib/L10N/L10nTest.php @@ -40,14 +40,14 @@ class L10nTest extends TestCase { } public function testSimpleTranslationWithTrailingColon(): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/de.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/de.json'; $l = new L10N($this->getFactory(), 'test', 'de', 'de_AT', [$transFile]); $this->assertEquals('Files:', $l->t('Files:')); } public function testGermanPluralTranslations(): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/de.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/de.json'; $l = new L10N($this->getFactory(), 'test', 'de', 'de_AT', [$transFile]); $this->assertEquals('1 Datei', (string)$l->n('%n file', '%n files', 1)); @@ -55,7 +55,7 @@ class L10nTest extends TestCase { } public function testRussianPluralTranslations(): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/ru.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/ru.json'; $l = new L10N($this->getFactory(), 'test', 'ru', 'ru_UA', [$transFile]); $this->assertEquals('1 файл', (string)$l->n('%n file', '%n files', 1)); @@ -79,7 +79,7 @@ class L10nTest extends TestCase { } public function testCzechPluralTranslations(): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/cs.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/cs.json'; $l = new L10N($this->getFactory(), 'test', 'cs', 'cs_CZ', [$transFile]); $this->assertEquals('1 okno', (string)$l->n('%n window', '%n windows', 1)); @@ -88,7 +88,7 @@ class L10nTest extends TestCase { } public function testGermanPluralWithCzechLocaleTranslations(): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/de.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/de.json'; $l = new L10N($this->getFactory(), 'test', 'de', 'cs_CZ', [$transFile]); $this->assertEquals('1 Datei', (string)$l->n('%n file', '%n files', 1)); @@ -111,7 +111,7 @@ class L10nTest extends TestCase { * @param $expected */ public function testPlaceholders($string, $expected): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/de.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/de.json'; $l = new L10N($this->getFactory(), 'test', 'de', 'de_AT', [$transFile]); $this->assertEquals($expected, $l->t($string, ['1', '2'])); diff --git a/tests/lib/Log/LogFactoryTest.php b/tests/lib/Log/LogFactoryTest.php index 22ee0dfb268..6219fd438f7 100644 --- a/tests/lib/Log/LogFactoryTest.php +++ b/tests/lib/Log/LogFactoryTest.php @@ -62,7 +62,7 @@ class LogFactoryTest extends TestCase { * @throws \OCP\AppFramework\QueryException */ public function testFile(string $type): void { - $datadir = \OC::$SERVERROOT.'/data'; + $datadir = \OC::$SERVERROOT . '/data'; $defaultLog = $datadir . '/nextcloud.log'; $this->systemConfig->expects($this->exactly(3)) @@ -82,7 +82,7 @@ class LogFactoryTest extends TestCase { ], [ '/xdev/youshallfallback', - \OC::$SERVERROOT.'/data/nextcloud.log' + \OC::$SERVERROOT . '/data/nextcloud.log' ] ]; } @@ -92,7 +92,7 @@ class LogFactoryTest extends TestCase { * @throws \OCP\AppFramework\QueryException */ public function testFileCustomPath($path, $expected): void { - $datadir = \OC::$SERVERROOT.'/data'; + $datadir = \OC::$SERVERROOT . '/data'; $defaultLog = $datadir . '/nextcloud.log'; $this->systemConfig->expects($this->exactly(3)) diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php index 1297bfdf669..7767a8c2e8f 100644 --- a/tests/lib/NavigationManagerTest.php +++ b/tests/lib/NavigationManagerTest.php @@ -311,7 +311,7 @@ class NavigationManagerTest extends TestCase { 'logout' => [ 'id' => 'logout', 'order' => 99999, - 'href' => 'https://example.com/logout?requesttoken='. urlencode(\OCP\Util::callRegister()), + 'href' => 'https://example.com/logout?requesttoken=' . urlencode(\OCP\Util::callRegister()), 'icon' => '/apps/core/img/actions/logout.svg', 'name' => 'Log out', 'active' => false, diff --git a/tests/lib/Preview/BackgroundCleanupJobTest.php b/tests/lib/Preview/BackgroundCleanupJobTest.php index d9ea1718491..9c521376af5 100644 --- a/tests/lib/Preview/BackgroundCleanupJobTest.php +++ b/tests/lib/Preview/BackgroundCleanupJobTest.php @@ -96,7 +96,7 @@ class BackgroundCleanupJobTest extends \Test\TestCase { $files = []; for ($i = 0; $i < 11; $i++) { - $file = $userFolder->newFile($i.'.txt'); + $file = $userFolder->newFile($i . '.txt'); $file->putContent('hello world!'); $this->previewManager->getPreview($file); $files[] = $file; diff --git a/tests/lib/Route/RouterTest.php b/tests/lib/Route/RouterTest.php index 8647bb0f2f6..6f253d9121f 100644 --- a/tests/lib/Route/RouterTest.php +++ b/tests/lib/Route/RouterTest.php @@ -36,7 +36,7 @@ class RouterTest extends TestCase { $logger->method('info') ->willReturnCallback( function (string $message, array $data) { - $this->fail('Unexpected info log: '.(string)($data['exception'] ?? $message)); + $this->fail('Unexpected info log: ' . (string)($data['exception'] ?? $message)); } ); diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php index 14036b3dd3b..095512d0b4f 100644 --- a/tests/lib/Security/CertificateManagerTest.php +++ b/tests/lib/Security/CertificateManagerTest.php @@ -144,7 +144,7 @@ class CertificateManagerTest extends \Test\TestCase { public function testNeedRebundling($CaBundleMtime, $targetBundleMtime, $targetBundleExists, - $expected + $expected, ): void { $view = $this->getMockBuilder(View::class) ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Security/CertificateTest.php b/tests/lib/Security/CertificateTest.php index 8b084ca41b3..c787cc3355f 100644 --- a/tests/lib/Security/CertificateTest.php +++ b/tests/lib/Security/CertificateTest.php @@ -45,7 +45,7 @@ class CertificateTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('Certificate could not get parsed.'); - new Certificate('file://'.__DIR__ . '/../../data/certificates/goodCertificate.crt', 'bar'); + new Certificate('file://' . __DIR__ . '/../../data/certificates/goodCertificate.crt', 'bar'); } public function testGetName(): void { diff --git a/tests/lib/Security/SecureRandomTest.php b/tests/lib/Security/SecureRandomTest.php index 08d33d4a1b3..8000917579b 100644 --- a/tests/lib/Security/SecureRandomTest.php +++ b/tests/lib/Security/SecureRandomTest.php @@ -72,7 +72,7 @@ class SecureRandomTest extends \Test\TestCase { $generator = $this->rng; $scheme = constant('OCP\Security\ISecureRandom::' . $charName); $randomString = $generator->generate(100, $scheme); - $matchesRegex = preg_match('/^'.$chars.'+$/', $randomString); + $matchesRegex = preg_match('/^' . $chars . '+$/', $randomString); $this->assertSame(1, $matchesRegex); } diff --git a/tests/lib/Share/Backend.php b/tests/lib/Share/Backend.php index 42269d7e275..489f4a9bfd1 100644 --- a/tests/lib/Share/Backend.php +++ b/tests/lib/Share/Backend.php @@ -54,11 +54,11 @@ class Backend implements \OCP\Share_Backend { $ext = substr($target, $pos); $append = ''; $i = 1; - while (in_array($name.$append.$ext, $knownTargets)) { + while (in_array($name . $append . $ext, $knownTargets)) { $append = $i; $i++; } - $target = $name.$append.$ext; + $target = $name . $append . $ext; } return $target; diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index 36f070d7c99..5bed54cc18f 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -716,7 +716,7 @@ class DefaultShareProviderTest extends \Test\TestCase { $share2 = $this->provider->create($share); $this->assertNotNull($share2->getId()); - $this->assertSame('ocinternal:'.$share2->getId(), $share2->getFullId()); + $this->assertSame('ocinternal:' . $share2->getId(), $share2->getFullId()); $this->assertSame(IShare::TYPE_USER, $share2->getShareType()); $this->assertSame('sharedWith', $share2->getSharedWith()); $this->assertSame('sharedBy', $share2->getSharedBy()); @@ -786,7 +786,7 @@ class DefaultShareProviderTest extends \Test\TestCase { $share2 = $this->provider->create($share); $this->assertNotNull($share2->getId()); - $this->assertSame('ocinternal:'.$share2->getId(), $share2->getFullId()); + $this->assertSame('ocinternal:' . $share2->getId(), $share2->getFullId()); $this->assertSame(IShare::TYPE_GROUP, $share2->getShareType()); $this->assertSame('sharedWith', $share2->getSharedWith()); $this->assertSame('sharedBy', $share2->getSharedBy()); @@ -855,7 +855,7 @@ class DefaultShareProviderTest extends \Test\TestCase { $share2 = $this->provider->create($share); $this->assertNotNull($share2->getId()); - $this->assertSame('ocinternal:'.$share2->getId(), $share2->getFullId()); + $this->assertSame('ocinternal:' . $share2->getId(), $share2->getFullId()); $this->assertSame(IShare::TYPE_LINK, $share2->getShareType()); $this->assertSame('sharedBy', $share2->getSharedBy()); $this->assertSame('shareOwner', $share2->getShareOwner()); @@ -1033,7 +1033,7 @@ class DefaultShareProviderTest extends \Test\TestCase { $groups = []; foreach (range(0, 100) as $i) { - $groups[] = 'group'.$i; + $groups[] = 'group' . $i; } $groups[] = 'sharedWith'; @@ -1287,7 +1287,7 @@ class DefaultShareProviderTest extends \Test\TestCase { $groups = []; foreach (range(0, 100) as $i) { - $groups[] = 'group'.$i; + $groups[] = 'group' . $i; } $groups[] = 'sharedWith'; @@ -1820,9 +1820,9 @@ class DefaultShareProviderTest extends \Test\TestCase { $users = []; for ($i = 0; $i < 6; $i++) { $user = $this->createMock(IUser::class); - $user->method('getUID')->willReturn('user'.$i); + $user->method('getUID')->willReturn('user' . $i); $user->method('getDisplayName')->willReturn('user' . $i); - $users['user'.$i] = $user; + $users['user' . $i] = $user; } $this->userManager->method('get')->willReturnCallback( @@ -1878,8 +1878,8 @@ class DefaultShareProviderTest extends \Test\TestCase { $users = []; for ($i = 0; $i < 6; $i++) { $user = $this->createMock(IUser::class); - $user->method('getUID')->willReturn('user'.$i); - $users['user'.$i] = $user; + $user->method('getUID')->willReturn('user' . $i); + $users['user' . $i] = $user; } $this->userManager->method('get')->willReturnCallback( @@ -1944,8 +1944,8 @@ class DefaultShareProviderTest extends \Test\TestCase { $users = []; for ($i = 0; $i < 6; $i++) { $user = $this->createMock(IUser::class); - $user->method('getUID')->willReturn('user'.$i); - $users['user'.$i] = $user; + $user->method('getUID')->willReturn('user' . $i); + $users['user' . $i] = $user; } $this->userManager->method('get')->willReturnCallback( @@ -2001,8 +2001,8 @@ class DefaultShareProviderTest extends \Test\TestCase { $users = []; for ($i = 0; $i < 6; $i++) { $user = $this->createMock(IUser::class); - $user->method('getUID')->willReturn('user'.$i); - $users['user'.$i] = $user; + $user->method('getUID')->willReturn('user' . $i); + $users['user' . $i] = $user; } $this->userManager->method('get')->willReturnCallback( @@ -2014,9 +2014,9 @@ class DefaultShareProviderTest extends \Test\TestCase { $groups = []; for ($i = 0; $i < 2; $i++) { $group = $this->createMock(IGroup::class); - $group->method('getGID')->willReturn('group'.$i); + $group->method('getGID')->willReturn('group' . $i); $group->method('getDisplayName')->willReturn('group-displayname' . $i); - $groups['group'.$i] = $group; + $groups['group' . $i] = $group; } $this->groupManager->method('get')->willReturnCallback( @@ -2080,8 +2080,8 @@ class DefaultShareProviderTest extends \Test\TestCase { $users = []; for ($i = 0; $i < 6; $i++) { $user = $this->createMock(IUser::class); - $user->method('getUID')->willReturn('user'.$i); - $users['user'.$i] = $user; + $user->method('getUID')->willReturn('user' . $i); + $users['user' . $i] = $user; } $this->userManager->method('get')->willReturnCallback( @@ -2093,9 +2093,9 @@ class DefaultShareProviderTest extends \Test\TestCase { $groups = []; for ($i = 0; $i < 2; $i++) { $group = $this->createMock(IGroup::class); - $group->method('getGID')->willReturn('group'.$i); - $group->method('getDisplayName')->willReturn('group-displayname'.$i); - $groups['group'.$i] = $group; + $group->method('getGID')->willReturn('group' . $i); + $group->method('getDisplayName')->willReturn('group-displayname' . $i); + $groups['group' . $i] = $group; } $this->groupManager->method('get')->willReturnCallback( diff --git a/tests/lib/SubAdminTest.php b/tests/lib/SubAdminTest.php index 2827fe84d78..4cda08a2945 100644 --- a/tests/lib/SubAdminTest.php +++ b/tests/lib/SubAdminTest.php @@ -46,8 +46,8 @@ class SubAdminTest extends \Test\TestCase { // Create 3 users and 3 groups for ($i = 0; $i < 3; $i++) { - $this->users[] = $this->userManager->createUser('user'.$i, 'user'); - $this->groups[] = $this->groupManager->createGroup('group'.$i); + $this->users[] = $this->userManager->createUser('user' . $i, 'user'); + $this->groups[] = $this->groupManager->createGroup('group' . $i); } // Create admin group diff --git a/tests/lib/TaskProcessing/TaskProcessingTest.php b/tests/lib/TaskProcessing/TaskProcessingTest.php index 38675e826bf..00e1da4acb5 100644 --- a/tests/lib/TaskProcessing/TaskProcessingTest.php +++ b/tests/lib/TaskProcessing/TaskProcessingTest.php @@ -625,7 +625,7 @@ class TaskProcessingTest extends \Test\TestCase { $backgroundJob->start($this->jobList); $task = $this->manager->getTask($task->getId()); - self::assertEquals(Task::STATUS_SUCCESSFUL, $task->getStatus(), 'Status is '. $task->getStatus() . ' with error message: ' . $task->getErrorMessage()); + self::assertEquals(Task::STATUS_SUCCESSFUL, $task->getStatus(), 'Status is ' . $task->getStatus() . ' with error message: ' . $task->getErrorMessage()); self::assertEquals(['output' => 'Hello'], $task->getOutput()); self::assertEquals(1, $task->getProgress()); } @@ -729,7 +729,7 @@ class TaskProcessingTest extends \Test\TestCase { self::assertEquals(1, $task->getProgress()); self::assertTrue(isset($task->getOutput()['spectrogram'])); $node = $this->rootFolder->getFirstNodeById($task->getOutput()['spectrogram']); - self::assertNotNull($node, 'fileId:' . $task->getOutput()['spectrogram']); + self::assertNotNull($node, 'fileId:' . $task->getOutput()['spectrogram']); self::assertInstanceOf(\OCP\Files\File::class, $node); self::assertEquals('World', $node->getContent()); } diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index 9369a20eb81..03886d4a0be 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -530,7 +530,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { * @param array $vars */ protected function assertTemplate($expectedHtml, $template, $vars = []) { - require_once __DIR__.'/../../lib/private/legacy/template/functions.php'; + require_once __DIR__ . '/../../lib/private/legacy/template/functions.php'; $requestToken = 12345; /** @var Defaults|\PHPUnit\Framework\MockObject\MockObject $l10n */ diff --git a/tests/lib/Updater/VersionCheckTest.php b/tests/lib/Updater/VersionCheckTest.php index b33829a2155..94347265427 100644 --- a/tests/lib/Updater/VersionCheckTest.php +++ b/tests/lib/Updater/VersionCheckTest.php @@ -63,7 +63,7 @@ class VersionCheckTest extends \Test\TestCase { * @return string */ private function buildUpdateUrl($baseUrl) { - return $baseUrl . '?version='.implode('x', Util::getVersion()).'xinstalledatx' . time() . 'x'.\OC_Util::getChannel().'xxx'.PHP_MAJOR_VERSION.'x'.PHP_MINOR_VERSION.'x'.PHP_RELEASE_VERSION.'x0x0'; + return $baseUrl . '?version=' . implode('x', Util::getVersion()) . 'xinstalledatx' . time() . 'x' . \OC_Util::getChannel() . 'xxx' . PHP_MAJOR_VERSION . 'x' . PHP_MINOR_VERSION . 'x' . PHP_RELEASE_VERSION . 'x0x0'; } public function testCheckInCache(): void { diff --git a/tests/preseed-config.php b/tests/preseed-config.php index f9c15939469..3095690e483 100644 --- a/tests/preseed-config.php +++ b/tests/preseed-config.php @@ -15,7 +15,7 @@ $CONFIG = [ ], ]; -if (is_dir(OC::$SERVERROOT.'/apps2')) { +if (is_dir(OC::$SERVERROOT . '/apps2')) { $CONFIG['apps_paths'][] = [ 'path' => OC::$SERVERROOT . '/apps2', 'url' => '/apps2', diff --git a/vendor-bin/cs-fixer/composer.json b/vendor-bin/cs-fixer/composer.json index 13cc12d0c86..c2c3ecc5a46 100644 --- a/vendor-bin/cs-fixer/composer.json +++ b/vendor-bin/cs-fixer/composer.json @@ -7,6 +7,6 @@ }, "require": { "friendsofphp/php-cs-fixer": "^3.37", - "nextcloud/coding-standard": "^1.1.1" + "nextcloud/coding-standard": "^1.3.1" } } diff --git a/vendor-bin/cs-fixer/composer.lock b/vendor-bin/cs-fixer/composer.lock index e905331a93a..6e6a3ac3e90 100644 --- a/vendor-bin/cs-fixer/composer.lock +++ b/vendor-bin/cs-fixer/composer.lock @@ -4,23 +4,70 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "80901a880a6a35944b750b56c0e85620", + "content-hash": "427da07c086c9f916d995f88b29aba1b", "packages": [ { + "name": "kubawerlos/php-cs-fixer-custom-fixers", + "version": "v3.22.0", + "source": { + "type": "git", + "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-tokenizer": "*", + "friendsofphp/php-cs-fixer": "^3.61.1", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6.4 || ^10.5.29" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpCsFixerCustomFixers\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kuba Werłos", + "email": "werlos@gmail.com" + } + ], + "description": "A set of custom fixers for PHP CS Fixer", + "support": { + "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", + "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.22.0" + }, + "time": "2024-08-16T20:44:35+00:00" + }, + { "name": "nextcloud/coding-standard", - "version": "v1.2.3", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "bc9c53a5306114b60c4363057aff9c2ed10a54da" + "reference": "e88acb0df6217b808d1632286ddfec9267a102e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/bc9c53a5306114b60c4363057aff9c2ed10a54da", - "reference": "bc9c53a5306114b60c4363057aff9c2ed10a54da", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/e88acb0df6217b808d1632286ddfec9267a102e4", + "reference": "e88acb0df6217b808d1632286ddfec9267a102e4", "shasum": "" }, "require": { + "kubawerlos/php-cs-fixer-custom-fixers": "^3.22", "php": "^7.3|^8.0", "php-cs-fixer/shim": "^3.17" }, @@ -43,22 +90,22 @@ "description": "Nextcloud coding standards for the php cs fixer", "support": { "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.2.3" + "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.1" }, - "time": "2024-08-23T14:32:32+00:00" + "time": "2024-09-19T09:07:10+00:00" }, { "name": "php-cs-fixer/shim", - "version": "v3.62.0", + "version": "v3.64.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "7a91d5ce45c486f5b445d95901228507a02f60ae" + "reference": "81ccfd24baf3a10810dab1152c403981a790b837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/7a91d5ce45c486f5b445d95901228507a02f60ae", - "reference": "7a91d5ce45c486f5b445d95901228507a02f60ae", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/81ccfd24baf3a10810dab1152c403981a790b837", + "reference": "81ccfd24baf3a10810dab1152c403981a790b837", "shasum": "" }, "require": { @@ -95,9 +142,9 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.62.0" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.64.0" }, - "time": "2024-08-07T17:03:46+00:00" + "time": "2024-08-30T23:10:11+00:00" } ], "packages-dev": [], |