Completed
Pull Request — master (#236)
by Luc
04:45
created
src/Cdb/ExternalId/ArrayMappingService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     public function getCdbId($externalId)
26 26
     {
27 27
         if (isset($this->externalIdMapping[$externalId])) {
28
-            return (string) $this->externalIdMapping[$externalId];
28
+            return (string)$this->externalIdMapping[$externalId];
29 29
         } else {
30 30
             return null;
31 31
         }
Please login to merge, or discard this patch.
src/Organizer/OrganizerLDProjector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             $organizerCreated->getOrganizerId()
143 143
         );
144 144
 
145
-        $jsonLD->url = (string) $organizerCreated->getWebsite();
145
+        $jsonLD->url = (string)$organizerCreated->getWebsite();
146 146
         $jsonLD->name = $organizerCreated->getTitle();
147 147
 
148 148
         $recordedOn = $domainMessage->getRecordedOn()->toString();
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         if (isset($jsonLD->labels)) {
259 259
             $modifiedLabels = array_filter(
260 260
                 $jsonLD->labels,
261
-                function ($label) use ($labelRemoved) {
261
+                function($label) use ($labelRemoved) {
262 262
                     return $label->uuid !== $labelRemoved->getLabelId()->toNative();
263 263
                 }
264 264
             );
Please login to merge, or discard this patch.
src/Calendar.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         array $openingHours = array()
55 55
     ) {
56 56
         if (($type->is(CalendarType::MULTIPLE()) || $type->is(CalendarType::SINGLE())) && empty($startDate)) {
57
-            throw new \UnexpectedValueException('Start date can not be empty for calendar type: ' . $type . '.');
57
+            throw new \UnexpectedValueException('Start date can not be empty for calendar type: '.$type.'.');
58 58
         }
59 59
 
60 60
         if ($type->is(CalendarType::PERIODIC()) && (empty($startDate) || empty($endDate))) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     public function serialize()
83 83
     {
84 84
         $serializedTimestamps = array_map(
85
-            function (Timestamp $timestamp) {
85
+            function(Timestamp $timestamp) {
86 86
                 return $timestamp->serialize();
87 87
             },
88 88
             $this->timestamps
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             !empty($data['startDate']) ? self::deserializeDateTime($data['startDate']) : null,
111 111
             !empty($data['endDate']) ? self::deserializeDateTime($data['endDate']) : null,
112 112
             !empty($data['timestamps']) ? array_map(
113
-                function ($timestamp) {
113
+                function($timestamp) {
114 114
                     return Timestamp::deserialize($timestamp);
115 115
                 },
116 116
                 $data['timestamps']
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         // Permanent - with openingtimes
211 211
         $openingHours = $this->getOpeningHours();
212 212
         if (!empty($openingHours)) {
213
-            $jsonLd['openingHours'] = (array) $openingHours;
213
+            $jsonLd['openingHours'] = (array)$openingHours;
214 214
         }
215 215
 
216 216
         return $jsonLd;
Please login to merge, or discard this patch.
src/Offer/ReadModel/JSONLD/OfferLDProjector.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
             if (preg_match('/^apply(.+)$/', $method, $matches)) {
132 132
                 $event = $matches[1];
133
-                $classNameMethod = 'get' . $event . 'ClassName';
133
+                $classNameMethod = 'get'.$event.'ClassName';
134 134
 
135 135
                 if (method_exists($this, $classNameMethod)) {
136 136
                     $eventFullClassName = call_user_func(array($this, $classNameMethod));
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
         $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels';
261 261
 
262 262
         $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : [];
263
-        $label = (string) $labelAdded->getLabel();
263
+        $label = (string)$labelAdded->getLabel();
264 264
 
265 265
         $labels[] = $label;
266 266
         $offerLd->{$labelsProperty} = array_unique($labels);
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
         if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) {
284 284
             $offerLd->{$labelsProperty} = array_filter(
285 285
                 $offerLd->{$labelsProperty},
286
-                function ($label) use ($deleteLabel) {
286
+                function($label) use ($deleteLabel) {
287 287
                     return !$deleteLabel->getLabel()->equals(
288 288
                         new Label($label)
289 289
                     );
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
             return;
380 380
         }
381 381
 
382
-        $imageId = (string) $imageRemoved->getImage()->getMediaObjectId();
382
+        $imageId = (string)$imageRemoved->getImage()->getMediaObjectId();
383 383
 
384 384
         /**
385 385
          * Matches any object that is not the removed image.
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
          * @return bool
391 391
          *  Returns true when the media object does not match the image to remove.
392 392
          */
393
-        $shouldNotBeRemoved = function ($mediaObject) use ($imageId) {
393
+        $shouldNotBeRemoved = function($mediaObject) use ($imageId) {
394 394
             $containsId = !!strpos($mediaObject->{'@id'}, $imageId);
395 395
             return !$containsId;
396 396
         };
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
         $document = $this->loadDocumentFromRepository($mainImageSelected);
429 429
         $offerLd = $document->getBody();
430 430
         $imageId = $mainImageSelected->getImage()->getMediaObjectId();
431
-        $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) {
431
+        $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) {
432 432
             if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) {
433 433
                 $matchingMediaObject = $currentMediaObject;
434 434
             }
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
      */
454 454
     protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId)
455 455
     {
456
-        return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0;
456
+        return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0;
457 457
     }
458 458
 
459 459
     /**
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
      */
635 635
     protected function applyPublished(AbstractPublished $published)
636 636
     {
637
-        $this->applyEventTransformation($published, function ($offerLd) use ($published) {
637
+        $this->applyEventTransformation($published, function($offerLd) use ($published) {
638 638
             $offerLd->workflowStatus = WorkflowStatus::READY_FOR_VALIDATION()->getName();
639 639
 
640 640
             $publicationDate = $published->getPublicationDate();
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
      */
648 648
     protected function applyApproved(AbstractApproved $approved)
649 649
     {
650
-        $this->applyEventTransformation($approved, function ($offerLd) {
650
+        $this->applyEventTransformation($approved, function($offerLd) {
651 651
             $offerLd->workflowStatus = WorkflowStatus::APPROVED()->getName();
652 652
         });
653 653
     }
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
      */
684 684
     private function reject()
685 685
     {
686
-        return function ($offerLd) {
686
+        return function($offerLd) {
687 687
             $offerLd->workflowStatus = WorkflowStatus::REJECTED()->getName();
688 688
         };
689 689
     }
Please login to merge, or discard this patch.
src/LabelCollection.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     {
17 17
         array_walk(
18 18
             $labels,
19
-            function ($item) {
19
+            function($item) {
20 20
                 if (!$item instanceof Label) {
21 21
                     throw new \InvalidArgumentException(
22 22
                         'Argument $labels should only contain members of type Label'
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     {
52 52
         $labels = array_filter(
53 53
             $this->labels,
54
-            function (Label $existingLabel) use ($label) {
54
+            function(Label $existingLabel) use ($label) {
55 55
                 return !$existingLabel->equals($label);
56 56
             }
57 57
         );
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     {
76 76
         $equalLabels = array_filter(
77 77
             $this->labels,
78
-            function (Label $existingLabel) use ($label) {
78
+            function(Label $existingLabel) use ($label) {
79 79
                 return $label->equals($existingLabel);
80 80
             }
81 81
         );
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
     {
123 123
         $intersectLabels = array_filter(
124 124
             $this->labels,
125
-            function ($label) use ($labelCollection) {
125
+            function($label) use ($labelCollection) {
126 126
                 return $labelCollection->contains($label);
127 127
             }
128 128
         );
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
     public function toStrings()
156 156
     {
157 157
         $labels = array_map(
158
-            function (Label $label) {
159
-                return (string) $label;
158
+            function(Label $label) {
159
+                return (string)$label;
160 160
             },
161 161
             $this->labels
162 162
         );
Please login to merge, or discard this patch.