@@ -37,7 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * @param \CultureFeed_SearchUsersQuery $query |
| 40 | - * @return string|null |
|
| 40 | + * @return String|null |
|
| 41 | 41 | */ |
| 42 | 42 | private function searchSingleUser(\CultureFeed_SearchUsersQuery $query) |
| 43 | 43 | { |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * @return String|null |
|
| 60 | + * @return String |
|
| 61 | 61 | */ |
| 62 | 62 | public function getSubBrand() |
| 63 | 63 | { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | - * @return String|null |
|
| 79 | + * @return String |
|
| 80 | 80 | */ |
| 81 | 81 | public function getTitle() |
| 82 | 82 | { |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * @return String|null |
|
| 98 | + * @return String |
|
| 99 | 99 | */ |
| 100 | 100 | public function getText() |
| 101 | 101 | { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
| 117 | - * @return String|null |
|
| 117 | + * @return String |
|
| 118 | 118 | */ |
| 119 | 119 | public function getCopyright() |
| 120 | 120 | { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
| 136 | - * @return String|null |
|
| 136 | + * @return String |
|
| 137 | 137 | */ |
| 138 | 138 | public function getKeyword() |
| 139 | 139 | { |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | - * @return String|null |
|
| 155 | + * @return String |
|
| 156 | 156 | */ |
| 157 | 157 | public function getArticle() |
| 158 | 158 | { |
@@ -268,15 +268,15 @@ |
||
| 268 | 268 | public function serialize() |
| 269 | 269 | { |
| 270 | 270 | $data = [ |
| 271 | - 'subBrand' => (string) $this->subBrand, |
|
| 272 | - 'plainText' => (string) $this->plainText, |
|
| 273 | - 'title' => (string) $this->title, |
|
| 274 | - 'text' => (string) $this->text, |
|
| 275 | - 'copyright' => (string) $this->copyright, |
|
| 276 | - 'keyword' => (string) $this->keyword, |
|
| 277 | - 'image' => (string) $this->image, |
|
| 278 | - 'article' => (string) $this->article, |
|
| 279 | - 'link' => (string) $this->link, |
|
| 271 | + 'subBrand' => (string)$this->subBrand, |
|
| 272 | + 'plainText' => (string)$this->plainText, |
|
| 273 | + 'title' => (string)$this->title, |
|
| 274 | + 'text' => (string)$this->text, |
|
| 275 | + 'copyright' => (string)$this->copyright, |
|
| 276 | + 'keyword' => (string)$this->keyword, |
|
| 277 | + 'image' => (string)$this->image, |
|
| 278 | + 'article' => (string)$this->article, |
|
| 279 | + 'link' => (string)$this->link, |
|
| 280 | 280 | ]; |
| 281 | 281 | |
| 282 | 282 | return array_filter($data, 'strlen'); |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | public function serialize() |
| 87 | 87 | { |
| 88 | 88 | $serialized = array( |
| 89 | - 'eventId' => (string) $this->eventId, |
|
| 89 | + 'eventId' => (string)$this->eventId, |
|
| 90 | 90 | 'language' => $this->language->getCode(), |
| 91 | 91 | 'collaborationData' => $this->collaborationData->serialize(), |
| 92 | 92 | ); |
@@ -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; |
@@ -164,7 +164,7 @@ |
||
| 164 | 164 | |
| 165 | 165 | /** |
| 166 | 166 | * @param \CultureFeed_Cdb_Item_Event $event |
| 167 | - * @param $jsonLD |
|
| 167 | + * @param \stdClass $jsonLD |
|
| 168 | 168 | */ |
| 169 | 169 | private function importLabels(\CultureFeed_Cdb_Item_Event $event, $jsonLD) |
| 170 | 170 | { |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | private function dateFromUdb2UnixTime($unixTime) |
| 135 | 135 | { |
| 136 | 136 | $dateTime = new \DateTime( |
| 137 | - '@' . $unixTime, |
|
| 137 | + '@'.$unixTime, |
|
| 138 | 138 | new \DateTimeZone('Europe/Brussels') |
| 139 | 139 | ); |
| 140 | 140 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | $labels = array_filter( |
| 172 | 172 | array_values($event->getKeywords()), |
| 173 | - function ($keyword) { |
|
| 173 | + function($keyword) { |
|
| 174 | 174 | return (strlen(trim($keyword)) > 0); |
| 175 | 175 | } |
| 176 | 176 | ); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | 'addressLocality' => $address->getCity(), |
| 228 | 228 | 'postalCode' => $address->getZip(), |
| 229 | 229 | 'streetAddress' => |
| 230 | - $address->getStreet() . ' ' . $address->getHouseNumber( |
|
| 230 | + $address->getStreet().' '.$address->getHouseNumber( |
|
| 231 | 231 | ), |
| 232 | 232 | ); |
| 233 | 233 | } |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | $calendarType = 'periodic'; |
| 415 | 415 | $calendar->rewind(); |
| 416 | 416 | $firstCalendarItem = $calendar->current(); |
| 417 | - $startDateString = $firstCalendarItem->getDateFrom() . 'T00:00:00'; |
|
| 417 | + $startDateString = $firstCalendarItem->getDateFrom().'T00:00:00'; |
|
| 418 | 418 | $startDate = DateTimeFactory::dateTimeFromDateString($startDateString); |
| 419 | 419 | |
| 420 | 420 | if (iterator_count($calendar) > 1) { |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | $lastCalendarItem = $firstCalendarItem; |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | - $endDateString = $lastCalendarItem->getDateTo() . 'T00:00:00'; |
|
| 427 | + $endDateString = $lastCalendarItem->getDateTo().'T00:00:00'; |
|
| 428 | 428 | $endDate = DateTimeFactory::dateTimeFromDateString($endDateString); |
| 429 | 429 | |
| 430 | 430 | $jsonLD->startDate = $startDate->format('c'); |
@@ -436,9 +436,9 @@ discard block |
||
| 436 | 436 | $firstCalendarItem = $calendar->current(); |
| 437 | 437 | if ($firstCalendarItem->getStartTime()) { |
| 438 | 438 | $dateString = |
| 439 | - $firstCalendarItem->getDate() . 'T' . $firstCalendarItem->getStartTime(); |
|
| 439 | + $firstCalendarItem->getDate().'T'.$firstCalendarItem->getStartTime(); |
|
| 440 | 440 | } else { |
| 441 | - $dateString = $firstCalendarItem->getDate() . 'T00:00:00'; |
|
| 441 | + $dateString = $firstCalendarItem->getDate().'T00:00:00'; |
|
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | $startDate = DateTimeFactory::dateTimeFromDateString($dateString); |
@@ -453,10 +453,10 @@ discard block |
||
| 453 | 453 | $endDateString = null; |
| 454 | 454 | if ($lastCalendarItem->getEndTime()) { |
| 455 | 455 | $endDateString = |
| 456 | - $lastCalendarItem->getDate() . 'T' . $lastCalendarItem->getEndTime(); |
|
| 456 | + $lastCalendarItem->getDate().'T'.$lastCalendarItem->getEndTime(); |
|
| 457 | 457 | } else { |
| 458 | 458 | if (iterator_count($calendar) > 1) { |
| 459 | - $endDateString = $lastCalendarItem->getDate() . 'T00:00:00'; |
|
| 459 | + $endDateString = $lastCalendarItem->getDate().'T00:00:00'; |
|
| 460 | 460 | } |
| 461 | 461 | } |
| 462 | 462 | |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | $slug = ''; |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | - $reference = 'http://www.uitinvlaanderen.be/agenda/e/' . $slug . '/' . $event->getCdbId(); |
|
| 573 | + $reference = 'http://www.uitinvlaanderen.be/agenda/e/'.$slug.'/'.$event->getCdbId(); |
|
| 574 | 574 | |
| 575 | 575 | |
| 576 | 576 | if (!property_exists($jsonLD, 'sameAs')) { |
@@ -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( |
@@ -110,8 +110,8 @@ |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
| 113 | - * @param EventUpdatedFromCdbXml $eventUpdatedFromCdbXml |
|
| 114 | - */ |
|
| 113 | + * @param EventUpdatedFromCdbXml $eventUpdatedFromCdbXml |
|
| 114 | + */ |
|
| 115 | 115 | protected function applyEventUpdatedFromCdbXml(EventUpdatedFromCdbXml $eventUpdatedFromCdbXml) |
| 116 | 116 | { |
| 117 | 117 | $eventId = $eventUpdatedFromCdbXml->getEventId(); |
@@ -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') { |
@@ -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 | } |