@@ -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 |
@@ -65,21 +65,21 @@ discard block |
||
65 | 65 | |
66 | 66 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
67 | 67 | 'CultuurNet\UDB3\Event\Events\EventCreated', |
68 | - function (array $serializedObject) { |
|
68 | + function(array $serializedObject) { |
|
69 | 69 | return self::addDefaultMainLanguage($serializedObject); |
70 | 70 | } |
71 | 71 | ); |
72 | 72 | |
73 | 73 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
74 | 74 | 'CultuurNet\UDB3\Place\Events\PlaceCreated', |
75 | - function (array $serializedObject) { |
|
75 | + function(array $serializedObject) { |
|
76 | 76 | return self::addDefaultMainLanguage($serializedObject); |
77 | 77 | } |
78 | 78 | ); |
79 | 79 | |
80 | 80 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
81 | 81 | 'CultuurNet\UDB3\Organizer\Events\OrganizerCreatedWithUniqueWebsite', |
82 | - function (array $serializedObject) { |
|
82 | + function(array $serializedObject) { |
|
83 | 83 | return self::addDefaultMainLanguage($serializedObject); |
84 | 84 | } |
85 | 85 | ); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
92 | 92 | 'CultuurNet\UDB3\Event\TitleTranslated', |
93 | - function (array $serializedObject) { |
|
93 | + function(array $serializedObject) { |
|
94 | 94 | $serializedObject['class'] = TitleTranslated::class; |
95 | 95 | |
96 | 96 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
103 | 103 | 'CultuurNet\UDB3\Event\DescriptionTranslated', |
104 | - function (array $serializedObject) { |
|
104 | + function(array $serializedObject) { |
|
105 | 105 | $serializedObject['class'] = DescriptionTranslated::class; |
106 | 106 | |
107 | 107 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -116,49 +116,49 @@ discard block |
||
116 | 116 | |
117 | 117 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
118 | 118 | 'CultuurNet\UDB3\Label\Events\MadeInvisible', |
119 | - function (array $serializedObject) use ($labelRepository) { |
|
119 | + function(array $serializedObject) use ($labelRepository) { |
|
120 | 120 | return self::addLabelName($serializedObject, $labelRepository); |
121 | 121 | } |
122 | 122 | ); |
123 | 123 | |
124 | 124 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
125 | 125 | 'CultuurNet\UDB3\Label\Events\MadeVisible', |
126 | - function (array $serializedObject) use ($labelRepository) { |
|
126 | + function(array $serializedObject) use ($labelRepository) { |
|
127 | 127 | return self::addLabelName($serializedObject, $labelRepository); |
128 | 128 | } |
129 | 129 | ); |
130 | 130 | |
131 | 131 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
132 | 132 | 'CultuurNet\UDB3\Label\Events\MadePrivate', |
133 | - function (array $serializedObject) use ($labelRepository) { |
|
133 | + function(array $serializedObject) use ($labelRepository) { |
|
134 | 134 | return self::addLabelName($serializedObject, $labelRepository); |
135 | 135 | } |
136 | 136 | ); |
137 | 137 | |
138 | 138 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
139 | 139 | 'CultuurNet\UDB3\Label\Events\MadePublic', |
140 | - function (array $serializedObject) use ($labelRepository) { |
|
140 | + function(array $serializedObject) use ($labelRepository) { |
|
141 | 141 | return self::addLabelName($serializedObject, $labelRepository); |
142 | 142 | } |
143 | 143 | ); |
144 | 144 | |
145 | 145 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
146 | 146 | 'CultuurNet\UDB3\Organizer\Events\LabelAdded', |
147 | - function (array $serializedObject) use ($labelRepository) { |
|
147 | + function(array $serializedObject) use ($labelRepository) { |
|
148 | 148 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
149 | 149 | } |
150 | 150 | ); |
151 | 151 | |
152 | 152 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
153 | 153 | 'CultuurNet\UDB3\Organizer\Events\LabelRemoved', |
154 | - function (array $serializedObject) use ($labelRepository) { |
|
154 | + function(array $serializedObject) use ($labelRepository) { |
|
155 | 155 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
156 | 156 | } |
157 | 157 | ); |
158 | 158 | |
159 | 159 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
160 | 160 | 'CultuurNet\UDB3\Event\Events\EventWasLabelled', |
161 | - function (array $serializedObject) { |
|
161 | + function(array $serializedObject) { |
|
162 | 162 | $serializedObject['class'] = LabelAdded::class; |
163 | 163 | |
164 | 164 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
171 | 171 | 'CultuurNet\UDB3\Event\EventWasTagged', |
172 | - function (array $serializedObject) { |
|
172 | + function(array $serializedObject) { |
|
173 | 173 | $serializedObject['class'] = LabelAdded::class; |
174 | 174 | |
175 | 175 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
184 | 184 | 'CultuurNet\UDB3\Event\TagErased', |
185 | - function (array $serializedObject) { |
|
185 | + function(array $serializedObject) { |
|
186 | 186 | $serializedObject['class'] = LabelRemoved::class; |
187 | 187 | |
188 | 188 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
197 | 197 | 'CultuurNet\UDB3\Event\Events\Unlabelled', |
198 | - function (array $serializedObject) { |
|
198 | + function(array $serializedObject) { |
|
199 | 199 | $serializedObject['class'] = LabelRemoved::class; |
200 | 200 | |
201 | 201 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
212 | 212 | 'CultuurNet\UDB3\Event\EventImportedFromUDB2', |
213 | - function (array $serializedObject) { |
|
213 | + function(array $serializedObject) { |
|
214 | 214 | $serializedObject['class'] = EventImportedFromUDB2::class; |
215 | 215 | |
216 | 216 | return $serializedObject; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
224 | 224 | 'CultuurNet\UDB3\Place\Events\FacilitiesUpdated', |
225 | - function (array $serializedObject) { |
|
225 | + function(array $serializedObject) { |
|
226 | 226 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
227 | 227 | |
228 | 228 | return $serializedObject; |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | */ |
235 | 235 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
236 | 236 | 'CultuurNet\UDB3\Place\Events\GeoCoordinatesUpdated', |
237 | - function (array $serializedObject) { |
|
237 | + function(array $serializedObject) { |
|
238 | 238 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
239 | 239 | |
240 | 240 | return $serializedObject; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | /** |
245 | 245 | * BOOKING INFO EVENT |
246 | 246 | */ |
247 | - $manipulateAvailability = function (array $serializedBookingInfo, $propertyName) { |
|
247 | + $manipulateAvailability = function(array $serializedBookingInfo, $propertyName) { |
|
248 | 248 | if (!isset($serializedBookingInfo[$propertyName]) || empty($serializedBookingInfo[$propertyName])) { |
249 | 249 | $serializedBookingInfo[$propertyName] = null; |
250 | 250 | return $serializedBookingInfo; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | return $serializedBookingInfo; |
275 | 275 | }; |
276 | 276 | |
277 | - $manipulateBookingInfoEvent = function (array $serializedEvent) use ($manipulateAvailability) { |
|
277 | + $manipulateBookingInfoEvent = function(array $serializedEvent) use ($manipulateAvailability) { |
|
278 | 278 | $serializedEvent = self::replaceEventIdWithItemId($serializedEvent); |
279 | 279 | $serializedEvent = self::replacePlaceIdWithItemId($serializedEvent); |
280 | 280 | |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | foreach ($refactoredEventEvents as $refactoredEventEvent) { |
314 | 314 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
315 | 315 | $refactoredEventEvent, |
316 | - function (array $serializedObject) { |
|
316 | + function(array $serializedObject) { |
|
317 | 317 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
318 | 318 | return $serializedObject; |
319 | 319 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | foreach ($refactoredPlaceEvents as $refactoredPlaceEvent) { |
337 | 337 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
338 | 338 | $refactoredPlaceEvent, |
339 | - function (array $serializedObject) { |
|
339 | + function(array $serializedObject) { |
|
340 | 340 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
341 | 341 | return $serializedObject; |
342 | 342 | } |
@@ -354,11 +354,11 @@ discard block |
||
354 | 354 | foreach ($priceInfoEvents as $priceInfoEvent) { |
355 | 355 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
356 | 356 | $priceInfoEvent, |
357 | - function (array $serializedObject) { |
|
357 | + function(array $serializedObject) { |
|
358 | 358 | $payload = &$serializedObject['payload']; |
359 | 359 | $priceInfo = &$payload['price_info']; |
360 | 360 | $tariffs = array_map( |
361 | - function (array $tariff) { |
|
361 | + function(array $tariff) { |
|
362 | 362 | $name = $tariff['name']; |
363 | 363 | if (is_string($name)) { |
364 | 364 | $name = ['nl' => $name]; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $document = $this->documentRepository->get($cdbid); |
39 | 39 | |
40 | 40 | if (!$document) { |
41 | - throw new EntityNotFoundException('Could not load JSON-LD document for cdbid ' . $cdbid); |
|
41 | + throw new EntityNotFoundException('Could not load JSON-LD document for cdbid '.$cdbid); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $json = $document->getBody(); |
@@ -161,7 +161,7 @@ |
||
161 | 161 | |
162 | 162 | $mainLanguageDetails = array_filter( |
163 | 163 | $details, |
164 | - function (\CultureFeed_Cdb_Data_EventDetail $detail) use ($mainLanguage) { |
|
164 | + function(\CultureFeed_Cdb_Data_EventDetail $detail) use ($mainLanguage) { |
|
165 | 165 | return $detail->getLanguage() === $mainLanguage->getCode(); |
166 | 166 | } |
167 | 167 | ); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | 'addressCountry' => $address->getCountry(), |
193 | 193 | 'addressLocality' => $address->getCity(), |
194 | 194 | 'postalCode' => $address->getZip(), |
195 | - 'streetAddress' => $address->getStreet() . ' ' . $address->getHouseNumber(), |
|
195 | + 'streetAddress' => $address->getStreet().' '.$address->getHouseNumber(), |
|
196 | 196 | ); |
197 | 197 | } |
198 | 198 | } |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | $slug = ''; |
352 | 352 | } |
353 | 353 | |
354 | - $reference = 'http://www.uitinvlaanderen.be/agenda/e/' . $slug . '/' . $event->getCdbId(); |
|
354 | + $reference = 'http://www.uitinvlaanderen.be/agenda/e/'.$slug.'/'.$event->getCdbId(); |
|
355 | 355 | |
356 | 356 | |
357 | 357 | if (!property_exists($jsonLD, 'sameAs')) { |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | */ |
370 | 370 | private function importAudience(\CultureFeed_Cdb_Item_Event $event, \stdClass $jsonLD) |
371 | 371 | { |
372 | - $eventIsPrivate = (bool) $event->isPrivate(); |
|
372 | + $eventIsPrivate = (bool)$event->isPrivate(); |
|
373 | 373 | $eventTargetsEducation = $eventIsPrivate && $event->getCategories()->hasCategory('2.1.3.0.0'); |
374 | 374 | |
375 | 375 | $audienceType = $eventTargetsEducation ? 'education' : ($eventIsPrivate ? 'members' : 'everyone'); |