@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | if (preg_match('/^apply(.+)$/', $method, $matches)) { |
| 162 | 162 | $event = $matches[1]; |
| 163 | - $classNameMethod = 'get' . $event . 'ClassName'; |
|
| 163 | + $classNameMethod = 'get'.$event.'ClassName'; |
|
| 164 | 164 | |
| 165 | 165 | if (method_exists($this, $classNameMethod)) { |
| 166 | 166 | $eventFullClassName = call_user_func(array($this, $classNameMethod)); |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
| 302 | 302 | |
| 303 | 303 | $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : []; |
| 304 | - $label = (string) $labelAdded->getLabel(); |
|
| 304 | + $label = (string)$labelAdded->getLabel(); |
|
| 305 | 305 | |
| 306 | 306 | $labels[] = $label; |
| 307 | 307 | $offerLd->{$labelsProperty} = array_unique($labels); |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) { |
| 328 | 328 | $offerLd->{$labelsProperty} = array_filter( |
| 329 | 329 | $offerLd->{$labelsProperty}, |
| 330 | - function ($label) use ($labelRemoved) { |
|
| 330 | + function($label) use ($labelRemoved) { |
|
| 331 | 331 | return !$labelRemoved->getLabel()->equals( |
| 332 | 332 | new Label($label) |
| 333 | 333 | ); |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | return; |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | - $imageId = (string) $imageRemoved->getImage()->getMediaObjectId(); |
|
| 430 | + $imageId = (string)$imageRemoved->getImage()->getMediaObjectId(); |
|
| 431 | 431 | |
| 432 | 432 | /** |
| 433 | 433 | * Matches any object that is not the removed image. |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | * @return bool |
| 439 | 439 | * Returns true when the media object does not match the image to remove. |
| 440 | 440 | */ |
| 441 | - $shouldNotBeRemoved = function ($mediaObject) use ($imageId) { |
|
| 441 | + $shouldNotBeRemoved = function($mediaObject) use ($imageId) { |
|
| 442 | 442 | $containsId = !!strpos($mediaObject->{'@id'}, $imageId); |
| 443 | 443 | return !$containsId; |
| 444 | 444 | }; |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | $document = $this->loadDocumentFromRepository($mainImageSelected); |
| 478 | 478 | $offerLd = $document->getBody(); |
| 479 | 479 | $imageId = $mainImageSelected->getImage()->getMediaObjectId(); |
| 480 | - $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
| 480 | + $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
| 481 | 481 | if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) { |
| 482 | 482 | $matchingMediaObject = $currentMediaObject; |
| 483 | 483 | } |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | */ |
| 503 | 503 | protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId) |
| 504 | 504 | { |
| 505 | - return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0; |
|
| 505 | + return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0; |
|
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | /** |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated); |
| 667 | 667 | |
| 668 | 668 | $offerLd = $document->getBody(); |
| 669 | - $offerLd->typicalAgeRange = (string) $typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
| 669 | + $offerLd->typicalAgeRange = (string)$typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
| 670 | 670 | |
| 671 | 671 | return $document->withBody($offerLd); |
| 672 | 672 | } |
@@ -794,14 +794,14 @@ discard block |
||
| 794 | 794 | $images = $imagesEvent->getImages(); |
| 795 | 795 | $currentMediaObjects = isset($offerLd->mediaObject) ? $offerLd->mediaObject : []; |
| 796 | 796 | $dutchMediaObjects = array_map( |
| 797 | - function (Image $image) { |
|
| 797 | + function(Image $image) { |
|
| 798 | 798 | return $this->mediaObjectSerializer->serialize($image, 'json-ld'); |
| 799 | 799 | }, |
| 800 | 800 | $images->toArray() |
| 801 | 801 | ); |
| 802 | 802 | $translatedMediaObjects = array_filter( |
| 803 | 803 | $currentMediaObjects, |
| 804 | - function ($image) { |
|
| 804 | + function($image) { |
|
| 805 | 805 | return $image->inLanguage !== 'nl'; |
| 806 | 806 | } |
| 807 | 807 | ); |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | if (isset($mainImage)) { |
| 817 | - $offerLd->image = (string) $mainImage->getSourceLocation(); |
|
| 817 | + $offerLd->image = (string)$mainImage->getSourceLocation(); |
|
| 818 | 818 | } |
| 819 | 819 | } |
| 820 | 820 | |
@@ -827,8 +827,8 @@ discard block |
||
| 827 | 827 | $document = new JsonDocument($id); |
| 828 | 828 | |
| 829 | 829 | $offerLd = $document->getBody(); |
| 830 | - $offerLd->{'@context'} = (object) [ |
|
| 831 | - 'udb' => (string) $this->jsonLDContext, |
|
| 830 | + $offerLd->{'@context'} = (object)[ |
|
| 831 | + 'udb' => (string)$this->jsonLDContext, |
|
| 832 | 832 | ]; |
| 833 | 833 | $offerLd->{'@id'} = $this->iriGenerator->iri($id); |
| 834 | 834 | |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | public function jsonSerialize() |
| 67 | 67 | { |
| 68 | 68 | return [ |
| 69 | - '@id' => (string) $this->iri, |
|
| 70 | - '@type' => 'udb:' . ucfirst($this->type->toNative()), |
|
| 69 | + '@id' => (string)$this->iri, |
|
| 70 | + '@type' => 'udb:'.ucfirst($this->type->toNative()), |
|
| 71 | 71 | ]; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | return json_encode( |
| 80 | 80 | [ |
| 81 | - 'iri' => (string) $this->iri, |
|
| 81 | + 'iri' => (string)$this->iri, |
|
| 82 | 82 | 'id' => $this->id, |
| 83 | 83 | 'type' => $this->type->toNative(), |
| 84 | 84 | ] |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | ); |
| 110 | 110 | |
| 111 | 111 | $calendar = [ |
| 112 | - 'type' => $this->type, |
|
| 112 | + 'type' => $this->type, |
|
| 113 | 113 | ]; |
| 114 | 114 | |
| 115 | 115 | empty($this->startDate) ?: $calendar['startDate'] = $this->startDate->format(DateTime::ATOM); |
@@ -222,9 +222,9 @@ discard block |
||
| 222 | 222 | $jsonLd['subEvent'] = array(); |
| 223 | 223 | foreach ($timestamps as $timestamp) { |
| 224 | 224 | $jsonLd['subEvent'][] = array( |
| 225 | - '@type' => 'udb:Event', |
|
| 226 | - 'startDate' => $timestamp->getStartDate()->format(DateTime::ATOM), |
|
| 227 | - 'endDate' => $timestamp->getEndDate()->format(DateTime::ATOM), |
|
| 225 | + '@type' => 'udb:Event', |
|
| 226 | + 'startDate' => $timestamp->getStartDate()->format(DateTime::ATOM), |
|
| 227 | + 'endDate' => $timestamp->getEndDate()->format(DateTime::ATOM), |
|
| 228 | 228 | ); |
| 229 | 229 | } |
| 230 | 230 | } |
@@ -560,7 +560,7 @@ |
||
| 560 | 560 | |
| 561 | 561 | $jsonLD->name->nl = $majorInfoUpdated->getTitle(); |
| 562 | 562 | $jsonLD->location = array( |
| 563 | - '@type' => 'udb:Place', |
|
| 563 | + '@type' => 'udb:Place', |
|
| 564 | 564 | ) + (array)$this->placeJSONLD($majorInfoUpdated->getLocation()->getCdbid()); |
| 565 | 565 | |
| 566 | 566 | $availableTo = AvailableTo::createFromCalendar($majorInfoUpdated->getCalendar()); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | $this->setMainLanguage($jsonLD, new Language('nl')); |
| 223 | 223 | |
| 224 | - $jsonLD->url = (string) $organizerCreated->getWebsite(); |
|
| 224 | + $jsonLD->url = (string)$organizerCreated->getWebsite(); |
|
| 225 | 225 | |
| 226 | 226 | $jsonLD->name = [ |
| 227 | 227 | $this->getMainLanguage($jsonLD)->getCode() => $organizerCreated->getTitle(), |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $document = $this->repository->get($organizerId); |
| 253 | 253 | |
| 254 | 254 | $jsonLD = $document->getBody(); |
| 255 | - $jsonLD->url = (string) $websiteUpdated->getWebsite(); |
|
| 255 | + $jsonLD->url = (string)$websiteUpdated->getWebsite(); |
|
| 256 | 256 | |
| 257 | 257 | return $document->withBody($jsonLD); |
| 258 | 258 | } |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
| 361 | 361 | |
| 362 | 362 | $labels = isset($jsonLD->{$labelsProperty}) ? $jsonLD->{$labelsProperty} : []; |
| 363 | - $label = (string) $labelAdded->getLabel(); |
|
| 363 | + $label = (string)$labelAdded->getLabel(); |
|
| 364 | 364 | |
| 365 | 365 | $labels[] = $label; |
| 366 | 366 | $jsonLD->{$labelsProperty} = array_unique($labels); |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | if (isset($jsonLD->{$labelsProperty}) && is_array($jsonLD->{$labelsProperty})) { |
| 385 | 385 | $jsonLD->{$labelsProperty} = array_filter( |
| 386 | 386 | $jsonLD->{$labelsProperty}, |
| 387 | - function ($label) use ($labelRemoved) { |
|
| 387 | + function($label) use ($labelRemoved) { |
|
| 388 | 388 | return !$labelRemoved->getLabel()->equals( |
| 389 | 389 | new Label($label) |
| 390 | 390 | ); |
@@ -424,8 +424,8 @@ discard block |
||
| 424 | 424 | $document = new JsonDocument($id); |
| 425 | 425 | |
| 426 | 426 | $organizerLd = $document->getBody(); |
| 427 | - $organizerLd->{'@context'} = (object) [ |
|
| 428 | - 'udb' => (string) $this->jsonLDContext, |
|
| 427 | + $organizerLd->{'@context'} = (object)[ |
|
| 428 | + 'udb' => (string)$this->jsonLDContext, |
|
| 429 | 429 | ]; |
| 430 | 430 | $organizerLd->{'@id'} = $this->iriGenerator->iri($id); |
| 431 | 431 | $organizerLd->{'@type'} = 'udb:Organizer'; |