@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use CultuurNet\UDB3\Variations\Model\Properties\Description; |
| 10 | 10 | use CultuurNet\UDB3\Variations\Model\Properties\Id; |
| 11 | 11 | use JsonSchema\Validator; |
| 12 | -use ValueObjects\String\String; |
|
| 13 | 12 | use stdClass; |
| 14 | 13 | |
| 15 | 14 | class EditDescriptionJSONDeserializer extends JSONDeserializer |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public static function calendar(Calendar $calendar) |
| 25 | 25 | { |
| 26 | - $offerCalenderUpdate = function ($body) use ($calendar) { |
|
| 26 | + $offerCalenderUpdate = function($body) use ($calendar) { |
|
| 27 | 27 | // Purge any existing calendar data |
| 28 | 28 | unset( |
| 29 | 29 | $body->calendarType, |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | $body->openingHours |
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | - return (object) array_merge( |
|
| 37 | - (array) $body, |
|
| 36 | + return (object)array_merge( |
|
| 37 | + (array)$body, |
|
| 38 | 38 | $calendar->toJsonLd() |
| 39 | 39 | ); |
| 40 | 40 | }; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $jsonLD->address = $placeCreated->getAddress()->toJsonLd(); |
| 161 | 161 | |
| 162 | 162 | $calendarJsonLD = $placeCreated->getCalendar()->toJsonLd(); |
| 163 | - $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD); |
|
| 163 | + $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD); |
|
| 164 | 164 | |
| 165 | 165 | $eventType = $placeCreated->getEventType(); |
| 166 | 166 | $jsonLD->terms = [ |
@@ -214,8 +214,8 @@ discard block |
||
| 214 | 214 | $jsonLD->address = $majorInfoUpdated->getAddress()->toJsonLd(); |
| 215 | 215 | |
| 216 | 216 | // Remove old theme and event type. |
| 217 | - $jsonLD->terms = array_filter($jsonLD->terms, function ($term) { |
|
| 218 | - return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
| 217 | + $jsonLD->terms = array_filter($jsonLD->terms, function($term) { |
|
| 218 | + return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
| 219 | 219 | }); |
| 220 | 220 | |
| 221 | 221 | $eventType = $majorInfoUpdated->getEventType(); |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | // Remove all old facilities + get numeric keys. |
| 362 | 362 | $terms = array_values(array_filter( |
| 363 | 363 | $terms, |
| 364 | - function ($term) { |
|
| 364 | + function($term) { |
|
| 365 | 365 | return $term->domain !== Facility::DOMAIN; |
| 366 | 366 | } |
| 367 | 367 | )); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * @param array $data |
| 51 | - * @return mixed The object instance |
|
| 51 | + * @return AbstractImageEvent The object instance |
|
| 52 | 52 | */ |
| 53 | 53 | public static function deserialize(array $data) |
| 54 | 54 | { |
@@ -79,10 +79,10 @@ |
||
| 79 | 79 | */ |
| 80 | 80 | public function serialize() |
| 81 | 81 | { |
| 82 | - return parent::serialize() + array( |
|
| 83 | - 'media_object_id' => (string) $this->mediaObjectId, |
|
| 84 | - 'description' => (string) $this->description, |
|
| 85 | - 'copyright_holder' => (string) $this->copyrightHolder |
|
| 82 | + return parent::serialize() + array( |
|
| 83 | + 'media_object_id' => (string)$this->mediaObjectId, |
|
| 84 | + 'description' => (string)$this->description, |
|
| 85 | + 'copyright_holder' => (string)$this->copyrightHolder |
|
| 86 | 86 | ); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -462,7 +462,7 @@ |
||
| 462 | 462 | { |
| 463 | 463 | $duplicateMediaObject = array_filter( |
| 464 | 464 | $this->getMediaObjects(), |
| 465 | - function ($existingMediaObjectId) use ($image) { |
|
| 465 | + function($existingMediaObjectId) use ($image) { |
|
| 466 | 466 | return $image |
| 467 | 467 | ->getMediaObjectId() |
| 468 | 468 | ->sameValueAs($existingMediaObjectId); |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace CultuurNet\UDB3\Offer\ReadModel\JSONLD; |
| 4 | 4 | |
| 5 | 5 | use Broadway\Domain\DomainMessage; |
| 6 | -use CultuurNet\UDB3\Calendar; |
|
| 7 | 6 | use CultuurNet\UDB3\CulturefeedSlugger; |
| 8 | 7 | use CultuurNet\UDB3\EntityServiceInterface; |
| 9 | 8 | use CultuurNet\UDB3\Event\ReadModel\DocumentRepositoryInterface; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | if (preg_match('/^apply(.+)$/', $method, $matches)) { |
| 120 | 120 | $event = $matches[1]; |
| 121 | - $classNameMethod = 'get' . $event . 'ClassName'; |
|
| 121 | + $classNameMethod = 'get'.$event.'ClassName'; |
|
| 122 | 122 | |
| 123 | 123 | if (method_exists($this, $classNameMethod)) { |
| 124 | 124 | $eventFullClassName = call_user_func(array($this, $classNameMethod)); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $offerLd = $document->getBody(); |
| 191 | 191 | |
| 192 | 192 | $labels = isset($offerLd->labels) ? $offerLd->labels : []; |
| 193 | - $label = (string) $labelAdded->getLabel(); |
|
| 193 | + $label = (string)$labelAdded->getLabel(); |
|
| 194 | 194 | |
| 195 | 195 | $labels[] = $label; |
| 196 | 196 | $offerLd->labels = array_unique($labels); |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | if (isset($offerLd->labels) && is_array($offerLd->labels)) { |
| 211 | 211 | $offerLd->labels = array_filter( |
| 212 | 212 | $offerLd->labels, |
| 213 | - function ($label) use ($deleteLabel) { |
|
| 213 | + function($label) use ($deleteLabel) { |
|
| 214 | 214 | return !$deleteLabel->getLabel()->equals( |
| 215 | 215 | new Label($label) |
| 216 | 216 | ); |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | return; |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | - $imageId = (string) $imageRemoved->getImage()->getMediaObjectId(); |
|
| 304 | + $imageId = (string)$imageRemoved->getImage()->getMediaObjectId(); |
|
| 305 | 305 | |
| 306 | 306 | /** |
| 307 | 307 | * Matches any object that is not the removed image. |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | * @return bool |
| 313 | 313 | * Returns true when the media object does not match the image to remove. |
| 314 | 314 | */ |
| 315 | - $shouldNotBeRemoved = function ($mediaObject) use ($imageId) { |
|
| 315 | + $shouldNotBeRemoved = function($mediaObject) use ($imageId) { |
|
| 316 | 316 | $containsId = !!strpos($mediaObject->{'@id'}, $imageId); |
| 317 | 317 | return !$containsId; |
| 318 | 318 | }; |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | $document = $this->loadDocumentFromRepository($mainImageSelected); |
| 351 | 351 | $offerLd = $document->getBody(); |
| 352 | 352 | $imageId = $mainImageSelected->getImage()->getMediaObjectId(); |
| 353 | - $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
| 353 | + $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
| 354 | 354 | if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) { |
| 355 | 355 | $matchingMediaObject = $currentMediaObject; |
| 356 | 356 | } |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | */ |
| 376 | 376 | protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId) |
| 377 | 377 | { |
| 378 | - return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0; |
|
| 378 | + return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0; |
|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | /** |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | * @param string $id |
| 37 | 37 | * A string uniquely identifying an event. |
| 38 | 38 | * |
| 39 | - * @return array |
|
| 39 | + * @return string |
|
| 40 | 40 | * An event array. |
| 41 | 41 | * |
| 42 | 42 | * @throws EventNotFoundException if an event can not be found for the given id |
@@ -4,7 +4,6 @@ discard block |
||
| 4 | 4 | namespace CultuurNet\UDB3\Event; |
| 5 | 5 | |
| 6 | 6 | use Broadway\Repository\RepositoryInterface; |
| 7 | -use CultuurNet\UDB3\CommandHandling\Udb3CommandHandler; |
|
| 8 | 7 | use CultuurNet\UDB3\Event\Commands\AddImage; |
| 9 | 8 | use CultuurNet\UDB3\Event\Commands\AddLabel; |
| 10 | 9 | use CultuurNet\UDB3\Event\Commands\DeleteEvent; |
@@ -12,8 +11,6 @@ discard block |
||
| 12 | 11 | use CultuurNet\UDB3\Event\Commands\RemoveImage; |
| 13 | 12 | use CultuurNet\UDB3\Event\Commands\DeleteOrganizer; |
| 14 | 13 | use CultuurNet\UDB3\Event\Commands\DeleteTypicalAgeRange; |
| 15 | -use CultuurNet\UDB3\Event\Commands\LabelEvents; |
|
| 16 | -use CultuurNet\UDB3\Event\Commands\LabelQuery; |
|
| 17 | 14 | use CultuurNet\UDB3\Event\Commands\SelectMainImage; |
| 18 | 15 | use CultuurNet\UDB3\Event\Commands\TranslateDescription; |
| 19 | 16 | use CultuurNet\UDB3\Event\Commands\TranslateTitle; |
@@ -24,8 +21,6 @@ discard block |
||
| 24 | 21 | use CultuurNet\UDB3\Event\Commands\UpdateMajorInfo; |
| 25 | 22 | use CultuurNet\UDB3\Event\Commands\UpdateOrganizer; |
| 26 | 23 | use CultuurNet\UDB3\Event\Commands\UpdateTypicalAgeRange; |
| 27 | -use CultuurNet\UDB3\Event\Events\MainImageSelected; |
|
| 28 | -use CultuurNet\UDB3\Label as Label; |
|
| 29 | 24 | use CultuurNet\UDB3\Offer\OfferCommandHandler; |
| 30 | 25 | use CultuurNet\UDB3\Search\SearchServiceInterface; |
| 31 | 26 | use Psr\Log\LoggerAwareInterface; |