Completed
Pull Request — master (#353)
by
unknown
06:11
created
src/Offer/OfferFacilityResolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@
 block discarded – undo
25 25
      */
26 26
     public function byId(StringLiteral $facilityId)
27 27
     {
28
-        if (!array_key_exists((string) $facilityId, $this->facilities)) {
28
+        if (!array_key_exists((string)$facilityId, $this->facilities)) {
29 29
             throw new \Exception("Unknown facility id '{$facilityId}'");
30 30
         }
31 31
 
32
-        return $this->facilities[(string) $facilityId];
32
+        return $this->facilities[(string)$facilityId];
33 33
     }
34 34
 
35 35
     /**
Please login to merge, or discard this patch.
src/Organizer/Commands/AbstractLabelCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     public function getNames()
50 50
     {
51 51
         return [
52
-            new StringLiteral((string) $this->label),
52
+            new StringLiteral((string)$this->label),
53 53
         ];
54 54
     }
55 55
 
Please login to merge, or discard this patch.
src/Offer/Commands/AbstractImportLabels.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     public function getNames()
39 39
     {
40 40
         return array_map(
41
-            function (Label $label) {
41
+            function(Label $label) {
42 42
                 return new StringLiteral($label->getName()->toString());
43 43
             },
44 44
             $this->getLabels()->toArray()
Please login to merge, or discard this patch.
src/Organizer/Commands/ImportLabels.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     public function getNames()
39 39
     {
40 40
         return array_map(
41
-            function (Label $label) {
41
+            function(Label $label) {
42 42
                 return new StringLiteral($label->getName()->toString());
43 43
             },
44 44
             $this->getLabels()->toArray()
Please login to merge, or discard this patch.
src/Organizer/Organizer.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
13 13
 use CultuurNet\UDB3\Language;
14 14
 use CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\LabelName;
15 15
 use CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Labels;
16
-use CultuurNet\UDB3\Organizer\Commands\ImportLabels;
17 16
 use CultuurNet\UDB3\Organizer\Events\AddressUpdated;
18 17
 use CultuurNet\UDB3\Organizer\Events\ContactPointUpdated;
19 18
 use CultuurNet\UDB3\Organizer\Events\LabelAdded;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         // Convert the imported labels to label collection.
249 249
         $importLabelsCollection = new LabelCollection(
250 250
             array_map(
251
-                function (\CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label $label) {
251
+                function(\CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label $label) {
252 252
                     return new Label(
253 253
                         $label->getName()->toString(),
254 254
                         $label->isVisible()
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         foreach ($addedLabels->asArray() as $addedLabel) {
273 273
             $importLabels = $importLabels->with(
274 274
                 new \CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label(
275
-                    new LabelName((string) $addedLabel),
275
+                    new LabelName((string)$addedLabel),
276 276
                     $addedLabel->isVisible()
277 277
                 )
278 278
             );
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
     protected function applyOrganizerImportedFromUDB2(
339 339
         OrganizerImportedFromUDB2 $organizerImported
340 340
     ) {
341
-        $this->actorId = (string) $organizerImported->getActorId();
341
+        $this->actorId = (string)$organizerImported->getActorId();
342 342
 
343 343
         // On import from UDB2 the default main language is 'nl'.
344 344
         $this->mainLanguage = new Language('nl');
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
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         $sameFacilities = array_uintersect(
217 217
             $facilities1,
218 218
             $facilities2,
219
-            function (Facility $facility1, Facility $facility2) {
219
+            function(Facility $facility1, Facility $facility2) {
220 220
                 return strcmp($facility1->getId(), $facility2->getId());
221 221
             }
222 222
         );
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         // Convert the imported labels to label collection.
268 268
         $importLabelsCollection = new LabelCollection(
269 269
             array_map(
270
-                function (\CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label $label) {
270
+                function(\CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label $label) {
271 271
                     return new Label(
272 272
                         $label->getName()->toString(),
273 273
                         $label->isVisible()
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
         foreach ($addedLabels->asArray() as $addedLabel) {
292 292
             $importLabels = $importLabels->with(
293 293
                 new \CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label(
294
-                    new LabelName((string) $addedLabel),
294
+                    new LabelName((string)$addedLabel),
295 295
                     $addedLabel->isVisible()
296 296
                 )
297 297
             );
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
             if ($language->getCode() !== $this->mainLanguage->getCode()) {
341 341
                 $event = $this->createDescriptionTranslatedEvent($language, $description);
342 342
             } else {
343
-                $event = $this->createDescriptionUpdatedEvent((string) $description);
343
+                $event = $this->createDescriptionUpdatedEvent((string)$description);
344 344
             }
345 345
 
346 346
             $this->apply($event);
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
             if ($this->rejectedReason && $reason->sameValueAs($this->rejectedReason)) {
751 751
                 return true; // nothing left to do if the offer has already been rejected for the same reason
752 752
             } else {
753
-                throw new Exception('The offer has already been rejected for another reason: ' . $this->rejectedReason);
753
+                throw new Exception('The offer has already been rejected for another reason: '.$this->rejectedReason);
754 754
             }
755 755
         }
756 756
 
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
         $dutchImagesList = $imagesEvent->getImages()->toArray();
926 926
         $translatedImagesList = array_filter(
927 927
             $this->images->toArray(),
928
-            function (Image $image) {
928
+            function(Image $image) {
929 929
                 return $image->getLanguage()->getCode() !== 'nl';
930 930
             }
931 931
         );
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
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
             if (preg_match('/^apply(.+)$/', $method, $matches)) {
177 177
                 $event = $matches[1];
178
-                $classNameMethod = 'get' . $event . 'ClassName';
178
+                $classNameMethod = 'get'.$event.'ClassName';
179 179
 
180 180
                 if (method_exists($this, $classNameMethod)) {
181 181
                     $eventFullClassName = call_user_func(array($this, $classNameMethod));
@@ -360,11 +360,11 @@  discard block
 block discarded – undo
360 360
         $offerLD = $document->getBody();
361 361
 
362 362
         $oldTerms = property_exists($offerLD, 'terms') ? $offerLD->terms : [];
363
-        $newTerm = (object) $category->serialize();
363
+        $newTerm = (object)$category->serialize();
364 364
 
365 365
         $newTerms = array_filter(
366 366
             $oldTerms,
367
-            function ($term) use ($category) {
367
+            function($term) use ($category) {
368 368
                 return !property_exists($term, 'domain') || $term->domain !== $category->getDomain();
369 369
             }
370 370
         );
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
         // Remove all old facilities + get numeric keys.
392 392
         $terms = array_values(array_filter(
393 393
             $terms,
394
-            function ($term) {
394
+            function($term) {
395 395
                 return $term->domain !== Facility::DOMAIN;
396 396
             }
397 397
         ));
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
         $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels';
421 421
 
422 422
         $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : [];
423
-        $label = (string) $labelAdded->getLabel();
423
+        $label = (string)$labelAdded->getLabel();
424 424
 
425 425
         $labels[] = $label;
426 426
         $offerLd->{$labelsProperty} = array_unique($labels);
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
             if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) {
447 447
                 $offerLd->{$labelsProperty} = array_filter(
448 448
                     $offerLd->{$labelsProperty},
449
-                    function ($label) use ($labelRemoved) {
449
+                    function($label) use ($labelRemoved) {
450 450
                         return !$labelRemoved->getLabel()->equals(
451 451
                             new Label($label)
452 452
                         );
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
             return;
547 547
         }
548 548
 
549
-        $imageId = (string) $imageRemoved->getImage()->getMediaObjectId();
549
+        $imageId = (string)$imageRemoved->getImage()->getMediaObjectId();
550 550
 
551 551
         /**
552 552
          * Matches any object that is not the removed image.
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
          * @return bool
558 558
          *  Returns true when the media object does not match the image to remove.
559 559
          */
560
-        $shouldNotBeRemoved = function ($mediaObject) use ($imageId) {
560
+        $shouldNotBeRemoved = function($mediaObject) use ($imageId) {
561 561
             $containsId = !!strpos($mediaObject->{'@id'}, $imageId);
562 562
             return !$containsId;
563 563
         };
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
         $document = $this->loadDocumentFromRepository($mainImageSelected);
597 597
         $offerLd = $document->getBody();
598 598
         $imageId = $mainImageSelected->getImage()->getMediaObjectId();
599
-        $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) {
599
+        $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) {
600 600
             if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) {
601 601
                 $matchingMediaObject = $currentMediaObject;
602 602
             }
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
      */
622 622
     protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId)
623 623
     {
624
-        return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0;
624
+        return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0;
625 625
     }
626 626
 
627 627
     /**
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
         $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated);
821 821
 
822 822
         $offerLd = $document->getBody();
823
-        $offerLd->typicalAgeRange = (string) $typicalAgeRangeUpdated->getTypicalAgeRange();
823
+        $offerLd->typicalAgeRange = (string)$typicalAgeRangeUpdated->getTypicalAgeRange();
824 824
 
825 825
         return $document->withBody($offerLd);
826 826
     }
@@ -948,7 +948,7 @@  discard block
 block discarded – undo
948 948
         $images = $imagesEvent->getImages();
949 949
         $currentMediaObjects = isset($offerLd->mediaObject) ? $offerLd->mediaObject : [];
950 950
         $dutchMediaObjects = array_map(
951
-            function (Image $image) {
951
+            function(Image $image) {
952 952
                 // The mediaObject serializer violates the return statement of the serializer interface and returns an
953 953
                 // array instead of a serialized string.
954 954
                 /* @var array $serialized */
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
         );
967 967
         $translatedMediaObjects = array_filter(
968 968
             $currentMediaObjects,
969
-            function ($image) {
969
+            function($image) {
970 970
                 return $image->inLanguage !== 'nl';
971 971
             }
972 972
         );
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
         }
980 980
 
981 981
         if (isset($mainImage)) {
982
-            $offerLd->image = (string) $mainImage->getSourceLocation();
982
+            $offerLd->image = (string)$mainImage->getSourceLocation();
983 983
         }
984 984
     }
985 985
 
Please login to merge, or discard this patch.