@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | $this->setMainLanguage($jsonLD, new Language('nl')); |
| 214 | 214 | |
| 215 | - $jsonLD->url = (string) $organizerCreated->getWebsite(); |
|
| 215 | + $jsonLD->url = (string)$organizerCreated->getWebsite(); |
|
| 216 | 216 | |
| 217 | 217 | $jsonLD->name = [ |
| 218 | 218 | $this->getMainLanguage($jsonLD)->getCode() => $organizerCreated->getTitle() |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $document = $this->repository->get($organizerId); |
| 244 | 244 | |
| 245 | 245 | $jsonLD = $document->getBody(); |
| 246 | - $jsonLD->url = (string) $websiteUpdated->getWebsite(); |
|
| 246 | + $jsonLD->url = (string)$websiteUpdated->getWebsite(); |
|
| 247 | 247 | |
| 248 | 248 | return $document->withBody($jsonLD); |
| 249 | 249 | } |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
| 352 | 352 | |
| 353 | 353 | $labels = isset($jsonLD->{$labelsProperty}) ? $jsonLD->{$labelsProperty} : []; |
| 354 | - $label = (string) $labelAdded->getLabel(); |
|
| 354 | + $label = (string)$labelAdded->getLabel(); |
|
| 355 | 355 | |
| 356 | 356 | $labels[] = $label; |
| 357 | 357 | $jsonLD->{$labelsProperty} = array_unique($labels); |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | if (isset($jsonLD->{$labelsProperty}) && is_array($jsonLD->{$labelsProperty})) { |
| 376 | 376 | $jsonLD->{$labelsProperty} = array_filter( |
| 377 | 377 | $jsonLD->{$labelsProperty}, |
| 378 | - function ($label) use ($labelRemoved) { |
|
| 378 | + function($label) use ($labelRemoved) { |
|
| 379 | 379 | return !$labelRemoved->getLabel()->equals( |
| 380 | 380 | new Label($label) |
| 381 | 381 | ); |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | $mainLanguage = isset($body->mainLanguage) ? $body->mainLanguage : 'nl'; |
| 59 | 59 | |
| 60 | 60 | if (is_string($body->name)) { |
| 61 | - $body->name = (object) [ |
|
| 61 | + $body->name = (object)[ |
|
| 62 | 62 | $mainLanguage => $body->name, |
| 63 | 63 | ]; |
| 64 | 64 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | { |
| 29 | 29 | $body = $jsonDocument->getBody(); |
| 30 | 30 | |
| 31 | - $castLanguageToString = function (Language $language) { |
|
| 31 | + $castLanguageToString = function(Language $language) { |
|
| 32 | 32 | return $language->getCode(); |
| 33 | 33 | }; |
| 34 | 34 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | $mainLanguage = isset($body->mainLanguage) ? $body->mainLanguage : 'nl'; |
| 61 | 61 | |
| 62 | 62 | if (isset($body->address->streetAddress)) { |
| 63 | - $body->address = (object) [ |
|
| 63 | + $body->address = (object)[ |
|
| 64 | 64 | $mainLanguage => $body->address, |
| 65 | 65 | ]; |
| 66 | 66 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | private function getHandleMethodName($event) |
| 26 | 26 | { |
| 27 | 27 | $classParts = explode('\\', get_class($event)); |
| 28 | - $methodName = 'apply' . end($classParts); |
|
| 28 | + $methodName = 'apply'.end($classParts); |
|
| 29 | 29 | |
| 30 | 30 | if (!method_exists($this, $methodName)) { |
| 31 | 31 | return null; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | if (preg_match('/^apply(.+)$/', $method, $matches)) { |
| 153 | 153 | $event = $matches[1]; |
| 154 | - $classNameMethod = 'get' . $event . 'ClassName'; |
|
| 154 | + $classNameMethod = 'get'.$event.'ClassName'; |
|
| 155 | 155 | |
| 156 | 156 | if (method_exists($this, $classNameMethod)) { |
| 157 | 157 | $eventFullClassName = call_user_func(array($this, $classNameMethod)); |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
| 293 | 293 | |
| 294 | 294 | $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : []; |
| 295 | - $label = (string) $labelAdded->getLabel(); |
|
| 295 | + $label = (string)$labelAdded->getLabel(); |
|
| 296 | 296 | |
| 297 | 297 | $labels[] = $label; |
| 298 | 298 | $offerLd->{$labelsProperty} = array_unique($labels); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) { |
| 319 | 319 | $offerLd->{$labelsProperty} = array_filter( |
| 320 | 320 | $offerLd->{$labelsProperty}, |
| 321 | - function ($label) use ($labelRemoved) { |
|
| 321 | + function($label) use ($labelRemoved) { |
|
| 322 | 322 | return !$labelRemoved->getLabel()->equals( |
| 323 | 323 | new Label($label) |
| 324 | 324 | ); |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | return; |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | - $imageId = (string) $imageRemoved->getImage()->getMediaObjectId(); |
|
| 421 | + $imageId = (string)$imageRemoved->getImage()->getMediaObjectId(); |
|
| 422 | 422 | |
| 423 | 423 | /** |
| 424 | 424 | * Matches any object that is not the removed image. |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | * @return bool |
| 430 | 430 | * Returns true when the media object does not match the image to remove. |
| 431 | 431 | */ |
| 432 | - $shouldNotBeRemoved = function ($mediaObject) use ($imageId) { |
|
| 432 | + $shouldNotBeRemoved = function($mediaObject) use ($imageId) { |
|
| 433 | 433 | $containsId = !!strpos($mediaObject->{'@id'}, $imageId); |
| 434 | 434 | return !$containsId; |
| 435 | 435 | }; |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | $document = $this->loadDocumentFromRepository($mainImageSelected); |
| 469 | 469 | $offerLd = $document->getBody(); |
| 470 | 470 | $imageId = $mainImageSelected->getImage()->getMediaObjectId(); |
| 471 | - $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
| 471 | + $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
| 472 | 472 | if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) { |
| 473 | 473 | $matchingMediaObject = $currentMediaObject; |
| 474 | 474 | } |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId) |
| 495 | 495 | { |
| 496 | - return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0; |
|
| 496 | + return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0; |
|
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | /** |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated); |
| 658 | 658 | |
| 659 | 659 | $offerLd = $document->getBody(); |
| 660 | - $offerLd->typicalAgeRange = (string) $typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
| 660 | + $offerLd->typicalAgeRange = (string)$typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
| 661 | 661 | |
| 662 | 662 | return $document->withBody($offerLd); |
| 663 | 663 | } |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | { |
| 780 | 780 | $images = $imagesEvent->getImages(); |
| 781 | 781 | $jsonMediaObjects = array_map( |
| 782 | - function (Image $image) { |
|
| 782 | + function(Image $image) { |
|
| 783 | 783 | return $this->mediaObjectSerializer->serialize($image, 'json-ld'); |
| 784 | 784 | }, |
| 785 | 785 | $images->toArray() |
@@ -793,7 +793,7 @@ discard block |
||
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | if (isset($mainImage)) { |
| 796 | - $offerLd->image = (string) $mainImage->getSourceLocation(); |
|
| 796 | + $offerLd->image = (string)$mainImage->getSourceLocation(); |
|
| 797 | 797 | } |
| 798 | 798 | } |
| 799 | 799 | |
@@ -511,8 +511,8 @@ discard block |
||
| 511 | 511 | $eventJsonLD->{'@id'} = $this->iriGenerator->iri($eventCopied->getItemId()); |
| 512 | 512 | |
| 513 | 513 | // Set the new calendar. |
| 514 | - $eventJsonLD = (object) array_merge( |
|
| 515 | - (array) $eventJsonLD, |
|
| 514 | + $eventJsonLD = (object)array_merge( |
|
| 515 | + (array)$eventJsonLD, |
|
| 516 | 516 | $eventCopied->getCalendar()->toJsonLd() |
| 517 | 517 | ); |
| 518 | 518 | |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | |
| 526 | 526 | // Set available to and from. |
| 527 | 527 | $availableTo = AvailableTo::createFromCalendar($eventCopied->getCalendar()); |
| 528 | - $eventJsonLD->availableTo = (string) $availableTo; |
|
| 528 | + $eventJsonLD->availableTo = (string)$availableTo; |
|
| 529 | 529 | unset($eventJsonLD->availableFrom); |
| 530 | 530 | |
| 531 | 531 | $newDocument = new JsonDocument($eventCopied->getItemId()); |
@@ -565,8 +565,8 @@ discard block |
||
| 565 | 565 | $jsonLD->availableTo = (string)$availableTo; |
| 566 | 566 | |
| 567 | 567 | // Remove old theme and event type. |
| 568 | - $jsonLD->terms = array_filter($jsonLD->terms, function ($term) { |
|
| 569 | - return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
| 568 | + $jsonLD->terms = array_filter($jsonLD->terms, function($term) { |
|
| 569 | + return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
| 570 | 570 | }); |
| 571 | 571 | $jsonLD->terms = array_values($jsonLD->terms); |
| 572 | 572 | |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | { |
| 628 | 628 | $eventSlug = $this->slugger->slug($name); |
| 629 | 629 | return array( |
| 630 | - 'http://www.uitinvlaanderen.be/agenda/e/' . $eventSlug . '/' . $eventId, |
|
| 630 | + 'http://www.uitinvlaanderen.be/agenda/e/'.$eventSlug.'/'.$eventId, |
|
| 631 | 631 | ); |
| 632 | 632 | } |
| 633 | 633 | |