Passed
Push — master ( f97491...570c25 )
by Roeland
14:12 queued 10s
created
apps/dav/lib/CalDAV/BirthdayService.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
 			$calendar = $this->ensureCalendarExists($principalUri);
150 150
 			foreach (['', '-death', '-anniversary'] as $tag) {
151
-				$objectUri = $book['uri'] . '-' . $cardUri . $tag .'.ics';
151
+				$objectUri = $book['uri'].'-'.$cardUri.$tag.'.ics';
152 152
 				$this->calDavBackEnd->deleteCalendarObject($calendar['id'], $objectUri);
153 153
 			}
154 154
 		}
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	 * @return array|null
160 160
 	 * @throws \Sabre\DAV\Exception\BadRequest
161 161
 	 */
162
-	public function ensureCalendarExists(string $principal):?array {
162
+	public function ensureCalendarExists(string $principal): ?array {
163 163
 		$calendar = $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI);
164 164
 		if (!is_null($calendar)) {
165 165
 			return $calendar;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	 */
183 183
 	public function buildDateFromContact(string $cardData,
184 184
 										 string $dateField,
185
-										 string $postfix):?VCalendar {
185
+										 string $postfix): ?VCalendar {
186 186
 		if (empty($cardData)) {
187 187
 			return null;
188 188
 		}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 			return null;
206 206
 		}
207 207
 		$birthday = $doc->{$dateField};
208
-		if (!(string)$birthday) {
208
+		if (!(string) $birthday) {
209 209
 			return null;
210 210
 		}
211 211
 		// Skip if the BDAY property is not of the right type.
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		$unknownYear = false;
224 224
 		$originalYear = null;
225 225
 		if (!$dateParts['year']) {
226
-			$birthday = '1970-' . $dateParts['month'] . '-' . $dateParts['date'];
226
+			$birthday = '1970-'.$dateParts['month'].'-'.$dateParts['date'];
227 227
 
228 228
 			$unknownYear = true;
229 229
 		} else {
@@ -231,19 +231,19 @@  discard block
 block discarded – undo
231 231
 			if (isset($parameters['X-APPLE-OMIT-YEAR'])) {
232 232
 				$omitYear = $parameters['X-APPLE-OMIT-YEAR'];
233 233
 				if ($dateParts['year'] === $omitYear) {
234
-					$birthday = '1970-' . $dateParts['month'] . '-' . $dateParts['date'];
234
+					$birthday = '1970-'.$dateParts['month'].'-'.$dateParts['date'];
235 235
 					$unknownYear = true;
236 236
 				}
237 237
 			} else {
238
-				$originalYear = (int)$dateParts['year'];
238
+				$originalYear = (int) $dateParts['year'];
239 239
 				// 'X-APPLE-OMIT-YEAR' is not always present, at least iOS 12.4 uses the hard coded date of 1604 (the start of the gregorian calendar) when the year is unknown
240 240
 				if ($originalYear == 1604) {
241 241
 					$originalYear = null;
242 242
 					$unknownYear = true;
243
-					$birthday = '1970-' . $dateParts['month'] . '-' . $dateParts['date'];
243
+					$birthday = '1970-'.$dateParts['month'].'-'.$dateParts['date'];
244 244
 				}
245 245
 				if ($originalYear < 1970) {
246
-					$birthday = '1970-' . $dateParts['month'] . '-' . $dateParts['date'];
246
+					$birthday = '1970-'.$dateParts['month'].'-'.$dateParts['date'];
247 247
 				}
248 248
 			}
249 249
 		}
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 		);
279 279
 
280 280
 		$vEvent->DTEND['VALUE'] = 'DATE';
281
-		$vEvent->{'UID'} = $doc->UID . $postfix;
281
+		$vEvent->{'UID'} = $doc->UID.$postfix;
282 282
 		$vEvent->{'RRULE'} = 'FREQ=YEARLY';
283 283
 		$vEvent->{'SUMMARY'} = $summary;
284 284
 		$vEvent->{'TRANSP'} = 'TRANSPARENT';
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 									array $book,
379 379
 									int $calendarId,
380 380
 									array $type):void {
381
-		$objectUri = $book['uri'] . '-' . $cardUri . $type['postfix'] . '.ics';
381
+		$objectUri = $book['uri'].'-'.$cardUri.$type['postfix'].'.ics';
382 382
 		$calendarData = $this->buildDateFromContact($cardData, $type['field'], $type['postfix']);
383 383
 		$existing = $this->calDavBackEnd->getCalendarObject($calendarId, $objectUri);
384 384
 		if (is_null($calendarData)) {
@@ -441,20 +441,20 @@  discard block
 block discarded – undo
441 441
 					return implode('', [
442 442
 						'
Please login to merge, or discard this patch.