@@ -24,7 +24,7 @@ |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
27 | - * @return StringLiteral |
|
27 | + * @return string |
|
28 | 28 | */ |
29 | 29 | public function getTitle() |
30 | 30 | { |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public function serialize() |
37 | 37 | { |
38 | 38 | return parent::serialize() + array( |
39 | - 'title' => (string) $this->title, |
|
39 | + 'title' => (string)$this->title, |
|
40 | 40 | ); |
41 | 41 | } |
42 | 42 |
@@ -22,8 +22,8 @@ |
||
22 | 22 | */ |
23 | 23 | public function __construct(StringLiteral $userId, $command) |
24 | 24 | { |
25 | - parent::__construct('User with id: ' . $userId->toNative() . |
|
26 | - ' failed to execute command: ' . get_class($command) . |
|
25 | + parent::__construct('User with id: '.$userId->toNative(). |
|
26 | + ' failed to execute command: '.get_class($command). |
|
27 | 27 | ' because it is not authorizable.'); |
28 | 28 | |
29 | 29 | $this->userId = $userId; |
@@ -117,7 +117,7 @@ |
||
117 | 117 | */ |
118 | 118 | public function getItemId() |
119 | 119 | { |
120 | - return (string) $this->getFileId(); |
|
120 | + return (string)$this->getFileId(); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function getItemId() |
37 | 37 | { |
38 | - return (string) $this->getUuid(); |
|
38 | + return (string)$this->getUuid(); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | |
591 | 591 | $this->themes = array_reduce( |
592 | 592 | $themePerType, |
593 | - function ($themes, array $type) { |
|
593 | + function($themes, array $type) { |
|
594 | 594 | if (array_key_exists('themes', $type)) { |
595 | 595 | foreach ($type['themes'] as $themeData) { |
596 | 596 | $themes[$themeData['id']] = new Theme($themeData['id'], $themeData['label']); |
@@ -608,9 +608,9 @@ discard block |
||
608 | 608 | */ |
609 | 609 | public function byId(StringLiteral $themeId) |
610 | 610 | { |
611 | - if (!array_key_exists((string) $themeId, $this->themes)) { |
|
612 | - throw new \Exception("Unknown event theme id: " . $themeId); |
|
611 | + if (!array_key_exists((string)$themeId, $this->themes)) { |
|
612 | + throw new \Exception("Unknown event theme id: ".$themeId); |
|
613 | 613 | } |
614 | - return $this->themes[(string) $themeId]; |
|
614 | + return $this->themes[(string)$themeId]; |
|
615 | 615 | } |
616 | 616 | } |
@@ -23,9 +23,9 @@ |
||
23 | 23 | */ |
24 | 24 | public function byId(StringLiteral $themeId) |
25 | 25 | { |
26 | - if (!array_key_exists((string) $themeId, $this->themes)) { |
|
27 | - throw new \Exception("Unknown place theme id: " . $themeId); |
|
26 | + if (!array_key_exists((string)$themeId, $this->themes)) { |
|
27 | + throw new \Exception("Unknown place theme id: ".$themeId); |
|
28 | 28 | } |
29 | - return $this->themes[(string) $themeId]; |
|
29 | + return $this->themes[(string)$themeId]; |
|
30 | 30 | } |
31 | 31 | } |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | |
541 | 541 | /** |
542 | 542 | * @param EventDeleted $eventDeleted |
543 | - * @return null |
|
543 | + * @return JsonDocument |
|
544 | 544 | */ |
545 | 545 | protected function applyEventDeleted(EventDeleted $eventDeleted) |
546 | 546 | { |
@@ -651,6 +651,9 @@ discard block |
||
651 | 651 | } |
652 | 652 | } |
653 | 653 | |
654 | + /** |
|
655 | + * @param string $eventId |
|
656 | + */ |
|
654 | 657 | private function generateSameAs($eventId, $name) |
655 | 658 | { |
656 | 659 | $eventSlug = $this->slugger->slug($name); |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $jsonLD->name->{$this->getMainLanguage($jsonLD)->getCode()} = $majorInfoUpdated->getTitle(); |
445 | 445 | |
446 | 446 | $jsonLD->location = array( |
447 | - '@type' => 'Place', |
|
447 | + '@type' => 'Place', |
|
448 | 448 | ) + (array)$this->placeJSONLD($majorInfoUpdated->getLocation()->toNative()); |
449 | 449 | |
450 | 450 | $availableTo = AvailableTo::createFromCalendar($majorInfoUpdated->getCalendar()); |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | |
481 | 481 | $jsonLD->location = [ |
482 | 482 | '@type' => 'Place', |
483 | - ] + (array) $this->placeJSONLD($locationUpdated->getLocationId()->toNative()); |
|
483 | + ] + (array) $this->placeJSONLD($locationUpdated->getLocationId()->toNative()); |
|
484 | 484 | |
485 | 485 | return $document->withBody($jsonLD); |
486 | 486 | } |
@@ -366,8 +366,8 @@ discard block |
||
366 | 366 | // Set the new calendar. |
367 | 367 | $calendarJsonLD = $eventCopied->getCalendar()->toJsonLd(); |
368 | 368 | |
369 | - $eventJsonLD = (object) array_merge( |
|
370 | - (array) $eventJsonLD, |
|
369 | + $eventJsonLD = (object)array_merge( |
|
370 | + (array)$eventJsonLD, |
|
371 | 371 | $calendarJsonLD |
372 | 372 | ); |
373 | 373 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | |
388 | 388 | // Set available to and from. |
389 | 389 | $availableTo = AvailableTo::createFromCalendar($eventCopied->getCalendar()); |
390 | - $eventJsonLD->availableTo = (string) $availableTo; |
|
390 | + $eventJsonLD->availableTo = (string)$availableTo; |
|
391 | 391 | unset($eventJsonLD->availableFrom); |
392 | 392 | |
393 | 393 | $newDocument = new JsonDocument($eventCopied->getItemId()); |
@@ -433,8 +433,8 @@ discard block |
||
433 | 433 | $jsonLD->availableTo = (string)$availableTo; |
434 | 434 | |
435 | 435 | // Remove old theme and event type. |
436 | - $jsonLD->terms = array_filter($jsonLD->terms, function ($term) { |
|
437 | - return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
436 | + $jsonLD->terms = array_filter($jsonLD->terms, function($term) { |
|
437 | + return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
438 | 438 | }); |
439 | 439 | $jsonLD->terms = array_values($jsonLD->terms); |
440 | 440 | |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | |
463 | 463 | $jsonLD->location = [ |
464 | 464 | '@type' => 'Place', |
465 | - ] + (array) $this->placeJSONLD($locationUpdated->getLocationId()->toNative()); |
|
465 | + ] + (array)$this->placeJSONLD($locationUpdated->getLocationId()->toNative()); |
|
466 | 466 | |
467 | 467 | return $document->withBody($jsonLD); |
468 | 468 | } |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | |
478 | 478 | $eventLd = $document->getBody(); |
479 | 479 | |
480 | - $eventLd->location->geo = (object) [ |
|
480 | + $eventLd->location->geo = (object)[ |
|
481 | 481 | 'latitude' => $geoCoordinatesUpdated->getCoordinates()->getLatitude()->toDouble(), |
482 | 482 | 'longitude' => $geoCoordinatesUpdated->getCoordinates()->getLongitude()->toDouble(), |
483 | 483 | ]; |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | { |
532 | 532 | $eventSlug = $this->slugger->slug($name); |
533 | 533 | return array( |
534 | - 'http://www.uitinvlaanderen.be/agenda/e/' . $eventSlug . '/' . $eventId, |
|
534 | + 'http://www.uitinvlaanderen.be/agenda/e/'.$eventSlug.'/'.$eventId, |
|
535 | 535 | ); |
536 | 536 | } |
537 | 537 |
@@ -241,7 +241,7 @@ |
||
241 | 241 | |
242 | 242 | /** |
243 | 243 | * @param PlaceDeleted $placeDeleted |
244 | - * @return null |
|
244 | + * @return JsonDocument |
|
245 | 245 | */ |
246 | 246 | protected function applyPlaceDeleted(PlaceDeleted $placeDeleted) |
247 | 247 | { |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | ); |
213 | 213 | |
214 | 214 | $calendarJsonLD = $placeCreated->getCalendar()->toJsonLd(); |
215 | - $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD); |
|
215 | + $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD); |
|
216 | 216 | |
217 | 217 | $availableTo = AvailableTo::createFromCalendar($placeCreated->getCalendar()); |
218 | 218 | $jsonLD->availableTo = (string)$availableTo; |
@@ -285,8 +285,8 @@ discard block |
||
285 | 285 | $jsonLD->availableTo = (string)$availableTo; |
286 | 286 | |
287 | 287 | // Remove old theme and event type. |
288 | - $jsonLD->terms = array_filter($jsonLD->terms, function ($term) { |
|
289 | - return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
288 | + $jsonLD->terms = array_filter($jsonLD->terms, function($term) { |
|
289 | + return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
290 | 290 | }); |
291 | 291 | |
292 | 292 | $eventType = $majorInfoUpdated->getEventType(); |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | // @replay_i18n |
353 | 353 | // @see https://jira.uitdatabank.be/browse/III-2201 |
354 | 354 | $mainLanguageCode = $this->getMainLanguage($jsonLd)->getCode(); |
355 | - $jsonLd->address = (object) [ |
|
355 | + $jsonLd->address = (object)[ |
|
356 | 356 | $mainLanguageCode => $jsonLd->address, |
357 | 357 | ]; |
358 | 358 | } |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | |
371 | 371 | $placeLd = $document->getBody(); |
372 | 372 | |
373 | - $placeLd->geo = (object) [ |
|
373 | + $placeLd->geo = (object)[ |
|
374 | 374 | 'latitude' => $geoCoordinatesUpdated->getCoordinates()->getLatitude()->toDouble(), |
375 | 375 | 'longitude' => $geoCoordinatesUpdated->getCoordinates()->getLongitude()->toDouble(), |
376 | 376 | ]; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | { |
383 | 383 | $document = $this->loadPlaceDocumentFromRepositoryById($markedAsDuplicate->getPlaceId()); |
384 | 384 | |
385 | - return $document->apply(function ($placeLd) use ($markedAsDuplicate) { |
|
385 | + return $document->apply(function($placeLd) use ($markedAsDuplicate) { |
|
386 | 386 | $placeLd->duplicateOf = $this->iriGenerator->iri($markedAsDuplicate->getDuplicateOf()); |
387 | 387 | return $placeLd; |
388 | 388 | }); |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | { |
393 | 393 | $document = $this->loadPlaceDocumentFromRepositoryById($markedAsCanonical->getPlaceId()); |
394 | 394 | |
395 | - return $document->apply(function ($placeLd) use ($markedAsCanonical) { |
|
395 | + return $document->apply(function($placeLd) use ($markedAsCanonical) { |
|
396 | 396 | $placeLd->duplicatedBy[] = $this->iriGenerator->iri($markedAsCanonical->getDuplicatedBy()); |
397 | 397 | foreach ($markedAsCanonical->getDuplicatesOfDuplicate() as $duplicateOfDuplicate) { |
398 | 398 | $placeLd->duplicatedBy[] = $this->iriGenerator->iri($duplicateOfDuplicate); |