Completed
Pull Request — master (#454)
by Jonas
05:45 queued 02:11
created
src/Event/IncompatibleAudienceType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,6 +9,6 @@
 block discarded – undo
9 9
 {
10 10
     public static function forEvent(string $eventId, AudienceType $audienceType)
11 11
     {
12
-        return new self('Audience type ' . $audienceType->toNative() . ' is incompatible with event ' . $eventId);
12
+        return new self('Audience type '.$audienceType->toNative().' is incompatible with event '.$eventId);
13 13
     }
14 14
 }
Please login to merge, or discard this patch.
src/Place/ReadModel/JSONLD/PlaceLDProjector.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         );
213 213
 
214 214
         $calendarJsonLD = $placeCreated->getCalendar()->toJsonLd();
215
-        $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD);
215
+        $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD);
216 216
 
217 217
         $availableTo = AvailableTo::createFromCalendar($placeCreated->getCalendar());
218 218
         $jsonLD->availableTo = (string)$availableTo;
@@ -285,8 +285,8 @@  discard block
 block discarded – undo
285 285
         $jsonLD->availableTo = (string)$availableTo;
286 286
 
287 287
         // Remove old theme and event type.
288
-        $jsonLD->terms = array_filter($jsonLD->terms, function ($term) {
289
-            return $term->domain !== EventType::DOMAIN &&  $term->domain !== Theme::DOMAIN;
288
+        $jsonLD->terms = array_filter($jsonLD->terms, function($term) {
289
+            return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN;
290 290
         });
291 291
 
292 292
         $eventType = $majorInfoUpdated->getEventType();
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
             // @replay_i18n
353 353
             // @see https://jira.uitdatabank.be/browse/III-2201
354 354
             $mainLanguageCode = $this->getMainLanguage($jsonLd)->getCode();
355
-            $jsonLd->address = (object) [
355
+            $jsonLd->address = (object)[
356 356
                 $mainLanguageCode => $jsonLd->address,
357 357
             ];
358 358
         }
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 
371 371
         $placeLd = $document->getBody();
372 372
 
373
-        $placeLd->geo = (object) [
373
+        $placeLd->geo = (object)[
374 374
             'latitude' => $geoCoordinatesUpdated->getCoordinates()->getLatitude()->toDouble(),
375 375
             'longitude' => $geoCoordinatesUpdated->getCoordinates()->getLongitude()->toDouble(),
376 376
         ];
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
     {
383 383
         $document = $this->loadPlaceDocumentFromRepositoryById($markedAsDuplicate->getPlaceId());
384 384
 
385
-        return $document->apply(function ($placeLd) use ($markedAsDuplicate) {
385
+        return $document->apply(function($placeLd) use ($markedAsDuplicate) {
386 386
             $placeLd->duplicateOf = $this->iriGenerator->iri($markedAsDuplicate->getDuplicateOf());
387 387
             return $placeLd;
388 388
         });
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
     {
393 393
         $document = $this->loadPlaceDocumentFromRepositoryById($markedAsCanonical->getPlaceId());
394 394
 
395
-        return $document->apply(function ($placeLd) use ($markedAsCanonical) {
395
+        return $document->apply(function($placeLd) use ($markedAsCanonical) {
396 396
             $placeLd->duplicatedBy[] = $this->iriGenerator->iri($markedAsCanonical->getDuplicatedBy());
397 397
             foreach ($markedAsCanonical->getDuplicatesOfDuplicate() as $duplicateOfDuplicate) {
398 398
                 $placeLd->duplicatedBy[] = $this->iriGenerator->iri($duplicateOfDuplicate);
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
@@ -40,9 +40,9 @@
 block discarded – undo
40 40
 
41 41
     public function byId(StringLiteral $typeId): EventType
42 42
     {
43
-        if (!array_key_exists((string) $typeId, $this->types)) {
44
-            throw new Exception("Unknown place type id: " . $typeId);
43
+        if (!array_key_exists((string)$typeId, $this->types)) {
44
+            throw new Exception("Unknown place type id: ".$typeId);
45 45
         }
46
-        return $this->types[(string) $typeId];
46
+        return $this->types[(string)$typeId];
47 47
     }
48 48
 }
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
@@ -42,9 +42,9 @@
 block discarded – undo
42 42
 
43 43
     public function byId(StringLiteral $typeId): EventType
44 44
     {
45
-        if (!array_key_exists((string) $typeId, $this->types)) {
46
-            throw new Exception("Unknown event type id: " . $typeId);
45
+        if (!array_key_exists((string)$typeId, $this->types)) {
46
+            throw new Exception("Unknown event type id: ".$typeId);
47 47
         }
48
-        return $this->types[(string) $typeId];
48
+        return $this->types[(string)$typeId];
49 49
     }
50 50
 }
Please login to merge, or discard this patch.
src/Place/CannotMarkPlaceAsDuplicate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
8 8
 {
9 9
     public static function becauseItIsDeleted(string $placeId): self
10 10
     {
11
-        return new static('Cannot mark place ' . $placeId . ' as duplicate because it is deleted');
11
+        return new static('Cannot mark place '.$placeId.' as duplicate because it is deleted');
12 12
     }
13 13
 
14 14
     public static function becauseItIsAlreadyADuplicate(string $placeId): self
15 15
     {
16
-        return new static('Cannot mark place ' . $placeId . ' as duplicate because it is already a duplicate');
16
+        return new static('Cannot mark place '.$placeId.' as duplicate because it is already a duplicate');
17 17
     }
18 18
 }
Please login to merge, or discard this patch.
src/Place/CannotMarkPlaceAsCanonical.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
8 8
 {
9 9
     public static function becauseItIsDeleted(string $placeId): self
10 10
     {
11
-        return new static('Cannot mark place ' . $placeId . ' as canonical because it is deleted');
11
+        return new static('Cannot mark place '.$placeId.' as canonical because it is deleted');
12 12
     }
13 13
 
14 14
     public static function becauseItIsAlreadyADuplicate(string $placeId): self
15 15
     {
16
-        return new static('Cannot mark place ' . $placeId . ' as canonical because it is a duplicate');
16
+        return new static('Cannot mark place '.$placeId.' as canonical because it is a duplicate');
17 17
     }
18 18
 }
Please login to merge, or discard this patch.
src/Offer/Offer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         $sameFacilities = array_uintersect(
222 222
             $facilities1,
223 223
             $facilities2,
224
-            function (Facility $facility1, Facility $facility2) {
224
+            function(Facility $facility1, Facility $facility2) {
225 225
                 return strcmp($facility1->getId(), $facility2->getId());
226 226
             }
227 227
         );
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
      */
271 271
     public function importLabels(Labels $labels, Labels $labelsToKeepIfAlreadyOnOffer, Labels $labelsToRemoveWhenOnOffer)
272 272
     {
273
-        $convertLabelClass = function (\CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label $label) {
273
+        $convertLabelClass = function(\CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label $label) {
274 274
             return new Label(
275 275
                 $label->getName()->toString(),
276 276
                 $label->isVisible()
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
         foreach ($addedLabels->asArray() as $addedLabel) {
307 307
             $importLabels = $importLabels->with(
308 308
                 new \CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label(
309
-                    new LabelName((string) $addedLabel),
309
+                    new LabelName((string)$addedLabel),
310 310
                     $addedLabel->isVisible()
311 311
                 )
312 312
             );
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
         $importImages = $imageCollection->toArray();
708 708
         $currentImages = $currentImageCollection->toArray();
709 709
 
710
-        $compareImages = function (Image $a, Image $b) {
710
+        $compareImages = function(Image $a, Image $b) {
711 711
             $idA = $a->getMediaObjectId()->toNative();
712 712
             $idB = $b->getMediaObjectId()->toNative();
713 713
             return strcmp($idA, $idB);
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
             if ($this->rejectedReason && $reason->sameValueAs($this->rejectedReason)) {
855 855
                 return true; // nothing left to do if the offer has already been rejected for the same reason
856 856
             } else {
857
-                throw new Exception('The offer has already been rejected for another reason: ' . $this->rejectedReason);
857
+                throw new Exception('The offer has already been rejected for another reason: '.$this->rejectedReason);
858 858
             }
859 859
         }
860 860
 
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
         $dutchImagesList = $imagesEvent->getImages()->toArray();
1033 1033
         $translatedImagesList = array_filter(
1034 1034
             $this->images->toArray(),
1035
-            function (Image $image) {
1035
+            function(Image $image) {
1036 1036
                 return $image->getLanguage()->getCode() !== 'nl';
1037 1037
             }
1038 1038
         );
Please login to merge, or discard this patch.
src/Search/ResultsGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
             $total = $results->getTotalItems()->toNative();
110 110
 
111
-            $this->logger->info('Search API reported ' . $total . ' results');
111
+            $this->logger->info('Search API reported '.$total.' results');
112 112
 
113 113
             foreach ($results->getItems() as $item) {
114 114
                 $id = $item->getId();
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                         'query_duplicate_event',
124 124
                         array(
125 125
                             'query' => $query,
126
-                            'error' => "Found duplicate offer {$id} on page {$currentPage}, " .
126
+                            'error' => "Found duplicate offer {$id} on page {$currentPage}, ".
127 127
                                 "occurred first time on page {$ids[$id]}.",
128 128
                         )
129 129
                     );
Please login to merge, or discard this patch.
src/Event/LocationMarkedAsDuplicateProcessManager.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             if (!$result->getType()->sameValueAs(OfferType::EVENT())) {
76 76
                 $skipped[] = $result->getId();
77 77
                 $this->logger->warning(
78
-                    'Skipped result with id ' . $result->getId() . ' because it\'s not an event according to the @id parser.'
78
+                    'Skipped result with id '.$result->getId().' because it\'s not an event according to the @id parser.'
79 79
                 );
80 80
                 continue;
81 81
             }
@@ -89,17 +89,17 @@  discard block
 block discarded – undo
89 89
             $this->commandBus->dispatch($command);
90 90
 
91 91
             $this->logger->info(
92
-                'Dispatched UpdateLocation for result with id ' . $command->getItemId()
92
+                'Dispatched UpdateLocation for result with id '.$command->getItemId()
93 93
             );
94 94
         }
95 95
 
96 96
         $updated = count($commands);
97 97
         $total = $updated + count($skipped);
98 98
 
99
-        $this->logger->info('Received ' . $total . ' results from the search api.');
100
-        $this->logger->info('Updated ' . $updated . ' events to the canonical location.');
99
+        $this->logger->info('Received '.$total.' results from the search api.');
100
+        $this->logger->info('Updated '.$updated.' events to the canonical location.');
101 101
         $this->logger->info(
102
-            'Skipped ' . count($skipped) . ' events:' . PHP_EOL . implode(PHP_EOL, $skipped)
102
+            'Skipped '.count($skipped).' events:'.PHP_EOL.implode(PHP_EOL, $skipped)
103 103
         );
104 104
     }
105 105
 }
Please login to merge, or discard this patch.