Completed
Pull Request — master (#306)
by Luc
10:34
created
src/Address/CultureFeedAddressFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@
 block discarded – undo
28 28
 
29 29
         if (count($missingFields) > 0) {
30 30
             $keys = implode(', ', $missingFields);
31
-            throw new \InvalidArgumentException('The given cdbxml address is missing a ' . $keys);
31
+            throw new \InvalidArgumentException('The given cdbxml address is missing a '.$keys);
32 32
         }
33 33
 
34 34
 
35 35
         return new Address(
36
-            new Street($cdbAddress->getStreet() . ' ' . $cdbAddress->getHouseNumber()),
36
+            new Street($cdbAddress->getStreet().' '.$cdbAddress->getHouseNumber()),
37 37
             new PostalCode($cdbAddress->getZip()),
38 38
             new Locality($cdbAddress->getCity()),
39 39
             Country::fromNative($cdbAddress->getCountry())
Please login to merge, or discard this patch.
src/Organizer/Events/WebsiteUpdated.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 serialize()
39 39
     {
40 40
         return parent::serialize() + [
41
-                'website' => (string) $this->getWebsite()
41
+                'website' => (string)$this->getWebsite()
42 42
             ];
43 43
     }
44 44
 
Please login to merge, or discard this patch.
src/Organizer/Events/WebsiteUniqueConstraintService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,6 +28,6 @@
 block discarded – undo
28 28
 
29 29
         /* @var OrganizerCreatedWithUniqueWebsite|WebsiteUpdated $payload */
30 30
         $payload = $domainMessage->getPayload();
31
-        return new StringLiteral((string) $payload->getWebsite());
31
+        return new StringLiteral((string)$payload->getWebsite());
32 32
     }
33 33
 }
Please login to merge, or discard this patch.
src/Offer/Events/AbstractTypicalAgeRangeUpdated.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
     public function serialize()
37 37
     {
38 38
         return parent::serialize() + array(
39
-            'typicalAgeRange' => (string) $this->typicalAgeRange,
39
+            'typicalAgeRange' => (string)$this->typicalAgeRange,
40 40
         );
41 41
     }
42 42
 
Please login to merge, or discard this patch.
src/Offer/ReadModel/JSONLD/OfferLDProjector.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
             if (preg_match('/^apply(.+)$/', $method, $matches)) {
127 127
                 $event = $matches[1];
128
-                $classNameMethod = 'get' . $event . 'ClassName';
128
+                $classNameMethod = 'get'.$event.'ClassName';
129 129
 
130 130
                 if (method_exists($this, $classNameMethod)) {
131 131
                     $eventFullClassName = call_user_func(array($this, $classNameMethod));
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
         $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels';
266 266
 
267 267
         $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : [];
268
-        $label = (string) $labelAdded->getLabel();
268
+        $label = (string)$labelAdded->getLabel();
269 269
 
270 270
         $labels[] = $label;
271 271
         $offerLd->{$labelsProperty} = array_unique($labels);
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
             if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) {
291 291
                 $offerLd->{$labelsProperty} = array_filter(
292 292
                     $offerLd->{$labelsProperty},
293
-                    function ($label) use ($labelRemoved) {
293
+                    function($label) use ($labelRemoved) {
294 294
                         return !$labelRemoved->getLabel()->equals(
295 295
                             new Label($label)
296 296
                         );
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
             return;
388 388
         }
389 389
 
390
-        $imageId = (string) $imageRemoved->getImage()->getMediaObjectId();
390
+        $imageId = (string)$imageRemoved->getImage()->getMediaObjectId();
391 391
 
392 392
         /**
393 393
          * Matches any object that is not the removed image.
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
          * @return bool
399 399
          *  Returns true when the media object does not match the image to remove.
400 400
          */
401
-        $shouldNotBeRemoved = function ($mediaObject) use ($imageId) {
401
+        $shouldNotBeRemoved = function($mediaObject) use ($imageId) {
402 402
             $containsId = !!strpos($mediaObject->{'@id'}, $imageId);
403 403
             return !$containsId;
404 404
         };
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
         $document = $this->loadDocumentFromRepository($mainImageSelected);
437 437
         $offerLd = $document->getBody();
438 438
         $imageId = $mainImageSelected->getImage()->getMediaObjectId();
439
-        $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) {
439
+        $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) {
440 440
             if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) {
441 441
                 $matchingMediaObject = $currentMediaObject;
442 442
             }
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
      */
462 462
     protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId)
463 463
     {
464
-        return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0;
464
+        return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0;
465 465
     }
466 466
 
467 467
     /**
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
         $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated);
617 617
 
618 618
         $offerLd = $document->getBody();
619
-        $offerLd->typicalAgeRange = (string) $typicalAgeRangeUpdated->getTypicalAgeRange();
619
+        $offerLd->typicalAgeRange = (string)$typicalAgeRangeUpdated->getTypicalAgeRange();
620 620
 
621 621
         $this->repository->save($document->withBody($offerLd));
622 622
     }
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
      */
643 643
     protected function applyPublished(AbstractPublished $published)
644 644
     {
645
-        $this->applyEventTransformation($published, function ($offerLd) use ($published) {
645
+        $this->applyEventTransformation($published, function($offerLd) use ($published) {
646 646
             $offerLd->workflowStatus = WorkflowStatus::READY_FOR_VALIDATION()->getName();
647 647
 
648 648
             $publicationDate = $published->getPublicationDate();
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
      */
656 656
     protected function applyApproved(AbstractApproved $approved)
657 657
     {
658
-        $this->applyEventTransformation($approved, function ($offerLd) {
658
+        $this->applyEventTransformation($approved, function($offerLd) {
659 659
             $offerLd->workflowStatus = WorkflowStatus::APPROVED()->getName();
660 660
         });
661 661
     }
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
      */
692 692
     private function reject()
693 693
     {
694
-        return function ($offerLd) {
694
+        return function($offerLd) {
695 695
             $offerLd->workflowStatus = WorkflowStatus::REJECTED()->getName();
696 696
         };
697 697
     }
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
     {
739 739
         $images = $imagesEvent->getImages();
740 740
         $jsonMediaObjects = array_map(
741
-            function (Image $image) {
741
+            function(Image $image) {
742 742
                 return $this->mediaObjectSerializer->serialize($image, 'json-ld');
743 743
             },
744 744
             $images->toArray()
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
         }
753 753
 
754 754
         if (isset($mainImage)) {
755
-            $offerLd->image = (string) $mainImage->getSourceLocation();
755
+            $offerLd->image = (string)$mainImage->getSourceLocation();
756 756
         }
757 757
     }
758 758
 
Please login to merge, or discard this patch.
src/Offer/AgeRange.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,10 +63,10 @@
 block discarded – undo
63 63
      */
64 64
     public function __toString()
65 65
     {
66
-        $from = $this->from ? (string) $this->from : '';
67
-        $to = $this->to ? (string) $this->to : '';
66
+        $from = $this->from ? (string)$this->from : '';
67
+        $to = $this->to ? (string)$this->to : '';
68 68
 
69
-        return $from . '-' . $to;
69
+        return $from.'-'.$to;
70 70
     }
71 71
 
72 72
     /**
Please login to merge, or discard this patch.
src/Label/ReadModels/Relations/Repository/LabelRelation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $this->labelName = $labelName;
46 46
         $this->relationType = $relationType;
47 47
         $this->relationId = $relationId;
48
-        $this->imported = (bool) $imported;
48
+        $this->imported = (bool)$imported;
49 49
     }
50 50
 
51 51
     /**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             new LabelName($relation[SchemaConfigurator::LABEL_NAME]),
104 104
             RelationType::fromNative($relation[SchemaConfigurator::RELATION_TYPE]),
105 105
             new StringLiteral($relation[SchemaConfigurator::RELATION_ID]),
106
-            (bool) $relation[SchemaConfigurator::IMPORTED]
106
+            (bool)$relation[SchemaConfigurator::IMPORTED]
107 107
         );
108 108
     }
109 109
 }
Please login to merge, or discard this patch.
src/Label/ReadModels/Relations/Projector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
         foreach ($labelCollection->asArray() as $label) {
187 187
             $this->writeRepository->save(
188
-                new LabelName((string) $label),
188
+                new LabelName((string)$label),
189 189
                 $relationType,
190 190
                 $relationId,
191 191
                 true
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     {
202 202
         $labelRelation = null;
203 203
 
204
-        $labelName = new LabelName((string) $labelEvent->getLabel());
204
+        $labelName = new LabelName((string)$labelEvent->getLabel());
205 205
         $relationType = $this->offerTypeResolver->getRelationType($labelEvent);
206 206
         $relationId = new StringLiteral($labelEvent->getItemId());
207 207
 
Please login to merge, or discard this patch.
src/Label/ReadModels/Relations/Repository/Doctrine/DBALReadRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     public function getLabelRelations(LabelName $labelName)
17 17
     {
18 18
         $aliases = $this->getAliases();
19
-        $whereLabelName = SchemaConfigurator::LABEL_NAME . ' = ?';
19
+        $whereLabelName = SchemaConfigurator::LABEL_NAME.' = ?';
20 20
 
21 21
         $queryBuilder = $this->createQueryBuilder()->select($aliases)
22 22
             ->from($this->getTableName()->toNative())
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function getLabelRelationsForItem(StringLiteral $relationId)
38 38
     {
39 39
         $aliases = $this->getAliases();
40
-        $whereRelationId = SchemaConfigurator::RELATION_ID . ' = ?';
40
+        $whereRelationId = SchemaConfigurator::RELATION_ID.' = ?';
41 41
 
42 42
         $queryBuilder = $this->createQueryBuilder()->select($aliases)
43 43
             ->from($this->getTableName()->toNative())
Please login to merge, or discard this patch.