diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 34568c64a..3855a5092 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -5,3 +5,6 @@ # Update to coding-standard 1.2.3 3b3935b4e754ccbc00d3abb71ab6836f3db5b026 + +# Update to coding-standard 1.3.1 +db4964b631856f514bc08d3da0e86014a18d678f diff --git a/lib/Controller/AppointmentController.php b/lib/Controller/AppointmentController.php index c5a62a691..bceebc9d8 100644 --- a/lib/Controller/AppointmentController.php +++ b/lib/Controller/AppointmentController.php @@ -38,7 +38,7 @@ public function __construct(IRequest $request, IUserManager $userManager, AppointmentConfigService $configService, IInitialState $initialState, - ?string $userId + ?string $userId, ) { parent::__construct(Application::APP_ID, $request); diff --git a/lib/Listener/CalendarReferenceListener.php b/lib/Listener/CalendarReferenceListener.php index d668d72d6..eda2c1b3e 100644 --- a/lib/Listener/CalendarReferenceListener.php +++ b/lib/Listener/CalendarReferenceListener.php @@ -21,7 +21,8 @@ */ class CalendarReferenceListener implements IEventListener { public function __construct( - private CalendarInitialStateService $calendarinitialStateService) { + private CalendarInitialStateService $calendarinitialStateService, + ) { $this->calendarinitialStateService = $calendarinitialStateService; } diff --git a/lib/Reference/ReferenceProvider.php b/lib/Reference/ReferenceProvider.php index cc7fd2887..c7bf57e2b 100644 --- a/lib/Reference/ReferenceProvider.php +++ b/lib/Reference/ReferenceProvider.php @@ -124,7 +124,7 @@ private function getUrlFromLink(string $data, string $type): ?string { if ($type === 'public') { return "{$this->urlGenerator->getWebroot()}/remote.php/dav/public-calendars/{$data}/"; } elseif ($type === 'private' && preg_match('/\/remote.php\/dav\/calendars\/([a-zA-Z0-9-]+)\/([a-zA-Z0-9-]+)\//', $data, $output_array)) { - return $this->urlGenerator->getWebroot().$output_array[0]; + return $this->urlGenerator->getWebroot() . $output_array[0]; } return null; diff --git a/lib/Service/Appointments/AvailabilityGenerator.php b/lib/Service/Appointments/AvailabilityGenerator.php index f4a8cf5d6..39c48da17 100644 --- a/lib/Service/Appointments/AvailabilityGenerator.php +++ b/lib/Service/Appointments/AvailabilityGenerator.php @@ -24,7 +24,10 @@ class AvailabilityGenerator { /** @var ITimeFactory */ private $timeFactory; - public function __construct(ITimeFactory $timeFactory, private LoggerInterface $logger) { + public function __construct( + ITimeFactory $timeFactory, + private LoggerInterface $logger, + ) { $this->timeFactory = $timeFactory; } diff --git a/lib/Service/Appointments/BookingCalendarWriter.php b/lib/Service/Appointments/BookingCalendarWriter.php index e18a9e2c7..4fb005583 100644 --- a/lib/Service/Appointments/BookingCalendarWriter.php +++ b/lib/Service/Appointments/BookingCalendarWriter.php @@ -36,12 +36,14 @@ class BookingCalendarWriter { private TimezoneGenerator $timezoneGenerator; - public function __construct(IConfig $config, + public function __construct( + IConfig $config, IManager $manager, IUserManager $userManager, ISecureRandom $random, TimezoneGenerator $timezoneGenerator, - private IFactory $l10nFactory) { + private IFactory $l10nFactory, + ) { $this->config = $config; $this->manager = $manager; $this->userManager = $userManager; @@ -107,7 +109,7 @@ public function write(AppointmentConfig $config, $end = $start->getTimestamp() + $config->getLength(); $tz = $this->timezoneGenerator->generateVTimezone($timezone, $start->getTimestamp(), $end); - if($tz) { + if ($tz) { $vcalendar->add($tz); } @@ -172,7 +174,7 @@ public function write(AppointmentConfig $config, try { $calendar->createFromString($filename . '.ics', $vcalendar->serialize()); } catch (CalendarException $e) { - throw new RuntimeException('Could not write event for appointment config id ' . $config->getId(). ' to calendar: ' . $e->getMessage(), 0, $e); + throw new RuntimeException('Could not write event for appointment config id ' . $config->getId() . ' to calendar: ' . $e->getMessage(), 0, $e); } if ($config->getPreparationDuration() !== 0) { @@ -189,7 +191,7 @@ public function write(AppointmentConfig $config, ] ]); $tz = $this->timezoneGenerator->generateVTimezone($timezone, $prepStart->getTimestamp(), $start->getTimestamp()); - if($tz) { + if ($tz) { $prepCalendar->add($tz); } @@ -202,7 +204,7 @@ public function write(AppointmentConfig $config, try { $calendar->createFromString($prepFileName . '.ics', $prepCalendar->serialize()); } catch (CalendarException $e) { - throw new RuntimeException('Could not write event for appointment config id ' . $config->getId(). ' to calendar: ' . $e->getMessage(), 0, $e); + throw new RuntimeException('Could not write event for appointment config id ' . $config->getId() . ' to calendar: ' . $e->getMessage(), 0, $e); } } @@ -222,7 +224,7 @@ public function write(AppointmentConfig $config, ]); $tz = $this->timezoneGenerator->generateVTimezone($timezone, $followupStart->getTimestamp(), $followUpEnd->getTimestamp()); - if($tz) { + if ($tz) { $followUpCalendar->add($tz); } @@ -235,7 +237,7 @@ public function write(AppointmentConfig $config, try { $calendar->createFromString($followUpFilename . '.ics', $followUpCalendar->serialize()); } catch (CalendarException $e) { - throw new RuntimeException('Could not write event for appointment config id ' . $config->getId(). ' to calendar: ' . $e->getMessage(), 0, $e); + throw new RuntimeException('Could not write event for appointment config id ' . $config->getId() . ' to calendar: ' . $e->getMessage(), 0, $e); } } return $vcalendar->serialize(); diff --git a/lib/Service/Appointments/DailyLimitFilter.php b/lib/Service/Appointments/DailyLimitFilter.php index 96d2b4677..21bf2e026 100644 --- a/lib/Service/Appointments/DailyLimitFilter.php +++ b/lib/Service/Appointments/DailyLimitFilter.php @@ -21,7 +21,10 @@ class DailyLimitFilter { /** @var IManager */ private $calendarManger; - public function __construct(IManager $calendarManger, private LoggerInterface $logger) { + public function __construct( + IManager $calendarManger, + private LoggerInterface $logger, + ) { $this->calendarManger = $calendarManger; } @@ -33,7 +36,7 @@ public function __construct(IManager $calendarManger, private LoggerInterface $l */ public function filter(AppointmentConfig $config, array $slots): array { $this->logger->debug('Slots before daily limit filtering:' . count($slots), ['app' => 'calendar-appointments']); - if(empty($slots)) { + if (empty($slots)) { return []; } // 0. If there is no limit then we don't have to filter anything diff --git a/lib/Service/Appointments/EventConflictFilter.php b/lib/Service/Appointments/EventConflictFilter.php index ac55b6af3..2a4918674 100644 --- a/lib/Service/Appointments/EventConflictFilter.php +++ b/lib/Service/Appointments/EventConflictFilter.php @@ -39,7 +39,7 @@ public function __construct(IManager $calendarManager, */ public function filter(AppointmentConfig $config, array $slots): array { $this->logger->debug('Slots before event conflict filtering:' . count($slots), ['app' => 'calendar-appointments']); - if(empty($slots)) { + if (empty($slots)) { return []; } $query = $this->calendarManager->newQuery($config->getPrincipalUri()); diff --git a/lib/Service/Appointments/MailService.php b/lib/Service/Appointments/MailService.php index 1a19e4e19..44461ae43 100644 --- a/lib/Service/Appointments/MailService.php +++ b/lib/Service/Appointments/MailService.php @@ -46,7 +46,8 @@ class MailService { private IManager $notificationManager; - public function __construct(IMailer $mailer, + public function __construct( + IMailer $mailer, IUserManager $userManager, IL10N $l10n, Defaults $defaults, @@ -55,7 +56,8 @@ public function __construct(IMailer $mailer, IDateTimeFormatter $dateFormatter, IFactory $lFactory, IManager $notificationManager, - private IConfig $userConfig) { + private IConfig $userConfig, + ) { $this->userManager = $userManager; $this->mailer = $mailer; $this->l10n = $l10n; diff --git a/lib/Service/Appointments/SlotExtrapolator.php b/lib/Service/Appointments/SlotExtrapolator.php index ecb89ac06..e850a6f71 100644 --- a/lib/Service/Appointments/SlotExtrapolator.php +++ b/lib/Service/Appointments/SlotExtrapolator.php @@ -12,7 +12,9 @@ class SlotExtrapolator { - public function __construct(private LoggerInterface $logger) { + public function __construct( + private LoggerInterface $logger, + ) { } /** @@ -24,7 +26,7 @@ public function __construct(private LoggerInterface $logger) { public function extrapolate(AppointmentConfig $config, array $availabilityIntervals): array { $this->logger->debug('Intervals before extrapolating:' . count($availabilityIntervals), ['app' => 'calendar-appointments']); - if(empty($availabilityIntervals)) { + if (empty($availabilityIntervals)) { return []; } foreach ($availabilityIntervals as $availabilityInterval) { diff --git a/tests/php/unit/bootstrap.php b/tests/php/unit/bootstrap.php index da6e72a92..50b46b43b 100755 --- a/tests/php/unit/bootstrap.php +++ b/tests/php/unit/bootstrap.php @@ -8,7 +8,7 @@ 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/vendor-bin/cs-fixer/composer.json b/vendor-bin/cs-fixer/composer.json index 76c8395dc..61f8252b8 100644 --- a/vendor-bin/cs-fixer/composer.json +++ b/vendor-bin/cs-fixer/composer.json @@ -6,6 +6,6 @@ "sort-packages": true }, "require-dev": { - "nextcloud/coding-standard": "^1.2.3" + "nextcloud/coding-standard": "^1.3.1" } } diff --git a/vendor-bin/cs-fixer/composer.lock b/vendor-bin/cs-fixer/composer.lock index a4435b5cd..bf008fb4e 100644 --- a/vendor-bin/cs-fixer/composer.lock +++ b/vendor-bin/cs-fixer/composer.lock @@ -4,24 +4,71 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "46c1bd20704b7b8aad3df18cc01261fa", + "content-hash": "b80be9f75e57093d11f0a5065039b255", "packages": [], "packages-dev": [ + { + "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" }, @@ -44,22 +91,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.63.1", + "version": "v3.64.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "27db669308f957ad1909e8c4aa4b957e4cfbc6c9" + "reference": "81ccfd24baf3a10810dab1152c403981a790b837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/27db669308f957ad1909e8c4aa4b957e4cfbc6c9", - "reference": "27db669308f957ad1909e8c4aa4b957e4cfbc6c9", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/81ccfd24baf3a10810dab1152c403981a790b837", + "reference": "81ccfd24baf3a10810dab1152c403981a790b837", "shasum": "" }, "require": { @@ -96,9 +143,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.63.1" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.64.0" }, - "time": "2024-08-26T14:03:48+00:00" + "time": "2024-08-30T23:10:11+00:00" } ], "aliases": [],