@@ -48,7 +48,7 @@ |
||
| 48 | 48 | */ |
| 49 | 49 | public function getName() |
| 50 | 50 | { |
| 51 | - return new StringLiteral((string) $this->label); |
|
| 51 | + return new StringLiteral((string)$this->label); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | public function getPermission() |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | if (preg_match('/^apply(.+)$/', $method, $matches)) { |
| 159 | 159 | $event = $matches[1]; |
| 160 | - $classNameMethod = 'get' . $event . 'ClassName'; |
|
| 160 | + $classNameMethod = 'get'.$event.'ClassName'; |
|
| 161 | 161 | |
| 162 | 162 | if (method_exists($this, $classNameMethod)) { |
| 163 | 163 | $eventFullClassName = call_user_func(array($this, $classNameMethod)); |
@@ -337,11 +337,11 @@ discard block |
||
| 337 | 337 | $offerLD = $document->getBody(); |
| 338 | 338 | |
| 339 | 339 | $oldTerms = property_exists($offerLD, 'terms') ? $offerLD->terms : []; |
| 340 | - $newTerm = (object) $category->serialize(); |
|
| 340 | + $newTerm = (object)$category->serialize(); |
|
| 341 | 341 | |
| 342 | 342 | $newTerms = array_filter( |
| 343 | 343 | $oldTerms, |
| 344 | - function ($term) use ($category) { |
|
| 344 | + function($term) use ($category) { |
|
| 345 | 345 | return !property_exists($term, 'domain') || $term->domain !== $category->getDomain(); |
| 346 | 346 | } |
| 347 | 347 | ); |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
| 368 | 368 | |
| 369 | 369 | $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : []; |
| 370 | - $label = (string) $labelAdded->getLabel(); |
|
| 370 | + $label = (string)$labelAdded->getLabel(); |
|
| 371 | 371 | |
| 372 | 372 | $labels[] = $label; |
| 373 | 373 | $offerLd->{$labelsProperty} = array_unique($labels); |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) { |
| 394 | 394 | $offerLd->{$labelsProperty} = array_filter( |
| 395 | 395 | $offerLd->{$labelsProperty}, |
| 396 | - function ($label) use ($labelRemoved) { |
|
| 396 | + function($label) use ($labelRemoved) { |
|
| 397 | 397 | return !$labelRemoved->getLabel()->equals( |
| 398 | 398 | new Label($label) |
| 399 | 399 | ); |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | return; |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | - $imageId = (string) $imageRemoved->getImage()->getMediaObjectId(); |
|
| 496 | + $imageId = (string)$imageRemoved->getImage()->getMediaObjectId(); |
|
| 497 | 497 | |
| 498 | 498 | /** |
| 499 | 499 | * Matches any object that is not the removed image. |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | * @return bool |
| 505 | 505 | * Returns true when the media object does not match the image to remove. |
| 506 | 506 | */ |
| 507 | - $shouldNotBeRemoved = function ($mediaObject) use ($imageId) { |
|
| 507 | + $shouldNotBeRemoved = function($mediaObject) use ($imageId) { |
|
| 508 | 508 | $containsId = !!strpos($mediaObject->{'@id'}, $imageId); |
| 509 | 509 | return !$containsId; |
| 510 | 510 | }; |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | $document = $this->loadDocumentFromRepository($mainImageSelected); |
| 544 | 544 | $offerLd = $document->getBody(); |
| 545 | 545 | $imageId = $mainImageSelected->getImage()->getMediaObjectId(); |
| 546 | - $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
| 546 | + $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
| 547 | 547 | if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) { |
| 548 | 548 | $matchingMediaObject = $currentMediaObject; |
| 549 | 549 | } |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | */ |
| 569 | 569 | protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId) |
| 570 | 570 | { |
| 571 | - return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0; |
|
| 571 | + return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0; |
|
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | /** |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated); |
| 766 | 766 | |
| 767 | 767 | $offerLd = $document->getBody(); |
| 768 | - $offerLd->typicalAgeRange = (string) $typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
| 768 | + $offerLd->typicalAgeRange = (string)$typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
| 769 | 769 | |
| 770 | 770 | return $document->withBody($offerLd); |
| 771 | 771 | } |
@@ -893,14 +893,14 @@ discard block |
||
| 893 | 893 | $images = $imagesEvent->getImages(); |
| 894 | 894 | $currentMediaObjects = isset($offerLd->mediaObject) ? $offerLd->mediaObject : []; |
| 895 | 895 | $dutchMediaObjects = array_map( |
| 896 | - function (Image $image) { |
|
| 896 | + function(Image $image) { |
|
| 897 | 897 | return $this->mediaObjectSerializer->serialize($image, 'json-ld'); |
| 898 | 898 | }, |
| 899 | 899 | $images->toArray() |
| 900 | 900 | ); |
| 901 | 901 | $translatedMediaObjects = array_filter( |
| 902 | 902 | $currentMediaObjects, |
| 903 | - function ($image) { |
|
| 903 | + function($image) { |
|
| 904 | 904 | return $image->inLanguage !== 'nl'; |
| 905 | 905 | } |
| 906 | 906 | ); |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | } |
| 914 | 914 | |
| 915 | 915 | if (isset($mainImage)) { |
| 916 | - $offerLd->image = (string) $mainImage->getSourceLocation(); |
|
| 916 | + $offerLd->image = (string)$mainImage->getSourceLocation(); |
|
| 917 | 917 | } |
| 918 | 918 | } |
| 919 | 919 | |
@@ -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 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | $this->setMainLanguage($jsonLD, new Language('nl')); |
| 215 | 215 | |
| 216 | - $jsonLD->url = (string) $organizerCreated->getWebsite(); |
|
| 216 | + $jsonLD->url = (string)$organizerCreated->getWebsite(); |
|
| 217 | 217 | |
| 218 | 218 | $jsonLD->name = [ |
| 219 | 219 | $this->getMainLanguage($jsonLD)->getCode() => $organizerCreated->getTitle(), |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $document = $this->repository->get($organizerId); |
| 245 | 245 | |
| 246 | 246 | $jsonLD = $document->getBody(); |
| 247 | - $jsonLD->url = (string) $websiteUpdated->getWebsite(); |
|
| 247 | + $jsonLD->url = (string)$websiteUpdated->getWebsite(); |
|
| 248 | 248 | |
| 249 | 249 | return $document->withBody($jsonLD); |
| 250 | 250 | } |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
| 353 | 353 | |
| 354 | 354 | $labels = isset($jsonLD->{$labelsProperty}) ? $jsonLD->{$labelsProperty} : []; |
| 355 | - $label = (string) $labelAdded->getLabel(); |
|
| 355 | + $label = (string)$labelAdded->getLabel(); |
|
| 356 | 356 | |
| 357 | 357 | $labels[] = $label; |
| 358 | 358 | $jsonLD->{$labelsProperty} = array_unique($labels); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | if (isset($jsonLD->{$labelsProperty}) && is_array($jsonLD->{$labelsProperty})) { |
| 377 | 377 | $jsonLD->{$labelsProperty} = array_filter( |
| 378 | 378 | $jsonLD->{$labelsProperty}, |
| 379 | - function ($label) use ($labelRemoved) { |
|
| 379 | + function($label) use ($labelRemoved) { |
|
| 380 | 380 | return !$labelRemoved->getLabel()->equals( |
| 381 | 381 | new Label($label) |
| 382 | 382 | ); |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | private function applyOrganizerDeleted( |
| 404 | 404 | OrganizerDeleted $organizerDeleted |
| 405 | 405 | ) { |
| 406 | - $document = $this->repository->get($organizerDeleted->getOrganizerId()); |
|
| 406 | + $document = $this->repository->get($organizerDeleted->getOrganizerId()); |
|
| 407 | 407 | |
| 408 | 408 | $jsonLD = $document->getBody(); |
| 409 | 409 | |