@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * @param array $data |
| 35 | - * @return mixed The object instance |
|
| 35 | + * @return AbstractFacilitiesUpdated The object instance |
|
| 36 | 36 | */ |
| 37 | 37 | public static function deserialize(array $data) |
| 38 | 38 | { |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | use CultuurNet\UDB3\Event\EventType; |
| 13 | 13 | use CultuurNet\UDB3\Event\ReadModel\DocumentGoneException; |
| 14 | 14 | use CultuurNet\UDB3\Event\ReadModel\DocumentRepositoryInterface; |
| 15 | -use CultuurNet\UDB3\Facility; |
|
| 16 | 15 | use CultuurNet\UDB3\Iri\IriGeneratorInterface; |
| 17 | 16 | use CultuurNet\UDB3\Language; |
| 18 | 17 | use CultuurNet\UDB3\Offer\AvailableTo; |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | ); |
| 205 | 205 | |
| 206 | 206 | $calendarJsonLD = $placeCreated->getCalendar()->toJsonLd(); |
| 207 | - $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD); |
|
| 207 | + $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD); |
|
| 208 | 208 | |
| 209 | 209 | $availableTo = AvailableTo::createFromCalendar($placeCreated->getCalendar()); |
| 210 | 210 | $jsonLD->availableTo = (string)$availableTo; |
@@ -279,8 +279,8 @@ discard block |
||
| 279 | 279 | $jsonLD->availableTo = (string)$availableTo; |
| 280 | 280 | |
| 281 | 281 | // Remove old theme and event type. |
| 282 | - $jsonLD->terms = array_filter($jsonLD->terms, function ($term) { |
|
| 283 | - return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
| 282 | + $jsonLD->terms = array_filter($jsonLD->terms, function($term) { |
|
| 283 | + return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
| 284 | 284 | }); |
| 285 | 285 | |
| 286 | 286 | $eventType = $majorInfoUpdated->getEventType(); |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | // @replay_i18n |
| 347 | 347 | // @see https://jira.uitdatabank.be/browse/III-2201 |
| 348 | 348 | $mainLanguageCode = $this->getMainLanguage($jsonLd)->getCode(); |
| 349 | - $jsonLd->address = (object) [ |
|
| 349 | + $jsonLd->address = (object)[ |
|
| 350 | 350 | $mainLanguageCode => $jsonLd->address, |
| 351 | 351 | ]; |
| 352 | 352 | } |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | |
| 365 | 365 | $placeLd = $document->getBody(); |
| 366 | 366 | |
| 367 | - $placeLd->geo = (object) [ |
|
| 367 | + $placeLd->geo = (object)[ |
|
| 368 | 368 | 'latitude' => $geoCoordinatesUpdated->getCoordinates()->getLatitude()->toDouble(), |
| 369 | 369 | 'longitude' => $geoCoordinatesUpdated->getCoordinates()->getLongitude()->toDouble(), |
| 370 | 370 | ]; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | if (preg_match('/^apply(.+)$/', $method, $matches)) { |
| 161 | 161 | $event = $matches[1]; |
| 162 | - $classNameMethod = 'get' . $event . 'ClassName'; |
|
| 162 | + $classNameMethod = 'get'.$event.'ClassName'; |
|
| 163 | 163 | |
| 164 | 164 | if (method_exists($this, $classNameMethod)) { |
| 165 | 165 | $eventFullClassName = call_user_func(array($this, $classNameMethod)); |
@@ -344,11 +344,11 @@ discard block |
||
| 344 | 344 | $offerLD = $document->getBody(); |
| 345 | 345 | |
| 346 | 346 | $oldTerms = property_exists($offerLD, 'terms') ? $offerLD->terms : []; |
| 347 | - $newTerm = (object) $category->serialize(); |
|
| 347 | + $newTerm = (object)$category->serialize(); |
|
| 348 | 348 | |
| 349 | 349 | $newTerms = array_filter( |
| 350 | 350 | $oldTerms, |
| 351 | - function ($term) use ($category) { |
|
| 351 | + function($term) use ($category) { |
|
| 352 | 352 | return !property_exists($term, 'domain') || $term->domain !== $category->getDomain(); |
| 353 | 353 | } |
| 354 | 354 | ); |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | // Remove all old facilities + get numeric keys. |
| 376 | 376 | $terms = array_values(array_filter( |
| 377 | 377 | $terms, |
| 378 | - function ($term) { |
|
| 378 | + function($term) { |
|
| 379 | 379 | return $term->domain !== Facility::DOMAIN; |
| 380 | 380 | } |
| 381 | 381 | )); |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
| 405 | 405 | |
| 406 | 406 | $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : []; |
| 407 | - $label = (string) $labelAdded->getLabel(); |
|
| 407 | + $label = (string)$labelAdded->getLabel(); |
|
| 408 | 408 | |
| 409 | 409 | $labels[] = $label; |
| 410 | 410 | $offerLd->{$labelsProperty} = array_unique($labels); |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) { |
| 431 | 431 | $offerLd->{$labelsProperty} = array_filter( |
| 432 | 432 | $offerLd->{$labelsProperty}, |
| 433 | - function ($label) use ($labelRemoved) { |
|
| 433 | + function($label) use ($labelRemoved) { |
|
| 434 | 434 | return !$labelRemoved->getLabel()->equals( |
| 435 | 435 | new Label($label) |
| 436 | 436 | ); |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | return; |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | - $imageId = (string) $imageRemoved->getImage()->getMediaObjectId(); |
|
| 533 | + $imageId = (string)$imageRemoved->getImage()->getMediaObjectId(); |
|
| 534 | 534 | |
| 535 | 535 | /** |
| 536 | 536 | * Matches any object that is not the removed image. |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | * @return bool |
| 542 | 542 | * Returns true when the media object does not match the image to remove. |
| 543 | 543 | */ |
| 544 | - $shouldNotBeRemoved = function ($mediaObject) use ($imageId) { |
|
| 544 | + $shouldNotBeRemoved = function($mediaObject) use ($imageId) { |
|
| 545 | 545 | $containsId = !!strpos($mediaObject->{'@id'}, $imageId); |
| 546 | 546 | return !$containsId; |
| 547 | 547 | }; |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | $document = $this->loadDocumentFromRepository($mainImageSelected); |
| 581 | 581 | $offerLd = $document->getBody(); |
| 582 | 582 | $imageId = $mainImageSelected->getImage()->getMediaObjectId(); |
| 583 | - $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
| 583 | + $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
| 584 | 584 | if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) { |
| 585 | 585 | $matchingMediaObject = $currentMediaObject; |
| 586 | 586 | } |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | */ |
| 606 | 606 | protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId) |
| 607 | 607 | { |
| 608 | - return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0; |
|
| 608 | + return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0; |
|
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | /** |
@@ -802,7 +802,7 @@ discard block |
||
| 802 | 802 | $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated); |
| 803 | 803 | |
| 804 | 804 | $offerLd = $document->getBody(); |
| 805 | - $offerLd->typicalAgeRange = (string) $typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
| 805 | + $offerLd->typicalAgeRange = (string)$typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
| 806 | 806 | |
| 807 | 807 | return $document->withBody($offerLd); |
| 808 | 808 | } |
@@ -930,14 +930,14 @@ discard block |
||
| 930 | 930 | $images = $imagesEvent->getImages(); |
| 931 | 931 | $currentMediaObjects = isset($offerLd->mediaObject) ? $offerLd->mediaObject : []; |
| 932 | 932 | $dutchMediaObjects = array_map( |
| 933 | - function (Image $image) { |
|
| 933 | + function(Image $image) { |
|
| 934 | 934 | return $this->mediaObjectSerializer->serialize($image, 'json-ld'); |
| 935 | 935 | }, |
| 936 | 936 | $images->toArray() |
| 937 | 937 | ); |
| 938 | 938 | $translatedMediaObjects = array_filter( |
| 939 | 939 | $currentMediaObjects, |
| 940 | - function ($image) { |
|
| 940 | + function($image) { |
|
| 941 | 941 | return $image->inLanguage !== 'nl'; |
| 942 | 942 | } |
| 943 | 943 | ); |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | } |
| 951 | 951 | |
| 952 | 952 | if (isset($mainImage)) { |
| 953 | - $offerLd->image = (string) $mainImage->getSourceLocation(); |
|
| 953 | + $offerLd->image = (string)$mainImage->getSourceLocation(); |
|
| 954 | 954 | } |
| 955 | 955 | } |
| 956 | 956 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 65 | 65 | 'CultuurNet\UDB3\Event\TitleTranslated', |
| 66 | - function (array $serializedObject) { |
|
| 66 | + function(array $serializedObject) { |
|
| 67 | 67 | $serializedObject['class'] = TitleTranslated::class; |
| 68 | 68 | |
| 69 | 69 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 76 | 76 | 'CultuurNet\UDB3\Event\DescriptionTranslated', |
| 77 | - function (array $serializedObject) { |
|
| 77 | + function(array $serializedObject) { |
|
| 78 | 78 | $serializedObject['class'] = DescriptionTranslated::class; |
| 79 | 79 | |
| 80 | 80 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -89,49 +89,49 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 91 | 91 | 'CultuurNet\UDB3\Label\Events\MadeInvisible', |
| 92 | - function (array $serializedObject) use ($labelRepository) { |
|
| 92 | + function(array $serializedObject) use ($labelRepository) { |
|
| 93 | 93 | return self::addLabelName($serializedObject, $labelRepository); |
| 94 | 94 | } |
| 95 | 95 | ); |
| 96 | 96 | |
| 97 | 97 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 98 | 98 | 'CultuurNet\UDB3\Label\Events\MadeVisible', |
| 99 | - function (array $serializedObject) use ($labelRepository) { |
|
| 99 | + function(array $serializedObject) use ($labelRepository) { |
|
| 100 | 100 | return self::addLabelName($serializedObject, $labelRepository); |
| 101 | 101 | } |
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | 104 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 105 | 105 | 'CultuurNet\UDB3\Label\Events\MadePrivate', |
| 106 | - function (array $serializedObject) use ($labelRepository) { |
|
| 106 | + function(array $serializedObject) use ($labelRepository) { |
|
| 107 | 107 | return self::addLabelName($serializedObject, $labelRepository); |
| 108 | 108 | } |
| 109 | 109 | ); |
| 110 | 110 | |
| 111 | 111 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 112 | 112 | 'CultuurNet\UDB3\Label\Events\MadePublic', |
| 113 | - function (array $serializedObject) use ($labelRepository) { |
|
| 113 | + function(array $serializedObject) use ($labelRepository) { |
|
| 114 | 114 | return self::addLabelName($serializedObject, $labelRepository); |
| 115 | 115 | } |
| 116 | 116 | ); |
| 117 | 117 | |
| 118 | 118 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 119 | 119 | 'CultuurNet\UDB3\Organizer\Events\LabelAdded', |
| 120 | - function (array $serializedObject) use ($labelRepository) { |
|
| 120 | + function(array $serializedObject) use ($labelRepository) { |
|
| 121 | 121 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
| 122 | 122 | } |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | 125 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 126 | 126 | 'CultuurNet\UDB3\Organizer\Events\LabelRemoved', |
| 127 | - function (array $serializedObject) use ($labelRepository) { |
|
| 127 | + function(array $serializedObject) use ($labelRepository) { |
|
| 128 | 128 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
| 129 | 129 | } |
| 130 | 130 | ); |
| 131 | 131 | |
| 132 | 132 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 133 | 133 | 'CultuurNet\UDB3\Event\Events\EventWasLabelled', |
| 134 | - function (array $serializedObject) { |
|
| 134 | + function(array $serializedObject) { |
|
| 135 | 135 | $serializedObject['class'] = LabelAdded::class; |
| 136 | 136 | |
| 137 | 137 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 144 | 144 | 'CultuurNet\UDB3\Event\EventWasTagged', |
| 145 | - function (array $serializedObject) { |
|
| 145 | + function(array $serializedObject) { |
|
| 146 | 146 | $serializedObject['class'] = LabelAdded::class; |
| 147 | 147 | |
| 148 | 148 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 157 | 157 | 'CultuurNet\UDB3\Event\TagErased', |
| 158 | - function (array $serializedObject) { |
|
| 158 | + function(array $serializedObject) { |
|
| 159 | 159 | $serializedObject['class'] = LabelRemoved::class; |
| 160 | 160 | |
| 161 | 161 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 170 | 170 | 'CultuurNet\UDB3\Event\Events\Unlabelled', |
| 171 | - function (array $serializedObject) { |
|
| 171 | + function(array $serializedObject) { |
|
| 172 | 172 | $serializedObject['class'] = LabelRemoved::class; |
| 173 | 173 | |
| 174 | 174 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 185 | 185 | 'CultuurNet\UDB3\Event\EventImportedFromUDB2', |
| 186 | - function (array $serializedObject) { |
|
| 186 | + function(array $serializedObject) { |
|
| 187 | 187 | $serializedObject['class'] = EventImportedFromUDB2::class; |
| 188 | 188 | |
| 189 | 189 | return $serializedObject; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 197 | 197 | 'CultuurNet\UDB3\Place\Events\FacilitiesUpdated', |
| 198 | - function (array $serializedObject) { |
|
| 198 | + function(array $serializedObject) { |
|
| 199 | 199 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
| 200 | 200 | |
| 201 | 201 | return $serializedObject; |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | foreach ($refactoredEventEvents as $refactoredEventEvent) { |
| 221 | 221 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 222 | 222 | $refactoredEventEvent, |
| 223 | - function (array $serializedObject) { |
|
| 223 | + function(array $serializedObject) { |
|
| 224 | 224 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
| 225 | 225 | return $serializedObject; |
| 226 | 226 | } |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | foreach ($refactoredPlaceEvents as $refactoredPlaceEvent) { |
| 245 | 245 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 246 | 246 | $refactoredPlaceEvent, |
| 247 | - function (array $serializedObject) { |
|
| 247 | + function(array $serializedObject) { |
|
| 248 | 248 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
| 249 | 249 | return $serializedObject; |
| 250 | 250 | } |