Completed
Pull Request — master (#340)
by Luc
05:42
created
src/Event/ReadModel/JSONLD/EventLDProjector.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -512,8 +512,8 @@  discard block
 block discarded – undo
512 512
         $eventJsonLD->{'@id'} = $this->iriGenerator->iri($eventCopied->getItemId());
513 513
 
514 514
         // Set the new calendar.
515
-        $eventJsonLD = (object) array_merge(
516
-            (array) $eventJsonLD,
515
+        $eventJsonLD = (object)array_merge(
516
+            (array)$eventJsonLD,
517 517
             $eventCopied->getCalendar()->toJsonLd()
518 518
         );
519 519
 
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 
527 527
         // Set available to and from.
528 528
         $availableTo = AvailableTo::createFromCalendar($eventCopied->getCalendar());
529
-        $eventJsonLD->availableTo = (string) $availableTo;
529
+        $eventJsonLD->availableTo = (string)$availableTo;
530 530
         unset($eventJsonLD->availableFrom);
531 531
 
532 532
         $newDocument = new JsonDocument($eventCopied->getItemId());
@@ -566,8 +566,8 @@  discard block
 block discarded – undo
566 566
         $jsonLD->availableTo = (string)$availableTo;
567 567
 
568 568
         // Remove old theme and event type.
569
-        $jsonLD->terms = array_filter($jsonLD->terms, function ($term) {
570
-            return $term->domain !== EventType::DOMAIN &&  $term->domain !== Theme::DOMAIN;
569
+        $jsonLD->terms = array_filter($jsonLD->terms, function($term) {
570
+            return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN;
571 571
         });
572 572
         $jsonLD->terms = array_values($jsonLD->terms);
573 573
 
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 
596 596
         $jsonLD->location = [
597 597
             '@type' => 'Place',
598
-         ] + (array) $this->placeJSONLD($locationUpdated->getLocationId()->toNative());
598
+         ] + (array)$this->placeJSONLD($locationUpdated->getLocationId()->toNative());
599 599
 
600 600
         return $document->withBody($jsonLD);
601 601
     }
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
     {
647 647
         $eventSlug = $this->slugger->slug($name);
648 648
         return array(
649
-            'http://www.uitinvlaanderen.be/agenda/e/' . $eventSlug . '/' . $eventId,
649
+            'http://www.uitinvlaanderen.be/agenda/e/'.$eventSlug.'/'.$eventId,
650 650
         );
651 651
     }
652 652
 
Please login to merge, or discard this patch.
src/Place/ReadModel/JSONLD/PlaceLDProjector.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         );
209 209
 
210 210
         $calendarJsonLD = $placeCreated->getCalendar()->toJsonLd();
211
-        $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD);
211
+        $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD);
212 212
 
213 213
         $availableTo = AvailableTo::createFromCalendar($placeCreated->getCalendar());
214 214
         $jsonLD->availableTo = (string)$availableTo;
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
         $jsonLD->availableTo = (string)$availableTo;
284 284
 
285 285
         // Remove old theme and event type.
286
-        $jsonLD->terms = array_filter($jsonLD->terms, function ($term) {
287
-            return $term->domain !== EventType::DOMAIN &&  $term->domain !== Theme::DOMAIN;
286
+        $jsonLD->terms = array_filter($jsonLD->terms, function($term) {
287
+            return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN;
288 288
         });
289 289
 
290 290
         $eventType = $majorInfoUpdated->getEventType();
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
             // @replay_i18n
351 351
             // @see https://jira.uitdatabank.be/browse/III-2201
352 352
             $mainLanguageCode = $this->getMainLanguage($jsonLd)->getCode();
353
-            $jsonLd->address = (object) [
353
+            $jsonLd->address = (object)[
354 354
                 $mainLanguageCode => $jsonLd->address,
355 355
             ];
356 356
         }
Please login to merge, or discard this patch.
src/Offer/ReadModel/JSONLD/OfferLDProjector.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
             if (preg_match('/^apply(.+)$/', $method, $matches)) {
178 178
                 $event = $matches[1];
179
-                $classNameMethod = 'get' . $event . 'ClassName';
179
+                $classNameMethod = 'get'.$event.'ClassName';
180 180
 
181 181
                 if (method_exists($this, $classNameMethod)) {
182 182
                     $eventFullClassName = call_user_func(array($this, $classNameMethod));
@@ -366,11 +366,11 @@  discard block
 block discarded – undo
366 366
         $offerLD = $document->getBody();
367 367
 
368 368
         $oldTerms = property_exists($offerLD, 'terms') ? $offerLD->terms : [];
369
-        $newTerm = (object) $category->serialize();
369
+        $newTerm = (object)$category->serialize();
370 370
 
371 371
         $newTerms = array_filter(
372 372
             $oldTerms,
373
-            function ($term) use ($category) {
373
+            function($term) use ($category) {
374 374
                 return !property_exists($term, 'domain') || $term->domain !== $category->getDomain();
375 375
             }
376 376
         );
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
         // Remove all old facilities + get numeric keys.
398 398
         $terms = array_values(array_filter(
399 399
             $terms,
400
-            function ($term) {
400
+            function($term) {
401 401
                 return $term->domain !== Facility::DOMAIN;
402 402
             }
403 403
         ));
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
         $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels';
427 427
 
428 428
         $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : [];
429
-        $label = (string) $labelAdded->getLabel();
429
+        $label = (string)$labelAdded->getLabel();
430 430
 
431 431
         $labels[] = $label;
432 432
         $offerLd->{$labelsProperty} = array_unique($labels);
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
             if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) {
453 453
                 $offerLd->{$labelsProperty} = array_filter(
454 454
                     $offerLd->{$labelsProperty},
455
-                    function ($label) use ($labelRemoved) {
455
+                    function($label) use ($labelRemoved) {
456 456
                         return !$labelRemoved->getLabel()->equals(
457 457
                             new Label($label)
458 458
                         );
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
             return;
553 553
         }
554 554
 
555
-        $imageId = (string) $imageRemoved->getImage()->getMediaObjectId();
555
+        $imageId = (string)$imageRemoved->getImage()->getMediaObjectId();
556 556
 
557 557
         /**
558 558
          * Matches any object that is not the removed image.
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
          * @return bool
564 564
          *  Returns true when the media object does not match the image to remove.
565 565
          */
566
-        $shouldNotBeRemoved = function ($mediaObject) use ($imageId) {
566
+        $shouldNotBeRemoved = function($mediaObject) use ($imageId) {
567 567
             $containsId = !!strpos($mediaObject->{'@id'}, $imageId);
568 568
             return !$containsId;
569 569
         };
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
         $document = $this->loadDocumentFromRepository($mainImageSelected);
603 603
         $offerLd = $document->getBody();
604 604
         $imageId = $mainImageSelected->getImage()->getMediaObjectId();
605
-        $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) {
605
+        $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) {
606 606
             if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) {
607 607
                 $matchingMediaObject = $currentMediaObject;
608 608
             }
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
      */
628 628
     protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId)
629 629
     {
630
-        return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0;
630
+        return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0;
631 631
     }
632 632
 
633 633
     /**
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
 
805 805
         $placeLd = $document->getBody();
806 806
 
807
-        $placeLd->geo = (object) [
807
+        $placeLd->geo = (object)[
808 808
             'latitude' => $geoCoordinatesUpdated->getCoordinates()->getLatitude()->toDouble(),
809 809
             'longitude' => $geoCoordinatesUpdated->getCoordinates()->getLongitude()->toDouble(),
810 810
         ];
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
         $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated);
843 843
 
844 844
         $offerLd = $document->getBody();
845
-        $offerLd->typicalAgeRange = (string) $typicalAgeRangeUpdated->getTypicalAgeRange();
845
+        $offerLd->typicalAgeRange = (string)$typicalAgeRangeUpdated->getTypicalAgeRange();
846 846
 
847 847
         return $document->withBody($offerLd);
848 848
     }
@@ -970,14 +970,14 @@  discard block
 block discarded – undo
970 970
         $images = $imagesEvent->getImages();
971 971
         $currentMediaObjects = isset($offerLd->mediaObject) ? $offerLd->mediaObject : [];
972 972
         $dutchMediaObjects = array_map(
973
-            function (Image $image) {
973
+            function(Image $image) {
974 974
                 return $this->mediaObjectSerializer->serialize($image, 'json-ld');
975 975
             },
976 976
             $images->toArray()
977 977
         );
978 978
         $translatedMediaObjects = array_filter(
979 979
             $currentMediaObjects,
980
-            function ($image) {
980
+            function($image) {
981 981
                 return $image->inLanguage !== 'nl';
982 982
             }
983 983
         );
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
         }
991 991
 
992 992
         if (isset($mainImage)) {
993
-            $offerLd->image = (string) $mainImage->getSourceLocation();
993
+            $offerLd->image = (string)$mainImage->getSourceLocation();
994 994
         }
995 995
     }
996 996
 
Please login to merge, or discard this patch.