@@ -112,21 +112,21 @@ |
||
112 | 112 | public static function fromUdb3ModelContactPoint(Udb3ModelContactPoint $contactPoint) |
113 | 113 | { |
114 | 114 | $phones = array_map( |
115 | - function (TelephoneNumber $phone) { |
|
115 | + function(TelephoneNumber $phone) { |
|
116 | 116 | return $phone->toString(); |
117 | 117 | }, |
118 | 118 | $contactPoint->getTelephoneNumbers()->toArray() |
119 | 119 | ); |
120 | 120 | |
121 | 121 | $emails = array_map( |
122 | - function (EmailAddress $emailAddress) { |
|
122 | + function(EmailAddress $emailAddress) { |
|
123 | 123 | return $emailAddress->toString(); |
124 | 124 | }, |
125 | 125 | $contactPoint->getEmailAddresses()->toArray() |
126 | 126 | ); |
127 | 127 | |
128 | 128 | $urls = array_map( |
129 | - function (Url $url) { |
|
129 | + function(Url $url) { |
|
130 | 130 | return $url->toString(); |
131 | 131 | }, |
132 | 132 | $contactPoint->getUrls()->toArray() |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | $normalizedData = [ |
50 | 50 | '@id' => $this->iriGenerator->iri($mediaObject->getMediaObjectId()), |
51 | 51 | '@type' => $type, |
52 | - 'contentUrl' => (string) $mediaObject->getSourceLocation(), |
|
53 | - 'thumbnailUrl' => (string) $mediaObject->getSourceLocation(), |
|
54 | - 'description' => (string) $mediaObject->getDescription(), |
|
55 | - 'copyrightHolder' => (string) $mediaObject->getCopyrightHolder(), |
|
56 | - 'inLanguage' => (string) $mediaObject->getLanguage(), |
|
52 | + 'contentUrl' => (string)$mediaObject->getSourceLocation(), |
|
53 | + 'thumbnailUrl' => (string)$mediaObject->getSourceLocation(), |
|
54 | + 'description' => (string)$mediaObject->getDescription(), |
|
55 | + 'copyrightHolder' => (string)$mediaObject->getCopyrightHolder(), |
|
56 | + 'inLanguage' => (string)$mediaObject->getLanguage(), |
|
57 | 57 | ]; |
58 | 58 | |
59 | 59 | return $normalizedData; |
@@ -61,18 +61,18 @@ discard block |
||
61 | 61 | |
62 | 62 | public function serializeMimeType(MIMEType $mimeType) |
63 | 63 | { |
64 | - $typeParts = explode('/', (string) $mimeType); |
|
64 | + $typeParts = explode('/', (string)$mimeType); |
|
65 | 65 | $type = array_shift($typeParts); |
66 | 66 | |
67 | 67 | if ($type === 'image') { |
68 | 68 | return 'schema:ImageObject'; |
69 | 69 | } |
70 | 70 | |
71 | - if ((string) $mimeType === 'application/octet-stream') { |
|
71 | + if ((string)$mimeType === 'application/octet-stream') { |
|
72 | 72 | return 'schema:mediaObject'; |
73 | 73 | } |
74 | 74 | |
75 | - throw new UnsupportedException('Unsupported MIME-type "'. $mimeType .'"'); |
|
75 | + throw new UnsupportedException('Unsupported MIME-type "'.$mimeType.'"'); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | public function deserialize($data, $type, $format, array $context = array()) |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public function toCdbCalendar(CalendarInterface $calendar) |
41 | 41 | { |
42 | 42 | $weekScheme = $this->getWeekScheme($calendar); |
43 | - $calendarType = (string) $calendar->getType(); |
|
43 | + $calendarType = (string)$calendar->getType(); |
|
44 | 44 | |
45 | 45 | switch ($calendarType) { |
46 | 46 | case CalendarType::MULTIPLE: |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | private function countTimestamps(CultureFeed_Cdb_Data_Calendar_TimestampList $timestamps) |
101 | 101 | { |
102 | - $numberOfTimestamps = iterator_count($timestamps); |
|
102 | + $numberOfTimestamps = iterator_count($timestamps); |
|
103 | 103 | $timestamps->rewind(); |
104 | 104 | |
105 | 105 | return $numberOfTimestamps; |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | foreach ($openingHours as $openingHour) { |
134 | 134 | // In CDB2 every day needs to be a seperate entry. |
135 | 135 | if (is_array($openingHour)) { |
136 | - $openingHour = (object) $openingHour; |
|
136 | + $openingHour = (object)$openingHour; |
|
137 | 137 | } |
138 | 138 | foreach ($openingHour->getDayOfWeekCollection()->getDaysOfWeek() as $day) { |
139 | 139 | $openingTimesPerDay[$day->toNative()][] = new CultureFeed_Cdb_Data_Calendar_OpeningTime( |
140 | - $openingHour->getOpens()->toNativeString() . ':00', |
|
141 | - $openingHour->getCloses()->toNativeString() . ':00' |
|
140 | + $openingHour->getOpens()->toNativeString().':00', |
|
141 | + $openingHour->getCloses()->toNativeString().':00' |
|
142 | 142 | ); |
143 | 143 | } |
144 | 144 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | } else { |
222 | 222 | $days = iterator_to_array($period->getDatePeriod('1 DAY')); |
223 | 223 | $fillerTimestamps = array_map( |
224 | - function (DateTimeInterface $dateTime) use ($index) { |
|
224 | + function(DateTimeInterface $dateTime) use ($index) { |
|
225 | 225 | return new CultureFeed_Cdb_Data_Calendar_Timestamp( |
226 | 226 | $dateTime->format('Y-m-d'), |
227 | 227 | $this->createIndexedTimeString($index) |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | $newCalendar = array_reduce( |
235 | 235 | array_merge([$startTimestamp], $fillerTimestamps, [$endTimestamp]), |
236 | - function (CultureFeed_Cdb_Data_Calendar_TimestampList $calendar, $timestamp) { |
|
236 | + function(CultureFeed_Cdb_Data_Calendar_TimestampList $calendar, $timestamp) { |
|
237 | 237 | $calendar->add($timestamp); |
238 | 238 | return $calendar; |
239 | 239 | }, |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | |
258 | 258 | $time = is_int($index) |
259 | - ? $timestamp->format('H:i') . ':' . str_pad((string) $index, 2, '0', STR_PAD_LEFT) |
|
259 | + ? $timestamp->format('H:i').':'.str_pad((string)$index, 2, '0', STR_PAD_LEFT) |
|
260 | 260 | : $timestamp->format('H:i:s'); |
261 | 261 | |
262 | 262 | return $time; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | */ |
269 | 269 | private function createIndexedTimeString($index) |
270 | 270 | { |
271 | - return '00:00:' . str_pad((string) $index, 2, '0', STR_PAD_LEFT); |
|
271 | + return '00:00:'.str_pad((string)$index, 2, '0', STR_PAD_LEFT); |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $this->connection->exec($sql); |
43 | 43 | |
44 | 44 | if ($platform instanceof SqlitePlatform) { |
45 | - $sql = 'UPDATE SQLITE_SEQUENCE SET SEQ=0 WHERE NAME=' . $this->connection->quoteIdentifier($this->tableName); |
|
45 | + $sql = 'UPDATE SQLITE_SEQUENCE SET SEQ=0 WHERE NAME='.$this->connection->quoteIdentifier($this->tableName); |
|
46 | 46 | $this->connection->exec($sql); |
47 | 47 | } |
48 | 48 | } |
@@ -88,7 +88,7 @@ |
||
88 | 88 | ) |
89 | 89 | ); |
90 | 90 | |
91 | - $message = new DomainMessage( |
|
91 | + $message = new DomainMessage( |
|
92 | 92 | $this->id ?? UUID::generateAsString(), |
93 | 93 | $this->playhead ?? 1, |
94 | 94 | $finalMetaData, |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
71 | 71 | 'CultuurNet\UDB3\Event\Events\EventCreated', |
72 | - function (array $serializedObject) { |
|
72 | + function(array $serializedObject) { |
|
73 | 73 | return self::removeLocationNameAndAddress( |
74 | 74 | self::addDefaultMainLanguage($serializedObject) |
75 | 75 | ); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
80 | 80 | MajorInfoUpdated::class, |
81 | - function (array $serializedObject) { |
|
81 | + function(array $serializedObject) { |
|
82 | 82 | return self::removeLocationNameAndAddress( |
83 | 83 | self::replaceEventIdWithItemId($serializedObject) |
84 | 84 | ); |
@@ -87,14 +87,14 @@ discard block |
||
87 | 87 | |
88 | 88 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
89 | 89 | 'CultuurNet\UDB3\Place\Events\PlaceCreated', |
90 | - function (array $serializedObject) { |
|
90 | + function(array $serializedObject) { |
|
91 | 91 | return self::addDefaultMainLanguage($serializedObject); |
92 | 92 | } |
93 | 93 | ); |
94 | 94 | |
95 | 95 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
96 | 96 | 'CultuurNet\UDB3\Organizer\Events\OrganizerCreatedWithUniqueWebsite', |
97 | - function (array $serializedObject) { |
|
97 | + function(array $serializedObject) { |
|
98 | 98 | return self::addDefaultMainLanguage($serializedObject); |
99 | 99 | } |
100 | 100 | ); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
107 | 107 | 'CultuurNet\UDB3\Event\TitleTranslated', |
108 | - function (array $serializedObject) { |
|
108 | + function(array $serializedObject) { |
|
109 | 109 | $serializedObject['class'] = TitleTranslated::class; |
110 | 110 | |
111 | 111 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
118 | 118 | 'CultuurNet\UDB3\Event\DescriptionTranslated', |
119 | - function (array $serializedObject) { |
|
119 | + function(array $serializedObject) { |
|
120 | 120 | $serializedObject['class'] = DescriptionTranslated::class; |
121 | 121 | |
122 | 122 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -131,49 +131,49 @@ discard block |
||
131 | 131 | |
132 | 132 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
133 | 133 | 'CultuurNet\UDB3\Label\Events\MadeInvisible', |
134 | - function (array $serializedObject) use ($labelRepository) { |
|
134 | + function(array $serializedObject) use ($labelRepository) { |
|
135 | 135 | return self::addLabelName($serializedObject, $labelRepository); |
136 | 136 | } |
137 | 137 | ); |
138 | 138 | |
139 | 139 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
140 | 140 | 'CultuurNet\UDB3\Label\Events\MadeVisible', |
141 | - function (array $serializedObject) use ($labelRepository) { |
|
141 | + function(array $serializedObject) use ($labelRepository) { |
|
142 | 142 | return self::addLabelName($serializedObject, $labelRepository); |
143 | 143 | } |
144 | 144 | ); |
145 | 145 | |
146 | 146 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
147 | 147 | 'CultuurNet\UDB3\Label\Events\MadePrivate', |
148 | - function (array $serializedObject) use ($labelRepository) { |
|
148 | + function(array $serializedObject) use ($labelRepository) { |
|
149 | 149 | return self::addLabelName($serializedObject, $labelRepository); |
150 | 150 | } |
151 | 151 | ); |
152 | 152 | |
153 | 153 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
154 | 154 | 'CultuurNet\UDB3\Label\Events\MadePublic', |
155 | - function (array $serializedObject) use ($labelRepository) { |
|
155 | + function(array $serializedObject) use ($labelRepository) { |
|
156 | 156 | return self::addLabelName($serializedObject, $labelRepository); |
157 | 157 | } |
158 | 158 | ); |
159 | 159 | |
160 | 160 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
161 | 161 | 'CultuurNet\UDB3\Organizer\Events\LabelAdded', |
162 | - function (array $serializedObject) use ($labelRepository) { |
|
162 | + function(array $serializedObject) use ($labelRepository) { |
|
163 | 163 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
164 | 164 | } |
165 | 165 | ); |
166 | 166 | |
167 | 167 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
168 | 168 | 'CultuurNet\UDB3\Organizer\Events\LabelRemoved', |
169 | - function (array $serializedObject) use ($labelRepository) { |
|
169 | + function(array $serializedObject) use ($labelRepository) { |
|
170 | 170 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
171 | 171 | } |
172 | 172 | ); |
173 | 173 | |
174 | 174 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
175 | 175 | 'CultuurNet\UDB3\Event\Events\EventWasLabelled', |
176 | - function (array $serializedObject) { |
|
176 | + function(array $serializedObject) { |
|
177 | 177 | $serializedObject['class'] = LabelAdded::class; |
178 | 178 | |
179 | 179 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
186 | 186 | 'CultuurNet\UDB3\Event\EventWasTagged', |
187 | - function (array $serializedObject) { |
|
187 | + function(array $serializedObject) { |
|
188 | 188 | $serializedObject['class'] = LabelAdded::class; |
189 | 189 | |
190 | 190 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
199 | 199 | 'CultuurNet\UDB3\Event\TagErased', |
200 | - function (array $serializedObject) { |
|
200 | + function(array $serializedObject) { |
|
201 | 201 | $serializedObject['class'] = LabelRemoved::class; |
202 | 202 | |
203 | 203 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
212 | 212 | 'CultuurNet\UDB3\Event\Events\Unlabelled', |
213 | - function (array $serializedObject) { |
|
213 | + function(array $serializedObject) { |
|
214 | 214 | $serializedObject['class'] = LabelRemoved::class; |
215 | 215 | |
216 | 216 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | |
226 | 226 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
227 | 227 | 'CultuurNet\UDB3\Event\EventImportedFromUDB2', |
228 | - function (array $serializedObject) { |
|
228 | + function(array $serializedObject) { |
|
229 | 229 | $serializedObject['class'] = EventImportedFromUDB2::class; |
230 | 230 | |
231 | 231 | return $serializedObject; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
239 | 239 | 'CultuurNet\UDB3\Place\Events\FacilitiesUpdated', |
240 | - function (array $serializedObject) { |
|
240 | + function(array $serializedObject) { |
|
241 | 241 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
242 | 242 | |
243 | 243 | return $serializedObject; |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | */ |
250 | 250 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
251 | 251 | 'CultuurNet\UDB3\Place\Events\GeoCoordinatesUpdated', |
252 | - function (array $serializedObject) { |
|
252 | + function(array $serializedObject) { |
|
253 | 253 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
254 | 254 | |
255 | 255 | return $serializedObject; |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | /** |
260 | 260 | * BOOKING INFO EVENT |
261 | 261 | */ |
262 | - $manipulateAvailability = function (array $serializedBookingInfo, $propertyName) { |
|
262 | + $manipulateAvailability = function(array $serializedBookingInfo, $propertyName) { |
|
263 | 263 | if (!isset($serializedBookingInfo[$propertyName]) || empty($serializedBookingInfo[$propertyName])) { |
264 | 264 | $serializedBookingInfo[$propertyName] = null; |
265 | 265 | return $serializedBookingInfo; |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | return $serializedBookingInfo; |
290 | 290 | }; |
291 | 291 | |
292 | - $manipulateUrlLabel = function (array $serializedBookingInfo) { |
|
292 | + $manipulateUrlLabel = function(array $serializedBookingInfo) { |
|
293 | 293 | if (!isset($serializedBookingInfo['urlLabel'])) { |
294 | 294 | return $serializedBookingInfo; |
295 | 295 | } |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | return $serializedBookingInfo; |
316 | 316 | }; |
317 | 317 | |
318 | - $manipulateBookingInfoEvent = function ( |
|
318 | + $manipulateBookingInfoEvent = function( |
|
319 | 319 | array $serializedEvent |
320 | 320 | ) use ( |
321 | 321 | $manipulateAvailability, |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | foreach ($refactoredEventEvents as $refactoredEventEvent) { |
360 | 360 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
361 | 361 | $refactoredEventEvent, |
362 | - function (array $serializedObject) { |
|
362 | + function(array $serializedObject) { |
|
363 | 363 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
364 | 364 | return $serializedObject; |
365 | 365 | } |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | foreach ($refactoredPlaceEvents as $refactoredPlaceEvent) { |
383 | 383 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
384 | 384 | $refactoredPlaceEvent, |
385 | - function (array $serializedObject) { |
|
385 | + function(array $serializedObject) { |
|
386 | 386 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
387 | 387 | return $serializedObject; |
388 | 388 | } |
@@ -400,11 +400,11 @@ discard block |
||
400 | 400 | foreach ($priceInfoEvents as $priceInfoEvent) { |
401 | 401 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
402 | 402 | $priceInfoEvent, |
403 | - function (array $serializedObject) { |
|
403 | + function(array $serializedObject) { |
|
404 | 404 | $payload = &$serializedObject['payload']; |
405 | 405 | $priceInfo = &$payload['price_info']; |
406 | 406 | $tariffs = array_map( |
407 | - function (array $tariff) { |
|
407 | + function(array $tariff) { |
|
408 | 408 | $name = $tariff['name']; |
409 | 409 | if (is_string($name)) { |
410 | 410 | $name = ['nl' => $name]; |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | */ |
426 | 426 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
427 | 427 | 'CultuurNet\UDB3\Role\Events\ConstraintCreated', |
428 | - function (array $serializedObject) { |
|
428 | + function(array $serializedObject) { |
|
429 | 429 | $serializedObject['class'] = ConstraintAdded::class; |
430 | 430 | return self::addDefaultSapiVersion($serializedObject); |
431 | 431 | } |
@@ -433,14 +433,14 @@ discard block |
||
433 | 433 | |
434 | 434 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
435 | 435 | ConstraintUpdated::class, |
436 | - function (array $serializedObject) { |
|
436 | + function(array $serializedObject) { |
|
437 | 437 | return self::addDefaultSapiVersion($serializedObject); |
438 | 438 | } |
439 | 439 | ); |
440 | 440 | |
441 | 441 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
442 | 442 | ConstraintRemoved::class, |
443 | - function (array $serializedObject) { |
|
443 | + function(array $serializedObject) { |
|
444 | 444 | return self::addDefaultSapiVersion($serializedObject); |
445 | 445 | } |
446 | 446 | ); |
@@ -26,15 +26,15 @@ discard block |
||
26 | 26 | if ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_PeriodList) { |
27 | 27 | /** @var \CultureFeed_Cdb_Data_Calendar_Period $period */ |
28 | 28 | $period = $cdbCalendar->current(); |
29 | - $startDateString = $period->getDateFrom() . 'T00:00:00'; |
|
29 | + $startDateString = $period->getDateFrom().'T00:00:00'; |
|
30 | 30 | } elseif ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_TimestampList) { |
31 | 31 | $firstTimestamp = $cdbCalendar->current(); |
32 | 32 | $cdbCalendarAsArray = iterator_to_array($cdbCalendar); |
33 | 33 | $timestamp = $this->getFirstTimestamp($cdbCalendarAsArray, $firstTimestamp); |
34 | 34 | if ($timestamp->getStartTime()) { |
35 | - $startDateString = $timestamp->getDate() . 'T' . substr($timestamp->getStartTime(), 0, 5) . ':00'; |
|
35 | + $startDateString = $timestamp->getDate().'T'.substr($timestamp->getStartTime(), 0, 5).':00'; |
|
36 | 36 | } else { |
37 | - $startDateString = $timestamp->getDate() . 'T00:00:00'; |
|
37 | + $startDateString = $timestamp->getDate().'T00:00:00'; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | $startDate = !empty($startDateString) ? DateTimeFactory::dateTimeFromDateString($startDateString) : null; |
@@ -47,17 +47,17 @@ discard block |
||
47 | 47 | if ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_PeriodList) { |
48 | 48 | /** @var \CultureFeed_Cdb_Data_Calendar_Period $period */ |
49 | 49 | $period = $cdbCalendar->current(); |
50 | - $endDateString = $period->getDateTo() . 'T00:00:00'; |
|
50 | + $endDateString = $period->getDateTo().'T00:00:00'; |
|
51 | 51 | } elseif ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_TimestampList) { |
52 | 52 | $firstTimestamp = $cdbCalendar->current(); |
53 | 53 | /** @var \CultureFeed_Cdb_Data_Calendar_Timestamp $timestamp */ |
54 | 54 | $cdbCalendarAsArray = iterator_to_array($cdbCalendar); |
55 | 55 | $timestamp = $this->getLastTimestamp($cdbCalendarAsArray, $firstTimestamp); |
56 | 56 | if ($timestamp->getEndTime()) { |
57 | - $endDateString = $timestamp->getDate() . 'T' . $timestamp->getEndTime(); |
|
57 | + $endDateString = $timestamp->getDate().'T'.$timestamp->getEndTime(); |
|
58 | 58 | } else { |
59 | 59 | $endTime = $timestamp->getStartTime() ? $timestamp->getStartTime() : '00:00:00'; |
60 | - $endDateString = $timestamp->getDate() . 'T' . $endTime; |
|
60 | + $endDateString = $timestamp->getDate().'T'.$endTime; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | $endDate = !empty($endDateString) ? DateTimeFactory::dateTimeFromDateString($endDateString) : null; |
@@ -75,12 +75,12 @@ discard block |
||
75 | 75 | $cdbCalendar->next(); |
76 | 76 | |
77 | 77 | $startTime = $timestamp->getStartTime() ? $timestamp->getStartTime() : '00:00:00'; |
78 | - $startDateString = $timestamp->getDate() . 'T' . $startTime; |
|
78 | + $startDateString = $timestamp->getDate().'T'.$startTime; |
|
79 | 79 | |
80 | 80 | if ($timestamp->getEndTime()) { |
81 | - $endDateString = $timestamp->getDate() . 'T' . $timestamp->getEndTime(); |
|
81 | + $endDateString = $timestamp->getDate().'T'.$timestamp->getEndTime(); |
|
82 | 82 | } else { |
83 | - $endDateString = $timestamp->getDate() . 'T' . $startTime; |
|
83 | + $endDateString = $timestamp->getDate().'T'.$startTime; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | $timestamp = $this->createTimestamp( |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $periods = array_map( |
100 | - function (array $periodParts) { |
|
100 | + function(array $periodParts) { |
|
101 | 101 | $firstPart = array_shift($periodParts); |
102 | 102 | $lastPart = array_pop($periodParts); |
103 | 103 | return new Timestamp( |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | array $openingHours = array() |
63 | 63 | ) { |
64 | 64 | if (($type->is(CalendarType::MULTIPLE()) || $type->is(CalendarType::SINGLE())) && empty($startDate)) { |
65 | - throw new \UnexpectedValueException('Start date can not be empty for calendar type: ' . $type . '.'); |
|
65 | + throw new \UnexpectedValueException('Start date can not be empty for calendar type: '.$type.'.'); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | if ($type->is(CalendarType::PERIODIC()) && (empty($startDate) || empty($endDate))) { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $this->endDate = $endDate; |
87 | 87 | $this->openingHours = $openingHours; |
88 | 88 | |
89 | - usort($timestamps, function (Timestamp $timestamp, Timestamp $otherTimestamp) { |
|
89 | + usort($timestamps, function(Timestamp $timestamp, Timestamp $otherTimestamp) { |
|
90 | 90 | return $timestamp->getStartDate() <=> $otherTimestamp->getStartDate(); |
91 | 91 | }); |
92 | 92 | |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | public function serialize() |
109 | 109 | { |
110 | 110 | $serializedTimestamps = array_map( |
111 | - function (Timestamp $timestamp) { |
|
111 | + function(Timestamp $timestamp) { |
|
112 | 112 | return $timestamp->serialize(); |
113 | 113 | }, |
114 | 114 | $this->timestamps |
115 | 115 | ); |
116 | 116 | |
117 | 117 | $serializedOpeningHours = array_map( |
118 | - function (OpeningHour $openingHour) { |
|
118 | + function(OpeningHour $openingHour) { |
|
119 | 119 | return $openingHour->serialize(); |
120 | 120 | }, |
121 | 121 | $this->openingHours |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | !empty($data['startDate']) ? self::deserializeDateTime($data['startDate']) : null, |
144 | 144 | !empty($data['endDate']) ? self::deserializeDateTime($data['endDate']) : null, |
145 | 145 | !empty($data['timestamps']) ? array_map( |
146 | - function ($timestamp) { |
|
146 | + function($timestamp) { |
|
147 | 147 | return Timestamp::deserialize($timestamp); |
148 | 148 | }, |
149 | 149 | $data['timestamps'] |
150 | 150 | ) : [], |
151 | 151 | !empty($data['openingHours']) ? array_map( |
152 | - function ($openingHour) { |
|
152 | + function($openingHour) { |
|
153 | 153 | return OpeningHour::deserialize($openingHour); |
154 | 154 | }, |
155 | 155 | $data['openingHours'] |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | |
309 | 309 | if ($calendar instanceof CalendarWithSubEvents) { |
310 | 310 | $timestamps = array_map( |
311 | - function (DateRange $dateRange) { |
|
311 | + function(DateRange $dateRange) { |
|
312 | 312 | return Timestamp::fromUdb3ModelDateRange($dateRange); |
313 | 313 | }, |
314 | 314 | $calendar->getSubEvents()->toArray() |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | |
318 | 318 | if ($calendar instanceof CalendarWithOpeningHours) { |
319 | 319 | $openingHours = array_map( |
320 | - function (Udb3ModelOpeningHour $openingHour) { |
|
320 | + function(Udb3ModelOpeningHour $openingHour) { |
|
321 | 321 | return OpeningHour::fromUdb3ModelOpeningHour($openingHour); |
322 | 322 | }, |
323 | 323 | $calendar->getOpeningHours()->toArray() |