@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace CultuurNet\UDB3\Media; |
4 | 4 | |
5 | 5 | use Broadway\EventSourcing\EventSourcedAggregateRoot; |
6 | -use Broadway\Serializer\SerializableInterface; |
|
7 | 6 | use CultuurNet\UDB3\JsonLdSerializableInterface; |
8 | 7 | use CultuurNet\UDB3\Media\Events\MediaObjectCreated; |
9 | 8 | use CultuurNet\UDB3\Media\Properties\MIMEType; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @file |
|
4 | - */ |
|
3 | + * @file |
|
4 | + */ |
|
5 | 5 | |
6 | 6 | namespace CultuurNet\UDB3\Variations; |
7 | 7 |
@@ -295,7 +295,7 @@ |
||
295 | 295 | $placeLd = $document->getBody(); |
296 | 296 | |
297 | 297 | $placeLd->organizer = array( |
298 | - '@type' => 'Organizer', |
|
298 | + '@type' => 'Organizer', |
|
299 | 299 | ) + (array)$this->organizerJSONLD($organizerUpdated->getOrganizerId()); |
300 | 300 | |
301 | 301 | $this->repository->save($document->withBody($placeLd)); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $jsonLD->address = $placeCreated->getAddress()->toJsonLd(); |
151 | 151 | |
152 | 152 | $calendarJsonLD = $placeCreated->getCalendar()->toJsonLd(); |
153 | - $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD); |
|
153 | + $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD); |
|
154 | 154 | |
155 | 155 | $eventType = $placeCreated->getEventType(); |
156 | 156 | $jsonLD->terms = [ |
@@ -197,11 +197,11 @@ discard block |
||
197 | 197 | $jsonLD->address = $majorInfoUpdated->getAddress()->toJsonLd(); |
198 | 198 | |
199 | 199 | $calendarJsonLD = $majorInfoUpdated->getCalendar()->toJsonLd(); |
200 | - $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD); |
|
200 | + $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD); |
|
201 | 201 | |
202 | 202 | // Remove old theme and event type. |
203 | - $jsonLD->terms = array_filter($jsonLD->terms, function ($term) { |
|
204 | - return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
203 | + $jsonLD->terms = array_filter($jsonLD->terms, function($term) { |
|
204 | + return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
205 | 205 | }); |
206 | 206 | |
207 | 207 | $eventType = $majorInfoUpdated->getEventType(); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | // Remove all old facilities + get numeric keys. |
348 | 348 | $terms = array_values(array_filter( |
349 | 349 | $terms, |
350 | - function ($term) { |
|
350 | + function($term) { |
|
351 | 351 | return $term->domain !== Facility::DOMAIN; |
352 | 352 | } |
353 | 353 | )); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | public function __construct($keyword) |
15 | 15 | { |
16 | - $keyword = (string) $keyword; |
|
16 | + $keyword = (string)$keyword; |
|
17 | 17 | |
18 | 18 | $this->filterQuery = new FilterQuery( |
19 | 19 | sprintf( |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param CalendarInterface $calendar |
69 | 69 | * @param Theme/null $theme |
70 | 70 | * |
71 | - * @return Event |
|
71 | + * @return Place |
|
72 | 72 | */ |
73 | 73 | public static function createPlace($id, Title $title, EventType $eventType, Address $address, CalendarInterface $calendar, Theme $theme = null) |
74 | 74 | { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | /** |
82 | 82 | * Apply the place created event. |
83 | - * @param PlaceCreate $placeCreated |
|
83 | + * @param PlaceCreated $placeCreated |
|
84 | 84 | */ |
85 | 85 | protected function applyPlaceCreated(PlaceCreated $placeCreated) |
86 | 86 | { |
@@ -110,6 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | /** |
112 | 112 | * Handle an update command to update organizer. |
113 | + * @param string $organizerId |
|
113 | 114 | */ |
114 | 115 | public function updateOrganizer($organizerId) |
115 | 116 | { |
@@ -220,7 +221,7 @@ discard block |
||
220 | 221 | * @param string $cdbXmlNamespaceUri |
221 | 222 | * The cdb xml namespace uri. |
222 | 223 | * |
223 | - * @return Actor |
|
224 | + * @return Place |
|
224 | 225 | * The actor. |
225 | 226 | */ |
226 | 227 | public static function importFromUDB2Actor( |
@@ -250,7 +251,7 @@ discard block |
||
250 | 251 | * @param string $cdbXmlNamespaceUri |
251 | 252 | * The cdb xml namespace uri. |
252 | 253 | * |
253 | - * @return Actor |
|
254 | + * @return Place |
|
254 | 255 | * The actor. |
255 | 256 | */ |
256 | 257 | public static function importFromUDB2Event( |
@@ -15,14 +15,12 @@ |
||
15 | 15 | use CultuurNet\UDB3\ContactPoint; |
16 | 16 | use CultuurNet\UDB3\Event\EventType; |
17 | 17 | use CultuurNet\UDB3\Media\Image; |
18 | -use CultuurNet\UDB3\Media\MediaObject; |
|
19 | 18 | use CultuurNet\UDB3\Place\Commands\UpdateImage; |
20 | 19 | use CultuurNet\UDB3\Place\Events\BookingInfoUpdated; |
21 | 20 | use CultuurNet\UDB3\Place\Events\ContactPointUpdated; |
22 | 21 | use CultuurNet\UDB3\Place\Events\DescriptionUpdated; |
23 | 22 | use CultuurNet\UDB3\Place\Events\FacilitiesUpdated; |
24 | 23 | use CultuurNet\UDB3\Place\Events\ImageAdded; |
25 | -use CultuurNet\UDB3\Place\Events\ImageDeleted; |
|
26 | 24 | use CultuurNet\UDB3\Place\Events\ImageRemoved; |
27 | 25 | use CultuurNet\UDB3\Place\Events\ImageUpdated; |
28 | 26 | use CultuurNet\UDB3\Place\Events\MajorInfoUpdated; |
@@ -3,12 +3,9 @@ |
||
3 | 3 | namespace CultuurNet\UDB3\Media\Serialization; |
4 | 4 | |
5 | 5 | use CultuurNet\UDB3\Iri\IriGeneratorInterface; |
6 | -use CultuurNet\UDB3\Media\MediaObject; |
|
7 | 6 | use CultuurNet\UDB3\Media\Properties\MIMEType; |
8 | -use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser; |
|
9 | 7 | use Symfony\Component\Serializer\Exception\UnsupportedException; |
10 | 8 | use Symfony\Component\Serializer\SerializerInterface; |
11 | -use ValueObjects\Web\Url; |
|
12 | 9 | |
13 | 10 | class MediaObjectSerializer implements SerializerInterface |
14 | 11 | { |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | $normalizedData = [ |
37 | 37 | '@id' => $this->iriGenerator->iri($mediaObject->getMediaObjectId()), |
38 | 38 | '@type' => $this->serializeMimeType($mediaObject->getMimeType()), |
39 | - 'contentUrl' => (string) $mediaObject->getSourceLocation(), |
|
40 | - 'thumbnailUrl' => (string) $mediaObject->getSourceLocation(), |
|
41 | - 'description' => (string) $mediaObject->getDescription(), |
|
42 | - 'copyrightHolder' => (string) $mediaObject->getCopyrightHolder(), |
|
39 | + 'contentUrl' => (string)$mediaObject->getSourceLocation(), |
|
40 | + 'thumbnailUrl' => (string)$mediaObject->getSourceLocation(), |
|
41 | + 'description' => (string)$mediaObject->getDescription(), |
|
42 | + 'copyrightHolder' => (string)$mediaObject->getCopyrightHolder(), |
|
43 | 43 | ]; |
44 | 44 | |
45 | 45 | return $normalizedData; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | public function serializeMimeType(MIMEType $mimeType) |
49 | 49 | { |
50 | - $typeParts = explode('/', (string) $mimeType); |
|
50 | + $typeParts = explode('/', (string)$mimeType); |
|
51 | 51 | $type = array_shift($typeParts); |
52 | 52 | |
53 | 53 | if ($type !== 'image') { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | Url::fromNative($destinationIri) |
116 | 116 | ); |
117 | 117 | |
118 | - $jobInfo = ['file_id' => (string) $uploadImage->getFileId()]; |
|
118 | + $jobInfo = ['file_id' => (string)$uploadImage->getFileId()]; |
|
119 | 119 | $this->logger->info('job_info', $jobInfo); |
120 | 120 | } |
121 | 121 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | public function get(UUID $fileId) |
126 | 126 | { |
127 | 127 | try { |
128 | - $mediaObject = $this->repository->load((string) $fileId); |
|
128 | + $mediaObject = $this->repository->load((string)$fileId); |
|
129 | 129 | } catch (AggregateNotFoundException $e) { |
130 | 130 | throw new MediaObjectNotFoundException( |
131 | 131 | sprintf("Media object with id '%s' not found", $fileId), |
@@ -109,11 +109,11 @@ |
||
109 | 109 | public function serialize() |
110 | 110 | { |
111 | 111 | return [ |
112 | - 'media_object_id' => (string) $this->getMediaObjectId(), |
|
113 | - 'mime_type' => (string) $this->getMimeType(), |
|
114 | - 'description' => (string) $this->getDescription(), |
|
115 | - 'copyright_holder' => (string) $this->getCopyrightHolder(), |
|
116 | - 'source_location' => (string) $this->getSourceLocation() |
|
112 | + 'media_object_id' => (string)$this->getMediaObjectId(), |
|
113 | + 'mime_type' => (string)$this->getMimeType(), |
|
114 | + 'description' => (string)$this->getDescription(), |
|
115 | + 'copyright_holder' => (string)$this->getCopyrightHolder(), |
|
116 | + 'source_location' => (string)$this->getSourceLocation() |
|
117 | 117 | ]; |
118 | 118 | } |
119 | 119 | } |
@@ -107,7 +107,7 @@ |
||
107 | 107 | 'mime_type' => $this->getMimeType()->toNative(), |
108 | 108 | 'description' => $this->getDescription()->toNative(), |
109 | 109 | 'copyright_holder' => $this->getCopyrightHolder()->toNative(), |
110 | - 'source_location' => (string) $this->getSourceLocation() |
|
110 | + 'source_location' => (string)$this->getSourceLocation() |
|
111 | 111 | ); |
112 | 112 | } |
113 | 113 |