@@ -105,7 +105,7 @@ |
||
105 | 105 | $this->repository->updateIndex( |
106 | 106 | $itemId, |
107 | 107 | $itemType, |
108 | - (string) $userId, |
|
108 | + (string)$userId, |
|
109 | 109 | $name, |
110 | 110 | $postalCode, |
111 | 111 | $city, |
@@ -98,26 +98,43 @@ |
||
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | + /** |
|
102 | + * @param string $eventId |
|
103 | + */ |
|
101 | 104 | private function updateEmbeddedOrganizer($eventId, $organizerJSONLD) |
102 | 105 | { |
103 | 106 | $this->updateJSONLD( |
104 | 107 | $eventId, |
108 | + |
|
109 | + /** |
|
110 | + * @param string $eventLd |
|
111 | + */ |
|
105 | 112 | function ($eventLd) use ($organizerJSONLD) { |
106 | 113 | $eventLd->organizer = $organizerJSONLD; |
107 | 114 | } |
108 | 115 | ); |
109 | 116 | } |
110 | 117 | |
118 | + /** |
|
119 | + * @param string $eventId |
|
120 | + */ |
|
111 | 121 | private function updatedEmbeddedLocation($eventId, $placeJSONLD) |
112 | 122 | { |
113 | 123 | $this->updateJSONLD( |
114 | 124 | $eventId, |
125 | + |
|
126 | + /** |
|
127 | + * @param string $eventLd |
|
128 | + */ |
|
115 | 129 | function ($eventLd) use ($placeJSONLD) { |
116 | 130 | $eventLd->location = $placeJSONLD; |
117 | 131 | } |
118 | 132 | ); |
119 | 133 | } |
120 | 134 | |
135 | + /** |
|
136 | + * @param \Closure $callback |
|
137 | + */ |
|
121 | 138 | private function updateJSONLD($eventId, $callback) |
122 | 139 | { |
123 | 140 | $document = $this->repository->get($eventId); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | { |
103 | 103 | $this->updateJSONLD( |
104 | 104 | $eventId, |
105 | - function ($eventLd) use ($organizerJSONLD) { |
|
105 | + function($eventLd) use ($organizerJSONLD) { |
|
106 | 106 | $eventLd->organizer = $organizerJSONLD; |
107 | 107 | } |
108 | 108 | ); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | { |
113 | 113 | $this->updateJSONLD( |
114 | 114 | $eventId, |
115 | - function ($eventLd) use ($placeJSONLD) { |
|
115 | + function($eventLd) use ($placeJSONLD) { |
|
116 | 116 | $eventLd->location = $placeJSONLD; |
117 | 117 | } |
118 | 118 | ); |
@@ -88,7 +88,7 @@ |
||
88 | 88 | ) |
89 | 89 | ); |
90 | 90 | |
91 | - $message = new DomainMessage( |
|
91 | + $message = new DomainMessage( |
|
92 | 92 | $this->id ?? UUID::generateAsString(), |
93 | 93 | $this->playhead ?? 1, |
94 | 94 | $finalMetaData, |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | return $createdByIdentifier; |
43 | 43 | } catch (InvalidNativeArgumentException $exception) { |
44 | 44 | $this->logger->info( |
45 | - 'The provided createdByIdentifier ' . $createdByIdentifier->toNative() . ' is not a UUID.', |
|
45 | + 'The provided createdByIdentifier '.$createdByIdentifier->toNative().' is not a UUID.', |
|
46 | 46 | [ |
47 | 47 | 'exception' => $exception, |
48 | 48 | ] |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | if (!$userId) { |
56 | 56 | $this->logger->warning( |
57 | - 'Unable to find user with identifier ' . $createdByIdentifier |
|
57 | + 'Unable to find user with identifier '.$createdByIdentifier |
|
58 | 58 | ); |
59 | 59 | } |
60 | 60 | } catch (Exception $e) { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | $name = new StringLiteral($savedSearch->name); |
75 | 75 | $query = QueryString::fromURLQueryString($savedSearch->query); |
76 | - $id = new StringLiteral((string) $savedSearch->id); |
|
76 | + $id = new StringLiteral((string)$savedSearch->id); |
|
77 | 77 | |
78 | 78 | return new SavedSearch($name, $query, $id); |
79 | 79 | } |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function write(StringLiteral $userId, StringLiteral $name, QueryString $queryString): void |
85 | 85 | { |
86 | - $userId = (string) $userId; |
|
87 | - $name = (string) $name; |
|
86 | + $userId = (string)$userId; |
|
87 | + $name = (string)$name; |
|
88 | 88 | $query = $queryString->toURLQueryString(); |
89 | 89 | |
90 | 90 | $savedSearch = new \CultureFeed_SavedSearches_SavedSearch( |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | 'error' => $exception->getMessage(), |
105 | 105 | 'userId' => $userId, |
106 | 106 | 'name' => $name, |
107 | - 'query' => (string) $queryString, |
|
107 | + 'query' => (string)$queryString, |
|
108 | 108 | ] |
109 | 109 | ); |
110 | 110 | } |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function delete(StringLiteral $userId, StringLiteral $searchId): void |
118 | 118 | { |
119 | - $userId = (string) $userId; |
|
120 | - $searchId = (string) $searchId; |
|
119 | + $userId = (string)$userId; |
|
120 | + $searchId = (string)$searchId; |
|
121 | 121 | |
122 | 122 | try { |
123 | 123 | $this->savedSearches->unsubscribe($searchId, $userId); |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | ): void { |
91 | 91 | $queryBuilder = $this->connection->createQueryBuilder() |
92 | 92 | ->delete($this->tableName->toNative()) |
93 | - ->where(SchemaConfigurator::USER . ' = ?') |
|
94 | - ->andWhere(SchemaConfigurator::ID . ' = ?') |
|
93 | + ->where(SchemaConfigurator::USER.' = ?') |
|
94 | + ->andWhere(SchemaConfigurator::ID.' = ?') |
|
95 | 95 | ->setParameters( |
96 | 96 | [ |
97 | 97 | $userId->toNative(), |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $queryBuilder = $this->connection->createQueryBuilder() |
111 | 111 | ->select('*') |
112 | 112 | ->from($this->tableName->toNative()) |
113 | - ->where(SchemaConfigurator::USER . ' = ?') |
|
113 | + ->where(SchemaConfigurator::USER.' = ?') |
|
114 | 114 | ->setParameters( |
115 | 115 | [ |
116 | 116 | $this->userId->toNative(), |
@@ -15,9 +15,9 @@ |
||
15 | 15 | |
16 | 16 | $query = implode(' OR ', $queryParts); |
17 | 17 | if (count($queryParts) > 1) { |
18 | - $query = '(' . $query . ')'; |
|
18 | + $query = '('.$query.')'; |
|
19 | 19 | } |
20 | - $query = 'createdby:' . $query; |
|
20 | + $query = 'createdby:'.$query; |
|
21 | 21 | |
22 | 22 | parent::__construct($query); |
23 | 23 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | $offerRequest = new Request( |
74 | 74 | 'GET', |
75 | - (string) $offerQuery, |
|
75 | + (string)$offerQuery, |
|
76 | 76 | $headers |
77 | 77 | ); |
78 | 78 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | $offerIds = array_reduce( |
85 | 85 | $searchResponseData->{'member'}, |
86 | - function (OfferIdentifierCollection $offerIds, $item) { |
|
86 | + function(OfferIdentifierCollection $offerIds, $item) { |
|
87 | 87 | return $offerIds->with( |
88 | 88 | $this->offerIdentifier->fromIri(Url::fromNative($item->{'@id'})) |
89 | 89 | ); |
@@ -69,21 +69,21 @@ discard block |
||
69 | 69 | |
70 | 70 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
71 | 71 | 'CultuurNet\UDB3\Event\Events\EventCreated', |
72 | - function (array $serializedObject) { |
|
72 | + function(array $serializedObject) { |
|
73 | 73 | return self::addDefaultMainLanguage($serializedObject); |
74 | 74 | } |
75 | 75 | ); |
76 | 76 | |
77 | 77 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
78 | 78 | 'CultuurNet\UDB3\Place\Events\PlaceCreated', |
79 | - function (array $serializedObject) { |
|
79 | + function(array $serializedObject) { |
|
80 | 80 | return self::addDefaultMainLanguage($serializedObject); |
81 | 81 | } |
82 | 82 | ); |
83 | 83 | |
84 | 84 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
85 | 85 | 'CultuurNet\UDB3\Organizer\Events\OrganizerCreatedWithUniqueWebsite', |
86 | - function (array $serializedObject) { |
|
86 | + function(array $serializedObject) { |
|
87 | 87 | return self::addDefaultMainLanguage($serializedObject); |
88 | 88 | } |
89 | 89 | ); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
96 | 96 | 'CultuurNet\UDB3\Event\TitleTranslated', |
97 | - function (array $serializedObject) { |
|
97 | + function(array $serializedObject) { |
|
98 | 98 | $serializedObject['class'] = TitleTranslated::class; |
99 | 99 | |
100 | 100 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
107 | 107 | 'CultuurNet\UDB3\Event\DescriptionTranslated', |
108 | - function (array $serializedObject) { |
|
108 | + function(array $serializedObject) { |
|
109 | 109 | $serializedObject['class'] = DescriptionTranslated::class; |
110 | 110 | |
111 | 111 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -120,49 +120,49 @@ discard block |
||
120 | 120 | |
121 | 121 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
122 | 122 | 'CultuurNet\UDB3\Label\Events\MadeInvisible', |
123 | - function (array $serializedObject) use ($labelRepository) { |
|
123 | + function(array $serializedObject) use ($labelRepository) { |
|
124 | 124 | return self::addLabelName($serializedObject, $labelRepository); |
125 | 125 | } |
126 | 126 | ); |
127 | 127 | |
128 | 128 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
129 | 129 | 'CultuurNet\UDB3\Label\Events\MadeVisible', |
130 | - function (array $serializedObject) use ($labelRepository) { |
|
130 | + function(array $serializedObject) use ($labelRepository) { |
|
131 | 131 | return self::addLabelName($serializedObject, $labelRepository); |
132 | 132 | } |
133 | 133 | ); |
134 | 134 | |
135 | 135 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
136 | 136 | 'CultuurNet\UDB3\Label\Events\MadePrivate', |
137 | - function (array $serializedObject) use ($labelRepository) { |
|
137 | + function(array $serializedObject) use ($labelRepository) { |
|
138 | 138 | return self::addLabelName($serializedObject, $labelRepository); |
139 | 139 | } |
140 | 140 | ); |
141 | 141 | |
142 | 142 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
143 | 143 | 'CultuurNet\UDB3\Label\Events\MadePublic', |
144 | - function (array $serializedObject) use ($labelRepository) { |
|
144 | + function(array $serializedObject) use ($labelRepository) { |
|
145 | 145 | return self::addLabelName($serializedObject, $labelRepository); |
146 | 146 | } |
147 | 147 | ); |
148 | 148 | |
149 | 149 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
150 | 150 | 'CultuurNet\UDB3\Organizer\Events\LabelAdded', |
151 | - function (array $serializedObject) use ($labelRepository) { |
|
151 | + function(array $serializedObject) use ($labelRepository) { |
|
152 | 152 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
153 | 153 | } |
154 | 154 | ); |
155 | 155 | |
156 | 156 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
157 | 157 | 'CultuurNet\UDB3\Organizer\Events\LabelRemoved', |
158 | - function (array $serializedObject) use ($labelRepository) { |
|
158 | + function(array $serializedObject) use ($labelRepository) { |
|
159 | 159 | return self::fixOrganizerLabelEvent($serializedObject, $labelRepository); |
160 | 160 | } |
161 | 161 | ); |
162 | 162 | |
163 | 163 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
164 | 164 | 'CultuurNet\UDB3\Event\Events\EventWasLabelled', |
165 | - function (array $serializedObject) { |
|
165 | + function(array $serializedObject) { |
|
166 | 166 | $serializedObject['class'] = LabelAdded::class; |
167 | 167 | |
168 | 168 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
175 | 175 | 'CultuurNet\UDB3\Event\EventWasTagged', |
176 | - function (array $serializedObject) { |
|
176 | + function(array $serializedObject) { |
|
177 | 177 | $serializedObject['class'] = LabelAdded::class; |
178 | 178 | |
179 | 179 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
188 | 188 | 'CultuurNet\UDB3\Event\TagErased', |
189 | - function (array $serializedObject) { |
|
189 | + function(array $serializedObject) { |
|
190 | 190 | $serializedObject['class'] = LabelRemoved::class; |
191 | 191 | |
192 | 192 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
201 | 201 | 'CultuurNet\UDB3\Event\Events\Unlabelled', |
202 | - function (array $serializedObject) { |
|
202 | + function(array $serializedObject) { |
|
203 | 203 | $serializedObject['class'] = LabelRemoved::class; |
204 | 204 | |
205 | 205 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
216 | 216 | 'CultuurNet\UDB3\Event\EventImportedFromUDB2', |
217 | - function (array $serializedObject) { |
|
217 | + function(array $serializedObject) { |
|
218 | 218 | $serializedObject['class'] = EventImportedFromUDB2::class; |
219 | 219 | |
220 | 220 | return $serializedObject; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
228 | 228 | 'CultuurNet\UDB3\Place\Events\FacilitiesUpdated', |
229 | - function (array $serializedObject) { |
|
229 | + function(array $serializedObject) { |
|
230 | 230 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
231 | 231 | |
232 | 232 | return $serializedObject; |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
240 | 240 | 'CultuurNet\UDB3\Place\Events\GeoCoordinatesUpdated', |
241 | - function (array $serializedObject) { |
|
241 | + function(array $serializedObject) { |
|
242 | 242 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
243 | 243 | |
244 | 244 | return $serializedObject; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | /** |
249 | 249 | * BOOKING INFO EVENT |
250 | 250 | */ |
251 | - $manipulateAvailability = function (array $serializedBookingInfo, $propertyName) { |
|
251 | + $manipulateAvailability = function(array $serializedBookingInfo, $propertyName) { |
|
252 | 252 | if (!isset($serializedBookingInfo[$propertyName]) || empty($serializedBookingInfo[$propertyName])) { |
253 | 253 | $serializedBookingInfo[$propertyName] = null; |
254 | 254 | return $serializedBookingInfo; |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | return $serializedBookingInfo; |
279 | 279 | }; |
280 | 280 | |
281 | - $manipulateUrlLabel = function (array $serializedBookingInfo) { |
|
281 | + $manipulateUrlLabel = function(array $serializedBookingInfo) { |
|
282 | 282 | if (!isset($serializedBookingInfo['urlLabel'])) { |
283 | 283 | return $serializedBookingInfo; |
284 | 284 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | return $serializedBookingInfo; |
305 | 305 | }; |
306 | 306 | |
307 | - $manipulateBookingInfoEvent = function ( |
|
307 | + $manipulateBookingInfoEvent = function( |
|
308 | 308 | array $serializedEvent |
309 | 309 | ) use ( |
310 | 310 | $manipulateAvailability, |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | foreach ($refactoredEventEvents as $refactoredEventEvent) { |
350 | 350 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
351 | 351 | $refactoredEventEvent, |
352 | - function (array $serializedObject) { |
|
352 | + function(array $serializedObject) { |
|
353 | 353 | $serializedObject = self::replaceEventIdWithItemId($serializedObject); |
354 | 354 | return $serializedObject; |
355 | 355 | } |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | foreach ($refactoredPlaceEvents as $refactoredPlaceEvent) { |
373 | 373 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
374 | 374 | $refactoredPlaceEvent, |
375 | - function (array $serializedObject) { |
|
375 | + function(array $serializedObject) { |
|
376 | 376 | $serializedObject = self::replacePlaceIdWithItemId($serializedObject); |
377 | 377 | return $serializedObject; |
378 | 378 | } |
@@ -390,11 +390,11 @@ discard block |
||
390 | 390 | foreach ($priceInfoEvents as $priceInfoEvent) { |
391 | 391 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
392 | 392 | $priceInfoEvent, |
393 | - function (array $serializedObject) { |
|
393 | + function(array $serializedObject) { |
|
394 | 394 | $payload = &$serializedObject['payload']; |
395 | 395 | $priceInfo = &$payload['price_info']; |
396 | 396 | $tariffs = array_map( |
397 | - function (array $tariff) { |
|
397 | + function(array $tariff) { |
|
398 | 398 | $name = $tariff['name']; |
399 | 399 | if (is_string($name)) { |
400 | 400 | $name = ['nl' => $name]; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | */ |
416 | 416 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
417 | 417 | 'CultuurNet\UDB3\Role\Events\ConstraintCreated', |
418 | - function (array $serializedObject) { |
|
418 | + function(array $serializedObject) { |
|
419 | 419 | $serializedObject['class'] = ConstraintAdded::class; |
420 | 420 | return self::addDefaultSapiVersion($serializedObject); |
421 | 421 | } |
@@ -423,14 +423,14 @@ discard block |
||
423 | 423 | |
424 | 424 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
425 | 425 | ConstraintUpdated::class, |
426 | - function (array $serializedObject) { |
|
426 | + function(array $serializedObject) { |
|
427 | 427 | return self::addDefaultSapiVersion($serializedObject); |
428 | 428 | } |
429 | 429 | ); |
430 | 430 | |
431 | 431 | $payloadManipulatingSerializer->manipulateEventsOfClass( |
432 | 432 | ConstraintRemoved::class, |
433 | - function (array $serializedObject) { |
|
433 | + function(array $serializedObject) { |
|
434 | 434 | return self::addDefaultSapiVersion($serializedObject); |
435 | 435 | } |
436 | 436 | ); |