@@ -5,7 +5,6 @@ |
||
5 | 5 | use Broadway\Serializer\SerializableInterface; |
6 | 6 | use DateTime; |
7 | 7 | use DateTimeInterface; |
8 | -use ValueObjects\DateTime\Date; |
|
9 | 8 | |
10 | 9 | /** |
11 | 10 | * Provices a class for a timestamp. |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ); |
85 | 85 | |
86 | 86 | $calendar = [ |
87 | - 'type' => $this->type, |
|
87 | + 'type' => $this->type, |
|
88 | 88 | ]; |
89 | 89 | |
90 | 90 | empty($this->startDate) ?: $calendar['startDate'] = $this->startDate->format(DateTime::ATOM); |
@@ -167,9 +167,9 @@ discard block |
||
167 | 167 | $jsonLd['subEvent'] = array(); |
168 | 168 | foreach ($timestamps as $timestamp) { |
169 | 169 | $jsonLd['subEvent'][] = array( |
170 | - '@type' => 'Event', |
|
171 | - 'startDate' => $timestamp->getStartDate()->format(DateTime::ATOM), |
|
172 | - 'endDate' => $timestamp->getEndDate()->format(DateTime::ATOM), |
|
170 | + '@type' => 'Event', |
|
171 | + 'startDate' => $timestamp->getStartDate()->format(DateTime::ATOM), |
|
172 | + 'endDate' => $timestamp->getEndDate()->format(DateTime::ATOM), |
|
173 | 173 | ); |
174 | 174 | } |
175 | 175 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | array $openingHours = array() |
55 | 55 | ) { |
56 | 56 | if (($type->is(CalendarType::MULTIPLE()) || $type->is(CalendarType::SINGLE())) && empty($startDate)) { |
57 | - throw new \UnexpectedValueException('Start date can not be empty for calendar type: ' . $type . '.'); |
|
57 | + throw new \UnexpectedValueException('Start date can not be empty for calendar type: '.$type.'.'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($type->is(CalendarType::PERIODIC()) && (empty($startDate) || empty($endDate))) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | public function serialize() |
83 | 83 | { |
84 | 84 | $serializedTimestamps = array_map( |
85 | - function (Timestamp $timestamp) { |
|
85 | + function(Timestamp $timestamp) { |
|
86 | 86 | return $timestamp->serialize(); |
87 | 87 | }, |
88 | 88 | $this->timestamps |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | !empty($data['startDate']) ? self::deserializeDateTime($data['startDate']) : null, |
111 | 111 | !empty($data['endDate']) ? self::deserializeDateTime($data['endDate']) : null, |
112 | 112 | !empty($data['timestamps']) ? array_map( |
113 | - function ($timestamp) { |
|
113 | + function($timestamp) { |
|
114 | 114 | return Timestamp::deserialize($timestamp); |
115 | 115 | }, |
116 | 116 | $data['timestamps'] |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | // Permanent - with openingtimes |
211 | 211 | $openingHours = $this->getOpeningHours(); |
212 | 212 | if (!empty($openingHours)) { |
213 | - $jsonLd['openingHours'] = (array) $openingHours; |
|
213 | + $jsonLd['openingHours'] = (array)$openingHours; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | return $jsonLd; |
@@ -106,7 +106,7 @@ |
||
106 | 106 | $label = $this->labelReadRepository->getByUuid($command->getUuid()); |
107 | 107 | if ($label === null) { |
108 | 108 | throw new \InvalidArgumentException( |
109 | - 'Did not find a label with uuid: ' . $command->getUuid()->toNative() |
|
109 | + 'Did not find a label with uuid: '.$command->getUuid()->toNative() |
|
110 | 110 | ); |
111 | 111 | } |
112 | 112 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | |
24 | 24 | /** |
25 | 25 | * @param EventInfoServiceInterface|null $uitpas |
26 | - * @param string[]|null $include |
|
26 | + * @param string[] $include |
|
27 | 27 | */ |
28 | 28 | public function __construct($include = null, EventInfoServiceInterface $uitpas = null) |
29 | 29 | { |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | protected function columns() |
161 | 161 | { |
162 | 162 | $formatter = $this; |
163 | - $contactPoint = function (\stdClass $event, $type = null) use ($formatter) { |
|
163 | + $contactPoint = function(\stdClass $event, $type = null) use ($formatter) { |
|
164 | 164 | return $formatter->contactPoint($event, $type); |
165 | 165 | }; |
166 | 166 | |
167 | 167 | return [ |
168 | 168 | 'id' => [ |
169 | 169 | 'name' => 'id', |
170 | - 'include' => function ($event) { |
|
170 | + 'include' => function($event) { |
|
171 | 171 | $eventUri = $event->{'@id'}; |
172 | 172 | $uriParts = explode('/', $eventUri); |
173 | 173 | $eventId = array_pop($uriParts); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | ], |
179 | 179 | 'name' => [ |
180 | 180 | 'name' => 'titel', |
181 | - 'include' => function ($event) { |
|
181 | + 'include' => function($event) { |
|
182 | 182 | if ($event->name) { |
183 | 183 | return reset($event->name); |
184 | 184 | } |
@@ -187,14 +187,14 @@ discard block |
||
187 | 187 | ], |
188 | 188 | 'creator' => [ |
189 | 189 | 'name' => 'auteur', |
190 | - 'include' => function ($event) { |
|
190 | + 'include' => function($event) { |
|
191 | 191 | return $event->creator; |
192 | 192 | }, |
193 | 193 | 'property' => 'creator' |
194 | 194 | ], |
195 | 195 | 'bookingInfo.price' => [ |
196 | 196 | 'name' => 'prijs', |
197 | - 'include' => function ($event) { |
|
197 | + 'include' => function($event) { |
|
198 | 198 | if (property_exists($event, 'bookingInfo') && is_array($event->bookingInfo)) { |
199 | 199 | $first = reset($event->bookingInfo); |
200 | 200 | if (is_object($first) && property_exists($first, 'price')) { |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | ], |
207 | 207 | 'kansentarief' => [ |
208 | 208 | 'name' => 'kansentarief', |
209 | - 'include' => function ($event) { |
|
209 | + 'include' => function($event) { |
|
210 | 210 | $eventUri = $event->{'@id'}; |
211 | 211 | $uriParts = explode('/', $eventUri); |
212 | 212 | $eventId = array_pop($uriParts); |
@@ -215,18 +215,18 @@ discard block |
||
215 | 215 | if ($uitpasInfo) { |
216 | 216 | $uitpasInfo = $this->uitpasInfoFormatter->format($uitpasInfo); |
217 | 217 | |
218 | - $cardSystems = array_reduce($uitpasInfo['prices'], function ($cardSystems, $tariff) { |
|
218 | + $cardSystems = array_reduce($uitpasInfo['prices'], function($cardSystems, $tariff) { |
|
219 | 219 | $cardSystem = isset($cardSystems[$tariff['cardSystem']]) ? $cardSystems[$tariff['cardSystem']] : ''; |
220 | 220 | $cardSystem = empty($cardSystem) |
221 | - ? $tariff['cardSystem'] .': € ' . $tariff['price'] |
|
222 | - : $cardSystem . ' / € ' . $tariff['price']; |
|
221 | + ? $tariff['cardSystem'].': € '.$tariff['price'] |
|
222 | + : $cardSystem.' / € '.$tariff['price']; |
|
223 | 223 | |
224 | 224 | $cardSystems[$tariff['cardSystem']] = $cardSystem; |
225 | 225 | return $cardSystems; |
226 | 226 | }, []); |
227 | 227 | |
228 | - $formattedTariffs = array_reduce($cardSystems, function ($tariffs, $cardSystemPrices) { |
|
229 | - return $tariffs ? $tariffs . ' | ' . $cardSystemPrices : $cardSystemPrices; |
|
228 | + $formattedTariffs = array_reduce($cardSystems, function($tariffs, $cardSystemPrices) { |
|
229 | + return $tariffs ? $tariffs.' | '.$cardSystemPrices : $cardSystemPrices; |
|
230 | 230 | }); |
231 | 231 | |
232 | 232 | if (!empty($formattedTariffs)) { |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | ], |
239 | 239 | 'bookingInfo.url' => [ |
240 | 240 | 'name' => 'ticket link', |
241 | - 'include' => function ($event) { |
|
241 | + 'include' => function($event) { |
|
242 | 242 | if (property_exists($event, 'bookingInfo')) { |
243 | 243 | $first = reset($event->bookingInfo); |
244 | 244 | if (is_object($first) && property_exists($first, 'url')) { |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | ], |
251 | 251 | 'description' => [ |
252 | 252 | 'name' => 'omschrijving', |
253 | - 'include' => function ($event) { |
|
253 | + 'include' => function($event) { |
|
254 | 254 | if (property_exists($event, 'description')) { |
255 | 255 | $description = reset($event->description); |
256 | 256 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | ], |
271 | 271 | 'organizer' => [ |
272 | 272 | 'name' => 'organisatie', |
273 | - 'include' => function ($event) { |
|
273 | + 'include' => function($event) { |
|
274 | 274 | if (property_exists($event, 'organizer') && |
275 | 275 | isset($event->organizer->name) |
276 | 276 | ) { |
@@ -281,14 +281,14 @@ discard block |
||
281 | 281 | ], |
282 | 282 | 'calendarSummary' => [ |
283 | 283 | 'name' => 'tijdsinformatie', |
284 | - 'include' => function ($event) { |
|
284 | + 'include' => function($event) { |
|
285 | 285 | return $event->calendarSummary; |
286 | 286 | }, |
287 | 287 | 'property' => 'calendarSummary' |
288 | 288 | ], |
289 | 289 | 'labels' => [ |
290 | 290 | 'name' => 'labels', |
291 | - 'include' => function ($event) { |
|
291 | + 'include' => function($event) { |
|
292 | 292 | if (isset($event->labels)) { |
293 | 293 | return implode(';', $event->labels); |
294 | 294 | } |
@@ -297,14 +297,14 @@ discard block |
||
297 | 297 | ], |
298 | 298 | 'typicalAgeRange' => [ |
299 | 299 | 'name' => 'leeftijd', |
300 | - 'include' => function ($event) { |
|
300 | + 'include' => function($event) { |
|
301 | 301 | return $event->typicalAgeRange; |
302 | 302 | }, |
303 | 303 | 'property' => 'typicalAgeRange' |
304 | 304 | ], |
305 | 305 | 'performer' => [ |
306 | 306 | 'name' => 'uitvoerders', |
307 | - 'include' => function ($event) { |
|
307 | + 'include' => function($event) { |
|
308 | 308 | if (property_exists($event, 'performer')) { |
309 | 309 | $performerNames = []; |
310 | 310 | foreach ($event->performer as $performer) { |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | ], |
319 | 319 | 'language' => [ |
320 | 320 | 'name' => 'taal van het aanbod', |
321 | - 'include' => function ($event) { |
|
321 | + 'include' => function($event) { |
|
322 | 322 | if (property_exists($event, 'language')) { |
323 | 323 | return implode(';', $event->language); |
324 | 324 | } |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | ], |
328 | 328 | 'terms.theme' => [ |
329 | 329 | 'name' => 'thema', |
330 | - 'include' => function ($event) { |
|
330 | + 'include' => function($event) { |
|
331 | 331 | if (property_exists($event, 'terms')) { |
332 | 332 | foreach ($event->terms as $term) { |
333 | 333 | if ($term->domain && $term->label && $term->domain == 'theme') { |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | ], |
341 | 341 | 'terms.eventtype' => [ |
342 | 342 | 'name' => 'soort aanbod', |
343 | - 'include' => function ($event) { |
|
343 | + 'include' => function($event) { |
|
344 | 344 | if (property_exists($event, 'terms')) { |
345 | 345 | foreach ($event->terms as $term) { |
346 | 346 | if ($term->domain && $term->label && $term->domain == 'eventtype') { |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | ], |
354 | 354 | 'created' => [ |
355 | 355 | 'name' => 'datum aangemaakt', |
356 | - 'include' => function ($event) { |
|
356 | + 'include' => function($event) { |
|
357 | 357 | if (!empty($event->created)) { |
358 | 358 | return $this->formatDate($event->created); |
359 | 359 | } else { |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | ], |
365 | 365 | 'modified' => [ |
366 | 366 | 'name' => 'datum laatste aanpassing', |
367 | - 'include' => function ($event) { |
|
367 | + 'include' => function($event) { |
|
368 | 368 | if (!empty($event->modified)) { |
369 | 369 | return $this->formatDate($event->modified); |
370 | 370 | } else { |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | ], |
376 | 376 | 'available' => [ |
377 | 377 | 'name' => 'embargodatum', |
378 | - 'include' => function ($event) { |
|
378 | + 'include' => function($event) { |
|
379 | 379 | if (!empty($event->available)) { |
380 | 380 | return $this->formatDateWithoutTime($event->available); |
381 | 381 | } else { |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | ], |
387 | 387 | 'startDate' => [ |
388 | 388 | 'name' => 'startdatum', |
389 | - 'include' => function ($event) { |
|
389 | + 'include' => function($event) { |
|
390 | 390 | if (!empty($event->startDate)) { |
391 | 391 | return $this->formatDate($event->startDate); |
392 | 392 | } else { |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | ], |
398 | 398 | 'endDate' => [ |
399 | 399 | 'name' => 'einddatum', |
400 | - 'include' => function ($event) { |
|
400 | + 'include' => function($event) { |
|
401 | 401 | if (!empty($event->endDate)) { |
402 | 402 | return $this->formatDate($event->endDate); |
403 | 403 | } else { |
@@ -408,14 +408,14 @@ discard block |
||
408 | 408 | ], |
409 | 409 | 'calendarType' => [ |
410 | 410 | 'name' => 'tijd type', |
411 | - 'include' => function ($event) { |
|
411 | + 'include' => function($event) { |
|
412 | 412 | return $event->calendarType; |
413 | 413 | }, |
414 | 414 | 'property' => 'calendarType' |
415 | 415 | ], |
416 | 416 | 'location' => [ |
417 | 417 | 'name' => 'locatie naam', |
418 | - 'include' => function ($event) { |
|
418 | + 'include' => function($event) { |
|
419 | 419 | if (property_exists($event, 'location') && isset($event->location->name)) { |
420 | 420 | return reset($event->location->name); |
421 | 421 | } |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | ], |
425 | 425 | 'address.streetAddress' => [ |
426 | 426 | 'name' => 'straat', |
427 | - 'include' => function ($event) { |
|
427 | + 'include' => function($event) { |
|
428 | 428 | if (isset($event->location->address->streetAddress)) { |
429 | 429 | return $event->location->address->streetAddress; |
430 | 430 | } |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | ], |
434 | 434 | 'address.postalCode' => [ |
435 | 435 | 'name' => 'postcode', |
436 | - 'include' => function ($event) { |
|
436 | + 'include' => function($event) { |
|
437 | 437 | if (isset($event->location->address->postalCode)) { |
438 | 438 | return $event->location->address->postalCode; |
439 | 439 | } |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | ], |
443 | 443 | 'address.addressLocality' => [ |
444 | 444 | 'name' => 'gemeente', |
445 | - 'include' => function ($event) { |
|
445 | + 'include' => function($event) { |
|
446 | 446 | if (isset($event->location->address->addressLocality)) { |
447 | 447 | return $event->location->address->addressLocality; |
448 | 448 | } |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | ], |
452 | 452 | 'address.addressCountry' => [ |
453 | 453 | 'name' => 'land', |
454 | - 'include' => function ($event) { |
|
454 | + 'include' => function($event) { |
|
455 | 455 | if (isset($event->location->address->addressCountry)) { |
456 | 456 | return $event->location->address->addressCountry; |
457 | 457 | } |
@@ -460,14 +460,14 @@ discard block |
||
460 | 460 | ], |
461 | 461 | 'image' => [ |
462 | 462 | 'name' => 'afbeelding', |
463 | - 'include' => function ($event) { |
|
463 | + 'include' => function($event) { |
|
464 | 464 | return !empty($event->image) ? $event->image : ''; |
465 | 465 | }, |
466 | 466 | 'property' => 'image' |
467 | 467 | ], |
468 | 468 | 'sameAs' => [ |
469 | 469 | 'name' => 'externe ids', |
470 | - 'include' => function ($event) { |
|
470 | + 'include' => function($event) { |
|
471 | 471 | if (property_exists($event, 'sameAs')) { |
472 | 472 | $ids = array(); |
473 | 473 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | ], |
483 | 483 | 'contactPoint.email' => [ |
484 | 484 | 'name' => 'e-mail', |
485 | - 'include' => function ($event) use ($contactPoint) { |
|
485 | + 'include' => function($event) use ($contactPoint) { |
|
486 | 486 | return $this->listJsonldProperty( |
487 | 487 | $contactPoint($event), |
488 | 488 | 'email' |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | ], |
493 | 493 | 'contactPoint.telephone' => [ |
494 | 494 | 'name' => 'telefoon', |
495 | - 'include' => function ($event) use ($contactPoint) { |
|
495 | + 'include' => function($event) use ($contactPoint) { |
|
496 | 496 | return $this->listJsonldProperty( |
497 | 497 | $contactPoint($event), |
498 | 498 | 'telephone' |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | ], |
503 | 503 | 'contactPoint.url' => [ |
504 | 504 | 'name' => 'url', |
505 | - 'include' => function ($event) use ($contactPoint) { |
|
505 | + 'include' => function($event) use ($contactPoint) { |
|
506 | 506 | $contactUrls = $this->listJsonldProperty( |
507 | 507 | $contactPoint($event), |
508 | 508 | 'url' |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | ], |
516 | 516 | 'contactPoint.reservations.email' => [ |
517 | 517 | 'name' => 'e-mail reservaties', |
518 | - 'include' => function ($event) use ($contactPoint) { |
|
518 | + 'include' => function($event) use ($contactPoint) { |
|
519 | 519 | return $this->listJsonldProperty( |
520 | 520 | $contactPoint($event, 'Reservations'), |
521 | 521 | 'email' |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | ], |
526 | 526 | 'contactPoint.reservations.telephone' => [ |
527 | 527 | 'name' => 'telefoon reservaties', |
528 | - 'include' => function ($event) use ($contactPoint) { |
|
528 | + 'include' => function($event) use ($contactPoint) { |
|
529 | 529 | return $this->listJsonldProperty( |
530 | 530 | $contactPoint($event, 'Reservations'), |
531 | 531 | 'telephone' |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | ], |
536 | 536 | 'contactPoint.reservations.url' => [ |
537 | 537 | 'name' => 'online reservaties', |
538 | - 'include' => function ($event) use ($contactPoint) { |
|
538 | + 'include' => function($event) use ($contactPoint) { |
|
539 | 539 | return $this->listJsonldProperty( |
540 | 540 | $contactPoint($event, 'Reservations'), |
541 | 541 | 'url' |
@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | $precision = 0; |
24 | - return new Price((int) round($value * 100, $precision)); |
|
24 | + return new Price((int)round($value * 100, $precision)); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -46,9 +46,9 @@ |
||
46 | 46 | StringLiteral $constraint, |
47 | 47 | StringLiteral $offerId |
48 | 48 | ) { |
49 | - $constraintStr = '(' . strtolower($constraint->toNative()) . ')'; |
|
49 | + $constraintStr = '('.strtolower($constraint->toNative()).')'; |
|
50 | 50 | $offerIdStr = $offerId->toNative(); |
51 | 51 | |
52 | - return '(' . $constraintStr . ' AND cdbid:' . $offerIdStr . ')'; |
|
52 | + return '('.$constraintStr.' AND cdbid:'.$offerIdStr.')'; |
|
53 | 53 | } |
54 | 54 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | if ($address) { |
64 | 64 | $address = new Address( |
65 | - new Street($address->getStreet() . ' ' . $address->getHouseNumber()), |
|
65 | + new Street($address->getStreet().' '.$address->getHouseNumber()), |
|
66 | 66 | new PostalCode($address->getZip()), |
67 | 67 | new Locality($address->getCity()), |
68 | 68 | Country::fromNative($address->getCountry()) |
@@ -29,6 +29,6 @@ |
||
29 | 29 | |
30 | 30 | /* @var OrganizerCreatedWithUniqueWebsite $payload */ |
31 | 31 | $payload = $domainMessage->getPayload(); |
32 | - return new StringLiteral((string) $payload->getWebsite()); |
|
32 | + return new StringLiteral((string)$payload->getWebsite()); |
|
33 | 33 | } |
34 | 34 | } |