@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | public function search($query, $limit = 30, $start = 0, $sort = null) |
| 45 | 45 | { |
| 46 | - $queryParameters = 'q=' . urlencode($query) . '&start=' . $start . '&limit=' . $limit; |
|
| 46 | + $queryParameters = 'q='.urlencode($query).'&start='.$start.'&limit='.$limit; |
|
| 47 | 47 | |
| 48 | 48 | $offerQuery = $this->searchLocation->withQuery($queryParameters); |
| 49 | 49 | |
| 50 | 50 | $offerRequest = new Request( |
| 51 | 51 | 'GET', |
| 52 | - (string) $offerQuery |
|
| 52 | + (string)$offerQuery |
|
| 53 | 53 | ); |
| 54 | 54 | |
| 55 | 55 | $searchResponseData = json_decode($this->httpClient |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $offerIds = array_reduce( |
| 61 | 61 | $searchResponseData->{'member'}, |
| 62 | - function (OfferIdentifierCollection $offerIds, $item) { |
|
| 62 | + function(OfferIdentifierCollection $offerIds, $item) { |
|
| 63 | 63 | return $offerIds->with( |
| 64 | 64 | $this->offerIdentifier->fromIri(Url::fromNative($item->{'@id'})) |
| 65 | 65 | ); |
@@ -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 | } |
@@ -43,9 +43,9 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function byId(StringLiteral $typeId) |
| 45 | 45 | { |
| 46 | - if (!array_key_exists((string) $typeId, $this->types)) { |
|
| 47 | - throw new \Exception("Unknown event type id: " . $typeId); |
|
| 46 | + if (!array_key_exists((string)$typeId, $this->types)) { |
|
| 47 | + throw new \Exception("Unknown event type id: ".$typeId); |
|
| 48 | 48 | } |
| 49 | - return $this->types[(string) $typeId]; |
|
| 49 | + return $this->types[(string)$typeId]; |
|
| 50 | 50 | } |
| 51 | 51 | } |
@@ -41,9 +41,9 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function byId(StringLiteral $typeId) |
| 43 | 43 | { |
| 44 | - if (!array_key_exists((string) $typeId, $this->types)) { |
|
| 45 | - throw new \Exception("Unknown place type id: " . $typeId); |
|
| 44 | + if (!array_key_exists((string)$typeId, $this->types)) { |
|
| 45 | + throw new \Exception("Unknown place type id: ".$typeId); |
|
| 46 | 46 | } |
| 47 | - return $this->types[(string) $typeId]; |
|
| 47 | + return $this->types[(string)$typeId]; |
|
| 48 | 48 | } |
| 49 | 49 | } |
@@ -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); |
@@ -522,8 +522,8 @@ discard block |
||
| 522 | 522 | $eventJsonLD->{'@id'} = $this->iriGenerator->iri($eventCopied->getItemId()); |
| 523 | 523 | |
| 524 | 524 | // Set the new calendar. |
| 525 | - $eventJsonLD = (object) array_merge( |
|
| 526 | - (array) $eventJsonLD, |
|
| 525 | + $eventJsonLD = (object)array_merge( |
|
| 526 | + (array)$eventJsonLD, |
|
| 527 | 527 | $eventCopied->getCalendar()->toJsonLd() |
| 528 | 528 | ); |
| 529 | 529 | |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | |
| 537 | 537 | // Set available to and from. |
| 538 | 538 | $availableTo = AvailableTo::createFromCalendar($eventCopied->getCalendar()); |
| 539 | - $eventJsonLD->availableTo = (string) $availableTo; |
|
| 539 | + $eventJsonLD->availableTo = (string)$availableTo; |
|
| 540 | 540 | unset($eventJsonLD->availableFrom); |
| 541 | 541 | |
| 542 | 542 | $newDocument = new JsonDocument($eventCopied->getItemId()); |
@@ -581,8 +581,8 @@ discard block |
||
| 581 | 581 | $jsonLD->availableTo = (string)$availableTo; |
| 582 | 582 | |
| 583 | 583 | // Remove old theme and event type. |
| 584 | - $jsonLD->terms = array_filter($jsonLD->terms, function ($term) { |
|
| 585 | - return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
| 584 | + $jsonLD->terms = array_filter($jsonLD->terms, function($term) { |
|
| 585 | + return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
| 586 | 586 | }); |
| 587 | 587 | $jsonLD->terms = array_values($jsonLD->terms); |
| 588 | 588 | |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | |
| 611 | 611 | $jsonLD->location = [ |
| 612 | 612 | '@type' => 'Place', |
| 613 | - ] + (array) $this->placeJSONLD($locationUpdated->getLocationId()->toNative()); |
|
| 613 | + ] + (array)$this->placeJSONLD($locationUpdated->getLocationId()->toNative()); |
|
| 614 | 614 | |
| 615 | 615 | return $document->withBody($jsonLD); |
| 616 | 616 | } |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | |
| 626 | 626 | $eventLd = $document->getBody(); |
| 627 | 627 | |
| 628 | - $eventLd->location->geo = (object) [ |
|
| 628 | + $eventLd->location->geo = (object)[ |
|
| 629 | 629 | 'latitude' => $geoCoordinatesUpdated->getCoordinates()->getLatitude()->toDouble(), |
| 630 | 630 | 'longitude' => $geoCoordinatesUpdated->getCoordinates()->getLongitude()->toDouble(), |
| 631 | 631 | ]; |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | { |
| 680 | 680 | $eventSlug = $this->slugger->slug($name); |
| 681 | 681 | return array( |
| 682 | - 'http://www.uitinvlaanderen.be/agenda/e/' . $eventSlug . '/' . $eventId, |
|
| 682 | + 'http://www.uitinvlaanderen.be/agenda/e/'.$eventSlug.'/'.$eventId, |
|
| 683 | 683 | ); |
| 684 | 684 | } |
| 685 | 685 | |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | $jsonLD->name->{$this->getMainLanguage($jsonLD)->getCode()} = $majorInfoUpdated->getTitle(); |
| 541 | 541 | |
| 542 | 542 | $jsonLD->location = array( |
| 543 | - '@type' => 'Place', |
|
| 543 | + '@type' => 'Place', |
|
| 544 | 544 | ) + (array)$this->placeJSONLD($majorInfoUpdated->getLocation()->getCdbid()); |
| 545 | 545 | |
| 546 | 546 | $availableTo = AvailableTo::createFromCalendar($majorInfoUpdated->getCalendar()); |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | |
| 577 | 577 | $jsonLD->location = [ |
| 578 | 578 | '@type' => 'Place', |
| 579 | - ] + (array) $this->placeJSONLD($locationUpdated->getLocationId()->toNative()); |
|
| 579 | + ] + (array) $this->placeJSONLD($locationUpdated->getLocationId()->toNative()); |
|
| 580 | 580 | |
| 581 | 581 | return $document->withBody($jsonLD); |
| 582 | 582 | } |