Completed
Pull Request — master (#397)
by Luc
03:50
created
src/Media/Commands/UploadImage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
      */
118 118
     public function getItemId()
119 119
     {
120
-        return (string) $this->getFileId();
120
+        return (string)$this->getFileId();
121 121
     }
122 122
 
123 123
     /**
Please login to merge, or discard this patch.
src/Role/Commands/AbstractCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     public function getItemId()
37 37
     {
38
-        return (string) $this->getUuid();
38
+        return (string)$this->getUuid();
39 39
     }
40 40
 
41 41
     /**
Please login to merge, or discard this patch.
src/Event/EventThemeResolver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 
591 591
         $this->themes = array_reduce(
592 592
             $themePerType,
593
-            function ($themes, array $type) {
593
+            function($themes, array $type) {
594 594
                 if (array_key_exists('themes', $type)) {
595 595
                     foreach ($type['themes'] as $themeData) {
596 596
                         $themes[$themeData['id']] = new Theme($themeData['id'], $themeData['label']);
@@ -608,9 +608,9 @@  discard block
 block discarded – undo
608 608
      */
609 609
     public function byId(StringLiteral $themeId)
610 610
     {
611
-        if (!array_key_exists((string) $themeId, $this->themes)) {
612
-            throw new \Exception("Unknown event theme id: " . $themeId);
611
+        if (!array_key_exists((string)$themeId, $this->themes)) {
612
+            throw new \Exception("Unknown event theme id: ".$themeId);
613 613
         }
614
-        return $this->themes[(string) $themeId];
614
+        return $this->themes[(string)$themeId];
615 615
     }
616 616
 }
Please login to merge, or discard this patch.
src/Event/EventTypeResolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@
 block discarded – undo
43 43
      */
44 44
     public function byId(StringLiteral $typeId)
45 45
     {
46
-        if (!array_key_exists((string) $typeId, $this->types)) {
47
-            throw new \Exception("Unknown event type id: " . $typeId);
46
+        if (!array_key_exists((string)$typeId, $this->types)) {
47
+            throw new \Exception("Unknown event type id: ".$typeId);
48 48
         }
49
-        return $this->types[(string) $typeId];
49
+        return $this->types[(string)$typeId];
50 50
     }
51 51
 }
Please login to merge, or discard this patch.
src/Place/PlaceTypeResolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@
 block discarded – undo
41 41
      */
42 42
     public function byId(StringLiteral $typeId)
43 43
     {
44
-        if (!array_key_exists((string) $typeId, $this->types)) {
45
-            throw new \Exception("Unknown place type id: " . $typeId);
44
+        if (!array_key_exists((string)$typeId, $this->types)) {
45
+            throw new \Exception("Unknown place type id: ".$typeId);
46 46
         }
47
-        return $this->types[(string) $typeId];
47
+        return $this->types[(string)$typeId];
48 48
     }
49 49
 }
Please login to merge, or discard this patch.
src/Place/PlaceThemeResolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@
 block discarded – undo
23 23
      */
24 24
     public function byId(StringLiteral $themeId)
25 25
     {
26
-        if (!array_key_exists((string) $themeId, $this->themes)) {
27
-            throw new \Exception("Unknown place theme id: " . $themeId);
26
+        if (!array_key_exists((string)$themeId, $this->themes)) {
27
+            throw new \Exception("Unknown place theme id: ".$themeId);
28 28
         }
29
-        return $this->themes[(string) $themeId];
29
+        return $this->themes[(string)$themeId];
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
src/Offer/ReadModel/JSONLD/OfferLDProjector.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
             if (preg_match('/^apply(.+)$/', $method, $matches)) {
161 161
                 $event = $matches[1];
162
-                $classNameMethod = 'get' . $event . 'ClassName';
162
+                $classNameMethod = 'get'.$event.'ClassName';
163 163
 
164 164
                 if (method_exists($this, $classNameMethod)) {
165 165
                     $eventFullClassName = call_user_func(array($this, $classNameMethod));
@@ -344,11 +344,11 @@  discard block
 block discarded – undo
344 344
         $offerLD = $document->getBody();
345 345
 
346 346
         $oldTerms = property_exists($offerLD, 'terms') ? $offerLD->terms : [];
347
-        $newTerm = (object) $category->serialize();
347
+        $newTerm = (object)$category->serialize();
348 348
 
349 349
         $newTerms = array_filter(
350 350
             $oldTerms,
351
-            function ($term) use ($category) {
351
+            function($term) use ($category) {
352 352
                 return !property_exists($term, 'domain') || $term->domain !== $category->getDomain();
353 353
             }
354 354
         );
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
         // Remove all old facilities + get numeric keys.
376 376
         $terms = array_values(array_filter(
377 377
             $terms,
378
-            function ($term) {
378
+            function($term) {
379 379
                 return $term->domain !== Facility::DOMAIN;
380 380
             }
381 381
         ));
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels';
405 405
 
406 406
         $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : [];
407
-        $label = (string) $labelAdded->getLabel();
407
+        $label = (string)$labelAdded->getLabel();
408 408
 
409 409
         $labels[] = $label;
410 410
         $offerLd->{$labelsProperty} = array_unique($labels);
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
             if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) {
431 431
                 $offerLd->{$labelsProperty} = array_filter(
432 432
                     $offerLd->{$labelsProperty},
433
-                    function ($label) use ($labelRemoved) {
433
+                    function($label) use ($labelRemoved) {
434 434
                         return !$labelRemoved->getLabel()->equals(
435 435
                             new Label($label)
436 436
                         );
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
             return;
531 531
         }
532 532
 
533
-        $imageId = (string) $imageRemoved->getImage()->getMediaObjectId();
533
+        $imageId = (string)$imageRemoved->getImage()->getMediaObjectId();
534 534
 
535 535
         /**
536 536
          * Matches any object that is not the removed image.
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
          * @return bool
542 542
          *  Returns true when the media object does not match the image to remove.
543 543
          */
544
-        $shouldNotBeRemoved = function ($mediaObject) use ($imageId) {
544
+        $shouldNotBeRemoved = function($mediaObject) use ($imageId) {
545 545
             $containsId = !!strpos($mediaObject->{'@id'}, $imageId);
546 546
             return !$containsId;
547 547
         };
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
         $document = $this->loadDocumentFromRepository($mainImageSelected);
581 581
         $offerLd = $document->getBody();
582 582
         $imageId = $mainImageSelected->getImage()->getMediaObjectId();
583
-        $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) {
583
+        $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) {
584 584
             if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) {
585 585
                 $matchingMediaObject = $currentMediaObject;
586 586
             }
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
      */
606 606
     protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId)
607 607
     {
608
-        return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0;
608
+        return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0;
609 609
     }
610 610
 
611 611
     /**
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
         $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated);
803 803
 
804 804
         $offerLd = $document->getBody();
805
-        $offerLd->typicalAgeRange = (string) $typicalAgeRangeUpdated->getTypicalAgeRange();
805
+        $offerLd->typicalAgeRange = (string)$typicalAgeRangeUpdated->getTypicalAgeRange();
806 806
 
807 807
         return $document->withBody($offerLd);
808 808
     }
@@ -930,14 +930,14 @@  discard block
 block discarded – undo
930 930
         $images = $imagesEvent->getImages();
931 931
         $currentMediaObjects = isset($offerLd->mediaObject) ? $offerLd->mediaObject : [];
932 932
         $dutchMediaObjects = array_map(
933
-            function (Image $image) {
933
+            function(Image $image) {
934 934
                 return $this->mediaObjectSerializer->serialize($image, 'json-ld');
935 935
             },
936 936
             $images->toArray()
937 937
         );
938 938
         $translatedMediaObjects = array_filter(
939 939
             $currentMediaObjects,
940
-            function ($image) {
940
+            function($image) {
941 941
                 return $image->inLanguage !== 'nl';
942 942
             }
943 943
         );
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
         }
951 951
 
952 952
         if (isset($mainImage)) {
953
-            $offerLd->image = (string) $mainImage->getSourceLocation();
953
+            $offerLd->image = (string)$mainImage->getSourceLocation();
954 954
         }
955 955
     }
956 956
 
Please login to merge, or discard this patch.
src/Place/ReadModel/JSONLD/PlaceLDProjector.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         );
205 205
 
206 206
         $calendarJsonLD = $placeCreated->getCalendar()->toJsonLd();
207
-        $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD);
207
+        $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD);
208 208
 
209 209
         $availableTo = AvailableTo::createFromCalendar($placeCreated->getCalendar());
210 210
         $jsonLD->availableTo = (string)$availableTo;
@@ -279,8 +279,8 @@  discard block
 block discarded – undo
279 279
         $jsonLD->availableTo = (string)$availableTo;
280 280
 
281 281
         // Remove old theme and event type.
282
-        $jsonLD->terms = array_filter($jsonLD->terms, function ($term) {
283
-            return $term->domain !== EventType::DOMAIN &&  $term->domain !== Theme::DOMAIN;
282
+        $jsonLD->terms = array_filter($jsonLD->terms, function($term) {
283
+            return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN;
284 284
         });
285 285
 
286 286
         $eventType = $majorInfoUpdated->getEventType();
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
             // @replay_i18n
347 347
             // @see https://jira.uitdatabank.be/browse/III-2201
348 348
             $mainLanguageCode = $this->getMainLanguage($jsonLd)->getCode();
349
-            $jsonLd->address = (object) [
349
+            $jsonLd->address = (object)[
350 350
                 $mainLanguageCode => $jsonLd->address,
351 351
             ];
352 352
         }
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 
365 365
         $placeLd = $document->getBody();
366 366
 
367
-        $placeLd->geo = (object) [
367
+        $placeLd->geo = (object)[
368 368
             'latitude' => $geoCoordinatesUpdated->getCoordinates()->getLatitude()->toDouble(),
369 369
             'longitude' => $geoCoordinatesUpdated->getCoordinates()->getLongitude()->toDouble(),
370 370
         ];
Please login to merge, or discard this patch.
src/Address/LocalityAddressFormatter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
      */
10 10
     public function format(Address $address)
11 11
     {
12
-        return $address->getPostalCode() . ' ' .
13
-            $address->getLocality() . ', ' .
12
+        return $address->getPostalCode().' '.
13
+            $address->getLocality().', '.
14 14
             $address->getCountry()->getCode();
15 15
     }
16 16
 }
Please login to merge, or discard this patch.