Completed
Pull Request — master (#7707)
by Georg
55:12
created
apps/dav/lib/CalDAV/BirthdayService.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
 			$calendar = $this->ensureCalendarExists($principalUri);
122 122
 			foreach (['', '-death', '-anniversary'] as $tag) {
123
-				$objectUri = $book['uri'] . '-' . $cardUri . $tag .'.ics';
123
+				$objectUri = $book['uri'].'-'.$cardUri.$tag.'.ics';
124 124
 				$this->calDavBackEnd->deleteCalendarObject($calendar['id'], $objectUri);
125 125
 			}
126 126
 		}
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 			return null;
176 176
 		}
177 177
 		$birthday = $doc->{$dateField};
178
-		if (!(string)$birthday) {
178
+		if (!(string) $birthday) {
179 179
 			return null;
180 180
 		}
181 181
 		// Skip if the BDAY property is not of the right type.
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
 		$unknownYear = false;
194 194
 		if (!$dateParts['year']) {
195
-			$birthday = '1900-' . $dateParts['month'] . '-' . $dateParts['date'];
195
+			$birthday = '1900-'.$dateParts['month'].'-'.$dateParts['date'];
196 196
 
197 197
 			$unknownYear = true;
198 198
 		}
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
 			return null;
204 204
 		}
205 205
 		if ($unknownYear) {
206
-			$summary = $doc->FN->getValue() . ' ' . $summarySymbol;
206
+			$summary = $doc->FN->getValue().' '.$summarySymbol;
207 207
 		} else {
208
-			$year = (int)$date->format('Y');
209
-			$summary = $doc->FN->getValue() . " ($summarySymbol$year)";
208
+			$year = (int) $date->format('Y');
209
+			$summary = $doc->FN->getValue()." ($summarySymbol$year)";
210 210
 		}
211 211
 		$vCal = new VCalendar();
212 212
 		$vCal->VERSION = '2.0';
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 			$date
223 223
 		);
224 224
 		$vEvent->DTEND['VALUE'] = 'DATE';
225
-		$vEvent->{'UID'} = $doc->UID . $postfix;
225
+		$vEvent->{'UID'} = $doc->UID.$postfix;
226 226
 		$vEvent->{'RRULE'} = 'FREQ=YEARLY';
227 227
 		$vEvent->{'SUMMARY'} = $summary;
228 228
 		$vEvent->{'TRANSP'} = 'TRANSPARENT';
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 		$principal = 'principals/users/'.$user;
243 243
 		$this->ensureCalendarExists($principal);
244 244
 		$books = $this->cardDavBackEnd->getAddressBooksForUser($principal);
245
-		foreach($books as $book) {
245
+		foreach ($books as $book) {
246 246
 			$cards = $this->cardDavBackEnd->getCards($book['id']);
247
-			foreach($cards as $card) {
247
+			foreach ($cards as $card) {
248 248
 				$this->onCardChanged($book['id'], $card['uri'], $card['carddata']);
249 249
 			}
250 250
 		}
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	 * @param string[] $type
298 298
 	 */
299 299
 	private function updateCalendar($cardUri, $cardData, $book, $calendarId, $type) {
300
-		$objectUri = $book['uri'] . '-' . $cardUri . $type['postfix'] . '.ics';
300
+		$objectUri = $book['uri'].'-'.$cardUri.$type['postfix'].'.ics';
301 301
 		$calendarData = $this->buildDateFromContact($cardData, $type['field'], $type['postfix'], $type['symbol']);
302 302
 		$existing = $this->calDavBackEnd->getCalendarObject($calendarId, $objectUri);
303 303
 		if (is_null($calendarData)) {
Please login to merge, or discard this patch.