@@ -9,8 +9,8 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | public function format(Address $address) |
| 11 | 11 | { |
| 12 | - return $address->getPostalCode() . ' ' . |
|
| 13 | - $address->getLocality() . ', ' . |
|
| 12 | + return $address->getPostalCode().' '. |
|
| 13 | + $address->getLocality().', '. |
|
| 14 | 14 | $address->getCountry()->getCode(); |
| 15 | 15 | } |
| 16 | 16 | } |
@@ -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 | |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | } |
| 155 | 155 | return parent::serialize() + array( |
| 156 | 156 | 'main_language' => $this->mainLanguage->getCode(), |
| 157 | - 'title' => (string) $this->getTitle(), |
|
| 157 | + 'title' => (string)$this->getTitle(), |
|
| 158 | 158 | 'event_type' => $this->getEventType()->serialize(), |
| 159 | 159 | 'theme' => $theme, |
| 160 | 160 | 'address' => $this->getAddress()->serialize(), |
@@ -73,8 +73,8 @@ |
||
| 73 | 73 | { |
| 74 | 74 | return parent::serialize() + array( |
| 75 | 75 | 'main_language' => $this->getMainLanguage()->getCode(), |
| 76 | - 'website' => (string) $this->getWebsite(), |
|
| 77 | - 'title' => (string) $this->getTitle(), |
|
| 76 | + 'website' => (string)$this->getWebsite(), |
|
| 77 | + 'title' => (string)$this->getTitle(), |
|
| 78 | 78 | ); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | |
| 218 | 218 | $this->setMainLanguage($jsonLD, $organizerCreated->getMainLanguage()); |
| 219 | 219 | |
| 220 | - $jsonLD->url = (string) $organizerCreated->getWebsite(); |
|
| 220 | + $jsonLD->url = (string)$organizerCreated->getWebsite(); |
|
| 221 | 221 | |
| 222 | 222 | $jsonLD->name = [ |
| 223 | 223 | $this->getMainLanguage($jsonLD)->getCode() => $organizerCreated->getTitle(), |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | $document = $this->repository->get($organizerId); |
| 249 | 249 | |
| 250 | 250 | $jsonLD = $document->getBody(); |
| 251 | - $jsonLD->url = (string) $websiteUpdated->getWebsite(); |
|
| 251 | + $jsonLD->url = (string)$websiteUpdated->getWebsite(); |
|
| 252 | 252 | |
| 253 | 253 | return $document->withBody($jsonLD); |
| 254 | 254 | } |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
| 357 | 357 | |
| 358 | 358 | $labels = isset($jsonLD->{$labelsProperty}) ? $jsonLD->{$labelsProperty} : []; |
| 359 | - $label = (string) $labelAdded->getLabel(); |
|
| 359 | + $label = (string)$labelAdded->getLabel(); |
|
| 360 | 360 | |
| 361 | 361 | $labels[] = $label; |
| 362 | 362 | $jsonLD->{$labelsProperty} = array_unique($labels); |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | if (isset($jsonLD->{$labelsProperty}) && is_array($jsonLD->{$labelsProperty})) { |
| 381 | 381 | $jsonLD->{$labelsProperty} = array_filter( |
| 382 | 382 | $jsonLD->{$labelsProperty}, |
| 383 | - function ($label) use ($labelRemoved) { |
|
| 383 | + function($label) use ($labelRemoved) { |
|
| 384 | 384 | return !$labelRemoved->getLabel()->equals( |
| 385 | 385 | new Label($label) |
| 386 | 386 | ); |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | private function applyOrganizerDeleted( |
| 408 | 408 | OrganizerDeleted $organizerDeleted |
| 409 | 409 | ) { |
| 410 | - $document = $this->repository->get($organizerDeleted->getOrganizerId()); |
|
| 410 | + $document = $this->repository->get($organizerDeleted->getOrganizerId()); |
|
| 411 | 411 | |
| 412 | 412 | $jsonLD = $document->getBody(); |
| 413 | 413 | |
@@ -63,21 +63,21 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 65 | 65 | 'CultuurNet\UDB3\Event\Events\EventCreated', |
| 66 | - function (array $serializedObject) { |
|
| 66 | + function(array $serializedObject) { |
|
| 67 | 67 | return self::addDefaultMainLanguage($serializedObject); |
| 68 | 68 | } |
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | 71 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 72 | 72 | 'CultuurNet\UDB3\Place\Events\PlaceCreated', |
| 73 | - function (array $serializedObject) { |
|
| 73 | + function(array $serializedObject) { |
|
| 74 | 74 | return self::addDefaultMainLanguage($serializedObject); |
| 75 | 75 | } |
| 76 | 76 | ); |
| 77 | 77 | |
| 78 | 78 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 79 | 79 | 'CultuurNet\UDB3\Organizer\Events\OrganizerCreatedWithUniqueWebsite', |
| 80 | - function (array $serializedObject) { |
|
| 80 | + function(array $serializedObject) { |
|
| 81 | 81 | return self::addDefaultMainLanguage($serializedObject); |
| 82 | 82 | } |
| 83 | 83 | ); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 90 | 90 | 'CultuurNet\UDB3\Event\TitleTranslated', |
| 91 | - function (array $serializedObject) { |
|
| 91 | + function(array $serializedObject) { |
|
| 92 | 92 | $serializedObject['class'] = TitleTranslated::class; |
| 93 | 93 | |
| 94 | 94 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 101 | 101 | 'CultuurNet\UDB3\Event\DescriptionTranslated', |
| 102 | - function (array $serializedObject) { |
|
| 102 | + function(array $serializedObject) { |
|
| 103 | 103 | $serializedObject['class'] = DescriptionTranslated::class; |
| 104 | 104 | |
| 105 | 105 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -114,49 +114,49 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 116 | 116 | 'CultuurNet\UDB3\Label\Events\MadeInvisible', |
| 117 | - function (array $serializedObject) use ($labelRepository) { |
|
| 117 | + function(array $serializedObject) use ($labelRepository) { |
|
| 118 | 118 | return self::addLabelName($serializedObject, $labelRepository); |
| 119 | 119 | } |
| 120 | 120 | ); |
| 121 | 121 | |
| 122 | 122 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 123 | 123 | 'CultuurNet\UDB3\Label\Events\MadeVisible', |
| 124 | - function (array $serializedObject) use ($labelRepository) { |
|
| 124 | + function(array $serializedObject) use ($labelRepository) { |
|
| 125 | 125 | return self::addLabelName($serializedObject, $labelRepository); |
| 126 | 126 | } |
| 127 | 127 | ); |
| 128 | 128 | |
| 129 | 129 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 130 | 130 | 'CultuurNet\UDB3\Label\Events\MadePrivate', |
| 131 | - function (array $serializedObject) use ($labelRepository) { |
|
| 131 | + function(array $serializedObject) use ($labelRepository) { |
|
| 132 | 132 | return self::addLabelName($serializedObject, $labelRepository); |
| 133 | 133 | } |
| 134 | 134 | ); |
| 135 | 135 | |
| 136 | 136 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 137 | 137 | 'CultuurNet\UDB3\Label\Events\MadePublic', |
| 138 | - function (array $serializedObject) use ($labelRepository) { |
|
| 138 | + function(array $serializedObject) use ($labelRepository) { |
|
| 139 | 139 | return self::addLabelName($serializedObject, $labelRepository); |
| 140 | 140 | } |
| 141 | 141 | ); |
| 142 | 142 | |
| 143 | 143 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 144 | 144 | 'CultuurNet\UDB3\Organizer\Events\LabelAdded', |
| 145 | - function (array $serializedObject) use ($labelRepository) { |
|
| 145 | + function(array $serializedObject) use ($labelRepository) { |
|
| 146 | 146 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
| 147 | 147 | } |
| 148 | 148 | ); |
| 149 | 149 | |
| 150 | 150 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 151 | 151 | 'CultuurNet\UDB3\Organizer\Events\LabelRemoved', |
| 152 | - function (array $serializedObject) use ($labelRepository) { |
|
| 152 | + function(array $serializedObject) use ($labelRepository) { |
|
| 153 | 153 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
| 154 | 154 | } |
| 155 | 155 | ); |
| 156 | 156 | |
| 157 | 157 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 158 | 158 | 'CultuurNet\UDB3\Event\Events\EventWasLabelled', |
| 159 | - function (array $serializedObject) { |
|
| 159 | + function(array $serializedObject) { |
|
| 160 | 160 | $serializedObject['class'] = LabelAdded::class; |
| 161 | 161 | |
| 162 | 162 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 169 | 169 | 'CultuurNet\UDB3\Event\EventWasTagged', |
| 170 | - function (array $serializedObject) { |
|
| 170 | + function(array $serializedObject) { |
|
| 171 | 171 | $serializedObject['class'] = LabelAdded::class; |
| 172 | 172 | |
| 173 | 173 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 182 | 182 | 'CultuurNet\UDB3\Event\TagErased', |
| 183 | - function (array $serializedObject) { |
|
| 183 | + function(array $serializedObject) { |
|
| 184 | 184 | $serializedObject['class'] = LabelRemoved::class; |
| 185 | 185 | |
| 186 | 186 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 195 | 195 | 'CultuurNet\UDB3\Event\Events\Unlabelled', |
| 196 | - function (array $serializedObject) { |
|
| 196 | + function(array $serializedObject) { |
|
| 197 | 197 | $serializedObject['class'] = LabelRemoved::class; |
| 198 | 198 | |
| 199 | 199 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 210 | 210 | 'CultuurNet\UDB3\Event\EventImportedFromUDB2', |
| 211 | - function (array $serializedObject) { |
|
| 211 | + function(array $serializedObject) { |
|
| 212 | 212 | $serializedObject['class'] = EventImportedFromUDB2::class; |
| 213 | 213 | |
| 214 | 214 | return $serializedObject; |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | */ |
| 221 | 221 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 222 | 222 | 'CultuurNet\UDB3\Place\Events\FacilitiesUpdated', |
| 223 | - function (array $serializedObject) { |
|
| 223 | + function(array $serializedObject) { |
|
| 224 | 224 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
| 225 | 225 | |
| 226 | 226 | return $serializedObject; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | */ |
| 233 | 233 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 234 | 234 | 'CultuurNet\UDB3\Place\Events\GeoCoordinatesUpdated', |
| 235 | - function (array $serializedObject) { |
|
| 235 | + function(array $serializedObject) { |
|
| 236 | 236 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
| 237 | 237 | |
| 238 | 238 | return $serializedObject; |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | foreach ($refactoredEventEvents as $refactoredEventEvent) { |
| 258 | 258 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 259 | 259 | $refactoredEventEvent, |
| 260 | - function (array $serializedObject) { |
|
| 260 | + function(array $serializedObject) { |
|
| 261 | 261 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
| 262 | 262 | return $serializedObject; |
| 263 | 263 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | foreach ($refactoredPlaceEvents as $refactoredPlaceEvent) { |
| 282 | 282 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 283 | 283 | $refactoredPlaceEvent, |
| 284 | - function (array $serializedObject) { |
|
| 284 | + function(array $serializedObject) { |
|
| 285 | 285 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
| 286 | 286 | return $serializedObject; |
| 287 | 287 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (!is_string($itemId)) { |
| 21 | 21 | throw new \InvalidArgumentException( |
| 22 | - 'Expected itemId to be a string, received ' . gettype($itemId) |
|
| 22 | + 'Expected itemId to be a string, received '.gettype($itemId) |
|
| 23 | 23 | ); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | array $openingHours = array() |
| 63 | 63 | ) { |
| 64 | 64 | if (($type->is(CalendarType::MULTIPLE()) || $type->is(CalendarType::SINGLE())) && empty($startDate)) { |
| 65 | - throw new \UnexpectedValueException('Start date can not be empty for calendar type: ' . $type . '.'); |
|
| 65 | + throw new \UnexpectedValueException('Start date can not be empty for calendar type: '.$type.'.'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if ($type->is(CalendarType::PERIODIC()) && (empty($startDate) || empty($endDate))) { |
@@ -102,14 +102,14 @@ discard block |
||
| 102 | 102 | public function serialize() |
| 103 | 103 | { |
| 104 | 104 | $serializedTimestamps = array_map( |
| 105 | - function (Timestamp $timestamp) { |
|
| 105 | + function(Timestamp $timestamp) { |
|
| 106 | 106 | return $timestamp->serialize(); |
| 107 | 107 | }, |
| 108 | 108 | $this->timestamps |
| 109 | 109 | ); |
| 110 | 110 | |
| 111 | 111 | $serializedOpeningHours = array_map( |
| 112 | - function (OpeningHour $openingHour) { |
|
| 112 | + function(OpeningHour $openingHour) { |
|
| 113 | 113 | return $openingHour->serialize(); |
| 114 | 114 | }, |
| 115 | 115 | $this->openingHours |
@@ -137,13 +137,13 @@ discard block |
||
| 137 | 137 | !empty($data['startDate']) ? self::deserializeDateTime($data['startDate']) : null, |
| 138 | 138 | !empty($data['endDate']) ? self::deserializeDateTime($data['endDate']) : null, |
| 139 | 139 | !empty($data['timestamps']) ? array_map( |
| 140 | - function ($timestamp) { |
|
| 140 | + function($timestamp) { |
|
| 141 | 141 | return Timestamp::deserialize($timestamp); |
| 142 | 142 | }, |
| 143 | 143 | $data['timestamps'] |
| 144 | 144 | ) : [], |
| 145 | 145 | !empty($data['openingHours']) ? array_map( |
| 146 | - function ($openingHour) { |
|
| 146 | + function($openingHour) { |
|
| 147 | 147 | return OpeningHour::deserialize($openingHour); |
| 148 | 148 | }, |
| 149 | 149 | $data['openingHours'] |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | |
| 272 | 272 | if ($calendar instanceof CalendarWithSubEvents) { |
| 273 | 273 | $timestamps = array_map( |
| 274 | - function (DateRange $dateRange) { |
|
| 274 | + function(DateRange $dateRange) { |
|
| 275 | 275 | return Timestamp::fromUdb3ModelDateRange($dateRange); |
| 276 | 276 | }, |
| 277 | 277 | $calendar->getSubEvents()->toArray() |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | |
| 281 | 281 | if ($calendar instanceof CalendarWithOpeningHours) { |
| 282 | 282 | $openingHours = array_map( |
| 283 | - function (Udb3ModelOpeningHour $openingHour) { |
|
| 283 | + function(Udb3ModelOpeningHour $openingHour) { |
|
| 284 | 284 | return OpeningHour::fromUdb3ModelOpeningHour($openingHour); |
| 285 | 285 | }, |
| 286 | 286 | $calendar->getOpeningHours()->toArray() |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | public function getDaysOfWeek() |
| 53 | 53 | { |
| 54 | 54 | return array_map( |
| 55 | - function ($dayOfWeek) { |
|
| 55 | + function($dayOfWeek) { |
|
| 56 | 56 | return DayOfWeek::fromNative($dayOfWeek); |
| 57 | 57 | }, |
| 58 | 58 | $this->daysOfWeek |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | return array_reduce( |
| 68 | 68 | $data, |
| 69 | - function (DayOfWeekCollection $collection, $dayOfWeek) { |
|
| 69 | + function(DayOfWeekCollection $collection, $dayOfWeek) { |
|
| 70 | 70 | return $collection->addDayOfWeek(DayOfWeek::fromNative($dayOfWeek)); |
| 71 | 71 | }, |
| 72 | 72 | new DayOfWeekCollection() |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | public static function fromUdb3ModelDays(Days $days) |
| 89 | 89 | { |
| 90 | 90 | $days = array_map( |
| 91 | - function (Day $day) { |
|
| 91 | + function(Day $day) { |
|
| 92 | 92 | return DayOfWeek::fromUdb3ModelDay($day); |
| 93 | 93 | }, |
| 94 | 94 | $days->toArray() |