@@ -38,7 +38,7 @@ |
||
| 38 | 38 | public function getNames() |
| 39 | 39 | { |
| 40 | 40 | return array_map( |
| 41 | - function (Label $label) { |
|
| 41 | + function(Label $label) { |
|
| 42 | 42 | return new StringLiteral($label->getName()->toString()); |
| 43 | 43 | }, |
| 44 | 44 | $this->getLabels()->toArray() |
@@ -13,7 +13,6 @@ |
||
| 13 | 13 | use CultuurNet\UDB3\Language; |
| 14 | 14 | use CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\LabelName; |
| 15 | 15 | use CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Labels; |
| 16 | -use CultuurNet\UDB3\Organizer\Commands\ImportLabels; |
|
| 17 | 16 | use CultuurNet\UDB3\Organizer\Events\AddressUpdated; |
| 18 | 17 | use CultuurNet\UDB3\Organizer\Events\ContactPointUpdated; |
| 19 | 18 | use CultuurNet\UDB3\Organizer\Events\LabelAdded; |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | // Convert the imported labels to label collection. |
| 249 | 249 | $importLabelsCollection = new LabelCollection( |
| 250 | 250 | array_map( |
| 251 | - function (\CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label $label) { |
|
| 251 | + function(\CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label $label) { |
|
| 252 | 252 | return new Label( |
| 253 | 253 | $label->getName()->toString(), |
| 254 | 254 | $label->isVisible() |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | foreach ($addedLabels->asArray() as $addedLabel) { |
| 273 | 273 | $importLabels = $importLabels->with( |
| 274 | 274 | new \CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label( |
| 275 | - new LabelName((string) $addedLabel), |
|
| 275 | + new LabelName((string)$addedLabel), |
|
| 276 | 276 | $addedLabel->isVisible() |
| 277 | 277 | ) |
| 278 | 278 | ); |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | protected function applyOrganizerImportedFromUDB2( |
| 339 | 339 | OrganizerImportedFromUDB2 $organizerImported |
| 340 | 340 | ) { |
| 341 | - $this->actorId = (string) $organizerImported->getActorId(); |
|
| 341 | + $this->actorId = (string)$organizerImported->getActorId(); |
|
| 342 | 342 | |
| 343 | 343 | // On import from UDB2 the default main language is 'nl'. |
| 344 | 344 | $this->mainLanguage = new Language('nl'); |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | $normalizedData = [ |
| 50 | 50 | '@id' => $this->iriGenerator->iri($mediaObject->getMediaObjectId()), |
| 51 | 51 | '@type' => $type, |
| 52 | - 'contentUrl' => (string) $mediaObject->getSourceLocation(), |
|
| 53 | - 'thumbnailUrl' => (string) $mediaObject->getSourceLocation(), |
|
| 54 | - 'description' => (string) $mediaObject->getDescription(), |
|
| 55 | - 'copyrightHolder' => (string) $mediaObject->getCopyrightHolder(), |
|
| 56 | - 'inLanguage' => (string) $mediaObject->getLanguage(), |
|
| 52 | + 'contentUrl' => (string)$mediaObject->getSourceLocation(), |
|
| 53 | + 'thumbnailUrl' => (string)$mediaObject->getSourceLocation(), |
|
| 54 | + 'description' => (string)$mediaObject->getDescription(), |
|
| 55 | + 'copyrightHolder' => (string)$mediaObject->getCopyrightHolder(), |
|
| 56 | + 'inLanguage' => (string)$mediaObject->getLanguage(), |
|
| 57 | 57 | ]; |
| 58 | 58 | |
| 59 | 59 | return $normalizedData; |
@@ -61,18 +61,18 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public function serializeMimeType(MIMEType $mimeType) |
| 63 | 63 | { |
| 64 | - $typeParts = explode('/', (string) $mimeType); |
|
| 64 | + $typeParts = explode('/', (string)$mimeType); |
|
| 65 | 65 | $type = array_shift($typeParts); |
| 66 | 66 | |
| 67 | 67 | if ($type === 'image') { |
| 68 | 68 | return 'schema:ImageObject'; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if ((string) $mimeType === 'application/octet-stream') { |
|
| 71 | + if ((string)$mimeType === 'application/octet-stream') { |
|
| 72 | 72 | return 'schema:mediaObject'; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - throw new UnsupportedException('Unsupported MIME-type "'. $mimeType .'"'); |
|
| 75 | + throw new UnsupportedException('Unsupported MIME-type "'.$mimeType.'"'); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | public function deserialize($data, $type, $format, array $context = array()) |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $sameFacilities = array_uintersect( |
| 217 | 217 | $facilities1, |
| 218 | 218 | $facilities2, |
| 219 | - function (Facility $facility1, Facility $facility2) { |
|
| 219 | + function(Facility $facility1, Facility $facility2) { |
|
| 220 | 220 | return strcmp($facility1->getId(), $facility2->getId()); |
| 221 | 221 | } |
| 222 | 222 | ); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | // Convert the imported labels to label collection. |
| 268 | 268 | $importLabelsCollection = new LabelCollection( |
| 269 | 269 | array_map( |
| 270 | - function (\CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label $label) { |
|
| 270 | + function(\CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label $label) { |
|
| 271 | 271 | return new Label( |
| 272 | 272 | $label->getName()->toString(), |
| 273 | 273 | $label->isVisible() |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | foreach ($addedLabels->asArray() as $addedLabel) { |
| 292 | 292 | $importLabels = $importLabels->with( |
| 293 | 293 | new \CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label( |
| 294 | - new LabelName((string) $addedLabel), |
|
| 294 | + new LabelName((string)$addedLabel), |
|
| 295 | 295 | $addedLabel->isVisible() |
| 296 | 296 | ) |
| 297 | 297 | ); |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | if ($language->getCode() !== $this->mainLanguage->getCode()) { |
| 343 | 343 | $event = $this->createDescriptionTranslatedEvent($language, $description); |
| 344 | 344 | } else { |
| 345 | - $event = $this->createDescriptionUpdatedEvent((string) $description); |
|
| 345 | + $event = $this->createDescriptionUpdatedEvent((string)$description); |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | $this->apply($event); |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | $importImages = $imageCollection->toArray(); |
| 659 | 659 | $currentImages = $currentImageCollection->toArray(); |
| 660 | 660 | |
| 661 | - $compareImages = function (Image $a, Image $b) { |
|
| 661 | + $compareImages = function(Image $a, Image $b) { |
|
| 662 | 662 | $idA = $a->getMediaObjectId()->toNative(); |
| 663 | 663 | $idB = $b->getMediaObjectId()->toNative(); |
| 664 | 664 | return strcmp($idA, $idB); |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | if ($this->rejectedReason && $reason->sameValueAs($this->rejectedReason)) { |
| 806 | 806 | return true; // nothing left to do if the offer has already been rejected for the same reason |
| 807 | 807 | } else { |
| 808 | - throw new Exception('The offer has already been rejected for another reason: ' . $this->rejectedReason); |
|
| 808 | + throw new Exception('The offer has already been rejected for another reason: '.$this->rejectedReason); |
|
| 809 | 809 | } |
| 810 | 810 | } |
| 811 | 811 | |
@@ -980,7 +980,7 @@ discard block |
||
| 980 | 980 | $dutchImagesList = $imagesEvent->getImages()->toArray(); |
| 981 | 981 | $translatedImagesList = array_filter( |
| 982 | 982 | $this->images->toArray(), |
| 983 | - function (Image $image) { |
|
| 983 | + function(Image $image) { |
|
| 984 | 984 | return $image->getLanguage()->getCode() !== 'nl'; |
| 985 | 985 | } |
| 986 | 986 | ); |
@@ -116,10 +116,10 @@ |
||
| 116 | 116 | { |
| 117 | 117 | $serialized = array_filter( |
| 118 | 118 | [ |
| 119 | - 'phone' => $this->phone, |
|
| 120 | - 'email' => $this->email, |
|
| 121 | - 'url' => $this->url, |
|
| 122 | - 'urlLabel' => $this->urlLabel, |
|
| 119 | + 'phone' => $this->phone, |
|
| 120 | + 'email' => $this->email, |
|
| 121 | + 'url' => $this->url, |
|
| 122 | + 'urlLabel' => $this->urlLabel, |
|
| 123 | 123 | ] |
| 124 | 124 | ); |
| 125 | 125 | |
@@ -64,21 +64,21 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 66 | 66 | 'CultuurNet\UDB3\Event\Events\EventCreated', |
| 67 | - function (array $serializedObject) { |
|
| 67 | + function(array $serializedObject) { |
|
| 68 | 68 | return self::addDefaultMainLanguage($serializedObject); |
| 69 | 69 | } |
| 70 | 70 | ); |
| 71 | 71 | |
| 72 | 72 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 73 | 73 | 'CultuurNet\UDB3\Place\Events\PlaceCreated', |
| 74 | - function (array $serializedObject) { |
|
| 74 | + function(array $serializedObject) { |
|
| 75 | 75 | return self::addDefaultMainLanguage($serializedObject); |
| 76 | 76 | } |
| 77 | 77 | ); |
| 78 | 78 | |
| 79 | 79 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 80 | 80 | 'CultuurNet\UDB3\Organizer\Events\OrganizerCreatedWithUniqueWebsite', |
| 81 | - function (array $serializedObject) { |
|
| 81 | + function(array $serializedObject) { |
|
| 82 | 82 | return self::addDefaultMainLanguage($serializedObject); |
| 83 | 83 | } |
| 84 | 84 | ); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 91 | 91 | 'CultuurNet\UDB3\Event\TitleTranslated', |
| 92 | - function (array $serializedObject) { |
|
| 92 | + function(array $serializedObject) { |
|
| 93 | 93 | $serializedObject['class'] = TitleTranslated::class; |
| 94 | 94 | |
| 95 | 95 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 102 | 102 | 'CultuurNet\UDB3\Event\DescriptionTranslated', |
| 103 | - function (array $serializedObject) { |
|
| 103 | + function(array $serializedObject) { |
|
| 104 | 104 | $serializedObject['class'] = DescriptionTranslated::class; |
| 105 | 105 | |
| 106 | 106 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -115,49 +115,49 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 117 | 117 | 'CultuurNet\UDB3\Label\Events\MadeInvisible', |
| 118 | - function (array $serializedObject) use ($labelRepository) { |
|
| 118 | + function(array $serializedObject) use ($labelRepository) { |
|
| 119 | 119 | return self::addLabelName($serializedObject, $labelRepository); |
| 120 | 120 | } |
| 121 | 121 | ); |
| 122 | 122 | |
| 123 | 123 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 124 | 124 | 'CultuurNet\UDB3\Label\Events\MadeVisible', |
| 125 | - function (array $serializedObject) use ($labelRepository) { |
|
| 125 | + function(array $serializedObject) use ($labelRepository) { |
|
| 126 | 126 | return self::addLabelName($serializedObject, $labelRepository); |
| 127 | 127 | } |
| 128 | 128 | ); |
| 129 | 129 | |
| 130 | 130 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 131 | 131 | 'CultuurNet\UDB3\Label\Events\MadePrivate', |
| 132 | - function (array $serializedObject) use ($labelRepository) { |
|
| 132 | + function(array $serializedObject) use ($labelRepository) { |
|
| 133 | 133 | return self::addLabelName($serializedObject, $labelRepository); |
| 134 | 134 | } |
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | 137 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 138 | 138 | 'CultuurNet\UDB3\Label\Events\MadePublic', |
| 139 | - function (array $serializedObject) use ($labelRepository) { |
|
| 139 | + function(array $serializedObject) use ($labelRepository) { |
|
| 140 | 140 | return self::addLabelName($serializedObject, $labelRepository); |
| 141 | 141 | } |
| 142 | 142 | ); |
| 143 | 143 | |
| 144 | 144 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 145 | 145 | 'CultuurNet\UDB3\Organizer\Events\LabelAdded', |
| 146 | - function (array $serializedObject) use ($labelRepository) { |
|
| 146 | + function(array $serializedObject) use ($labelRepository) { |
|
| 147 | 147 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
| 148 | 148 | } |
| 149 | 149 | ); |
| 150 | 150 | |
| 151 | 151 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 152 | 152 | 'CultuurNet\UDB3\Organizer\Events\LabelRemoved', |
| 153 | - function (array $serializedObject) use ($labelRepository) { |
|
| 153 | + function(array $serializedObject) use ($labelRepository) { |
|
| 154 | 154 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
| 155 | 155 | } |
| 156 | 156 | ); |
| 157 | 157 | |
| 158 | 158 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 159 | 159 | 'CultuurNet\UDB3\Event\Events\EventWasLabelled', |
| 160 | - function (array $serializedObject) { |
|
| 160 | + function(array $serializedObject) { |
|
| 161 | 161 | $serializedObject['class'] = LabelAdded::class; |
| 162 | 162 | |
| 163 | 163 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 170 | 170 | 'CultuurNet\UDB3\Event\EventWasTagged', |
| 171 | - function (array $serializedObject) { |
|
| 171 | + function(array $serializedObject) { |
|
| 172 | 172 | $serializedObject['class'] = LabelAdded::class; |
| 173 | 173 | |
| 174 | 174 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 183 | 183 | 'CultuurNet\UDB3\Event\TagErased', |
| 184 | - function (array $serializedObject) { |
|
| 184 | + function(array $serializedObject) { |
|
| 185 | 185 | $serializedObject['class'] = LabelRemoved::class; |
| 186 | 186 | |
| 187 | 187 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 196 | 196 | 'CultuurNet\UDB3\Event\Events\Unlabelled', |
| 197 | - function (array $serializedObject) { |
|
| 197 | + function(array $serializedObject) { |
|
| 198 | 198 | $serializedObject['class'] = LabelRemoved::class; |
| 199 | 199 | |
| 200 | 200 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 211 | 211 | 'CultuurNet\UDB3\Event\EventImportedFromUDB2', |
| 212 | - function (array $serializedObject) { |
|
| 212 | + function(array $serializedObject) { |
|
| 213 | 213 | $serializedObject['class'] = EventImportedFromUDB2::class; |
| 214 | 214 | |
| 215 | 215 | return $serializedObject; |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | */ |
| 222 | 222 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 223 | 223 | 'CultuurNet\UDB3\Place\Events\FacilitiesUpdated', |
| 224 | - function (array $serializedObject) { |
|
| 224 | + function(array $serializedObject) { |
|
| 225 | 225 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
| 226 | 226 | |
| 227 | 227 | return $serializedObject; |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | */ |
| 234 | 234 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 235 | 235 | 'CultuurNet\UDB3\Place\Events\GeoCoordinatesUpdated', |
| 236 | - function (array $serializedObject) { |
|
| 236 | + function(array $serializedObject) { |
|
| 237 | 237 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
| 238 | 238 | |
| 239 | 239 | return $serializedObject; |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | /** |
| 244 | 244 | * BOOKING INFO EVENT |
| 245 | 245 | */ |
| 246 | - $manipulateAvailability = function (array $serializedBookingInfo, $propertyName) { |
|
| 246 | + $manipulateAvailability = function(array $serializedBookingInfo, $propertyName) { |
|
| 247 | 247 | if (!isset($serializedBookingInfo[$propertyName]) || empty($serializedBookingInfo[$propertyName])) { |
| 248 | 248 | $serializedBookingInfo[$propertyName] = null; |
| 249 | 249 | return $serializedBookingInfo; |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | return $serializedBookingInfo; |
| 271 | 271 | }; |
| 272 | 272 | |
| 273 | - $manipulateBookingInfoEvent = function (array $serializedEvent) use ($manipulateAvailability) { |
|
| 273 | + $manipulateBookingInfoEvent = function(array $serializedEvent) use ($manipulateAvailability) { |
|
| 274 | 274 | $serializedEvent = self::replaceEventIdWithItemId($serializedEvent); |
| 275 | 275 | $serializedEvent = self::replacePlaceIdWithItemId($serializedEvent); |
| 276 | 276 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | foreach ($refactoredEventEvents as $refactoredEventEvent) { |
| 310 | 310 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 311 | 311 | $refactoredEventEvent, |
| 312 | - function (array $serializedObject) { |
|
| 312 | + function(array $serializedObject) { |
|
| 313 | 313 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
| 314 | 314 | return $serializedObject; |
| 315 | 315 | } |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | foreach ($refactoredPlaceEvents as $refactoredPlaceEvent) { |
| 333 | 333 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
| 334 | 334 | $refactoredPlaceEvent, |
| 335 | - function (array $serializedObject) { |
|
| 335 | + function(array $serializedObject) { |
|
| 336 | 336 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
| 337 | 337 | return $serializedObject; |
| 338 | 338 | } |
@@ -59,13 +59,13 @@ |
||
| 59 | 59 | $mainLanguage = isset($body->mainLanguage) ? $body->mainLanguage : 'nl'; |
| 60 | 60 | |
| 61 | 61 | if (is_string($body->name)) { |
| 62 | - $body->name = (object) [ |
|
| 62 | + $body->name = (object)[ |
|
| 63 | 63 | $mainLanguage => $body->name, |
| 64 | 64 | ]; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | if (isset($body->address->streetAddress)) { |
| 68 | - $body->address = (object) [ |
|
| 68 | + $body->address = (object)[ |
|
| 69 | 69 | $mainLanguage => $body->address, |
| 70 | 70 | ]; |
| 71 | 71 | } |