@@ -173,12 +173,12 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | return array_merge( |
176 | - ...array_map(function ($registration) use ($principalUri, $calendarUris) { |
|
176 | + ...array_map(function($registration) use ($principalUri, $calendarUris) { |
|
177 | 177 | try { |
178 | 178 | /** @var ICalendarProvider $provider */ |
179 | 179 | $provider = $this->container->get($registration->getService()); |
180 | 180 | } catch (Throwable $e) { |
181 | - $this->logger->error('Could not load calendar provider ' . $registration->getService() . ': ' . $e->getMessage(), [ |
|
181 | + $this->logger->error('Could not load calendar provider '.$registration->getService().': '.$e->getMessage(), [ |
|
182 | 182 | 'exception' => $e, |
183 | 183 | ]); |
184 | 184 | return []; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | string $message, |
230 | 230 | ): bool { |
231 | 231 | |
232 | - $userUri = 'principals/users/' . $userId; |
|
232 | + $userUri = 'principals/users/'.$userId; |
|
233 | 233 | |
234 | 234 | $userCalendars = $this->getCalendarsForPrincipal($userUri); |
235 | 235 | if (empty($userCalendars)) { |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | IUser $organizer, |
362 | 362 | array $attendees, |
363 | 363 | ): array { |
364 | - $organizerMailto = 'mailto:' . $organizer->getEMailAddress(); |
|
364 | + $organizerMailto = 'mailto:'.$organizer->getEMailAddress(); |
|
365 | 365 | $request = new VCalendar(); |
366 | 366 | $request->METHOD = 'REQUEST'; |
367 | 367 | $request->add('VFREEBUSY', [ |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @since 13.0.0 |
50 | 50 | */ |
51 | 51 | public function getKey(): string { |
52 | - return (string)$this->calendarInfo['id']; |
|
52 | + return (string) $this->calendarInfo['id']; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | public function getSchedulingTransparency(): ?ScheduleCalendarTransp { |
87 | - return $this->calendarInfo['{' . \OCA\DAV\CalDAV\Schedule\Plugin::NS_CALDAV . '}schedule-calendar-transp']; |
|
87 | + return $this->calendarInfo['{'.\OCA\DAV\CalDAV\Schedule\Plugin::NS_CALDAV.'}schedule-calendar-transp']; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | public function getSchedulingTimezone(): ?VTimeZone { |
91 | - $tzProp = '{' . \OCA\DAV\CalDAV\Schedule\Plugin::NS_CALDAV . '}calendar-timezone'; |
|
91 | + $tzProp = '{'.\OCA\DAV\CalDAV\Schedule\Plugin::NS_CALDAV.'}calendar-timezone'; |
|
92 | 92 | if (!isset($this->calendarInfo[$tzProp])) { |
93 | 93 | return null; |
94 | 94 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | try { |
203 | 203 | $server->createFile($fullCalendarFilename, $stream); |
204 | 204 | } catch (Conflict $e) { |
205 | - throw new CalendarException('Could not create new calendar event: ' . $e->getMessage(), 0, $e); |
|
205 | + throw new CalendarException('Could not create new calendar event: '.$e->getMessage(), 0, $e); |
|
206 | 206 | } finally { |
207 | 207 | fclose($stream); |
208 | 208 | } |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | // so set the custom principal here |
258 | 258 | $authPlugin->setCurrentPrincipal($this->calendar->getPrincipalURI()); |
259 | 259 | // retrieve all users addresses |
260 | - $userProperties = $server->getServer()->getProperties($this->calendar->getPrincipalURI(), [ self::DAV_PROPERTY_USER_ADDRESS, self::DAV_PROPERTY_USER_ADDRESSES ]); |
|
261 | - $userAddress = 'mailto:' . ($userProperties[self::DAV_PROPERTY_USER_ADDRESS] ?? null); |
|
260 | + $userProperties = $server->getServer()->getProperties($this->calendar->getPrincipalURI(), [self::DAV_PROPERTY_USER_ADDRESS, self::DAV_PROPERTY_USER_ADDRESSES]); |
|
261 | + $userAddress = 'mailto:'.($userProperties[self::DAV_PROPERTY_USER_ADDRESS] ?? null); |
|
262 | 262 | $userAddresses = $userProperties[self::DAV_PROPERTY_USER_ADDRESSES]->getHrefs() ?? []; |
263 | 263 | $userAddresses = array_map('strtolower', array_map('urldecode', $userAddresses)); |
264 | 264 | // validate the method, recipient and sender |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | $recipient = $userAddress; |
297 | 297 | } |
298 | 298 | } else { |
299 | - throw new CalendarException('iMip message contains a method that is not supported: ' . $imipMethod); |
|
299 | + throw new CalendarException('iMip message contains a method that is not supported: '.$imipMethod); |
|
300 | 300 | } |
301 | 301 | // generate the iTip message |
302 | 302 | $iTip = new Message(); |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $iTip->recipient = $recipient; |
306 | 306 | $iTip->component = 'VEVENT'; |
307 | 307 | $iTip->uid = $vObject->VEVENT->UID->getValue(); |
308 | - $iTip->sequence = isset($vObject->VEVENT->SEQUENCE) ? (int)$vObject->VEVENT->SEQUENCE->getValue() : 1; |
|
308 | + $iTip->sequence = isset($vObject->VEVENT->SEQUENCE) ? (int) $vObject->VEVENT->SEQUENCE->getValue() : 1; |
|
309 | 309 | $iTip->message = $vObject; |
310 | 310 | |
311 | 311 | $server->server->emit('schedule', [$iTip]); |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | use Sabre\VObject\ITip\Message; |
21 | 21 | |
22 | 22 | class CalendarImplTest extends \Test\TestCase { |
23 | - private CalDavBackend|MockObject $backend; |
|
24 | - private Calendar|MockObject $calendar; |
|
25 | - private CalendarImpl|MockObject $calendarImpl; |
|
23 | + private CalDavBackend | MockObject $backend; |
|
24 | + private Calendar | MockObject $calendar; |
|
25 | + private CalendarImpl | MockObject $calendarImpl; |
|
26 | 26 | private array $calendarInfo; |
27 | 27 | private VCalendar $vCalendar1a; |
28 | 28 | private array $mockExportCollection; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | public function testHandleImipRequest(): void { |
201 | - $userAddressSet = new class([ 'mailto:[email protected]', '/remote.php/dav/principals/users/attendee1/', ]) { |
|
201 | + $userAddressSet = new class(['mailto:[email protected]', '/remote.php/dav/principals/users/attendee1/', ]) { |
|
202 | 202 | public function __construct( |
203 | 203 | private array $hrefs, |
204 | 204 | ) { |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $iTip->recipient = $vObject->VEVENT->ATTENDEE->getValue(); |
218 | 218 | $iTip->component = 'VEVENT'; |
219 | 219 | $iTip->uid = $vObject->VEVENT->UID->getValue(); |
220 | - $iTip->sequence = (int)$vObject->VEVENT->SEQUENCE->getValue() ?? 0; |
|
220 | + $iTip->sequence = (int) $vObject->VEVENT->SEQUENCE->getValue() ?? 0; |
|
221 | 221 | $iTip->message = $vObject; |
222 | 222 | |
223 | 223 | /** @var CustomPrincipalPlugin|MockObject $authPlugin */ |