Completed
Pull Request — master (#239)
by Luc
05:12
created
src/Offer/ReadModel/JSONLD/OfferLDProjector.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -624,7 +624,7 @@
 block discarded – undo
624 624
     }
625 625
 
626 626
     /**
627
-     * @return callable
627
+     * @return \Closure
628 628
      */
629 629
     private function reject()
630 630
     {
Please login to merge, or discard this 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/Offer/Offer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     {
258 258
         $equalImages = array_filter(
259 259
             $this->mediaObjects,
260
-            function ($existingMediaObjectId) use ($image) {
260
+            function($existingMediaObjectId) use ($image) {
261 261
                 return $image
262 262
                     ->getMediaObjectId()
263 263
                     ->sameValueAs($existingMediaObjectId);
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             if ($this->rejectedReason && $reason->sameValueAs($this->rejectedReason)) {
382 382
                 return true; // nothing left to do if the offer has already been rejected for the same reason
383 383
             } else {
384
-                throw new Exception('The offer has already been rejected for another reason: ' . $this->rejectedReason);
384
+                throw new Exception('The offer has already been rejected for another reason: '.$this->rejectedReason);
385 385
             }
386 386
         }
387 387
 
Please login to merge, or discard this patch.
src/Security/CommandAuthorizationException.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@
 block discarded – undo
26 26
         StringLiteral $userId,
27 27
         AuthorizableCommandInterface $command
28 28
     ) {
29
-        parent::__construct('User with id: ' . $userId->toNative() .
30
-            ' has no permission: "' . $command->getPermission()->toNative() .
31
-            '" on item: ' . $command->getItemId() .
32
-            ' when executing command: ' . get_class($command));
29
+        parent::__construct('User with id: '.$userId->toNative().
30
+            ' has no permission: "'.$command->getPermission()->toNative().
31
+            '" on item: '.$command->getItemId().
32
+            ' when executing command: '.get_class($command));
33 33
 
34 34
         $this->userId = $userId;
35 35
         $this->command = $command;
Please login to merge, or discard this patch.
src/Location/Location.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,9 +66,9 @@
 block discarded – undo
66 66
     public function serialize()
67 67
     {
68 68
         return [
69
-          'cdbid' => $this->cdbid,
70
-          'name' => $this->name->toNative(),
71
-          'address' => $this->address->serialize()
69
+            'cdbid' => $this->cdbid,
70
+            'name' => $this->name->toNative(),
71
+            'address' => $this->address->serialize()
72 72
         ];
73 73
     }
74 74
 
Please login to merge, or discard this patch.
src/Organizer/Events/OrganizerCreatedWithUniqueWebsite.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -148,8 +148,8 @@
 block discarded – undo
148 148
         }
149 149
 
150 150
         return parent::serialize() + array(
151
-            'website' => (string) $this->getWebsite(),
152
-            'title' => (string) $this->getTitle(),
151
+            'website' => (string)$this->getWebsite(),
152
+            'title' => (string)$this->getTitle(),
153 153
             'addresses' => $addresses,
154 154
             'phones' => $this->getPhones(),
155 155
             'emails' => $this->getEmails(),
Please login to merge, or discard this patch.
src/Address/Address.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,10 +81,10 @@
 block discarded – undo
81 81
     public function serialize()
82 82
     {
83 83
         return [
84
-          'streetAddress' => $this->streetAddress->toNative(),
85
-          'postalCode' => $this->postalCode->toNative(),
86
-          'addressLocality' => $this->locality->toNative(),
87
-          'addressCountry' => $this->countryCode,
84
+            'streetAddress' => $this->streetAddress->toNative(),
85
+            'postalCode' => $this->postalCode->toNative(),
86
+            'addressLocality' => $this->locality->toNative(),
87
+            'addressCountry' => $this->countryCode,
88 88
         ];
89 89
     }
90 90
 
Please login to merge, or discard this patch.
src/Timestamp.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Broadway\Serializer\SerializableInterface;
6 6
 use DateTime;
7 7
 use DateTimeInterface;
8
-use ValueObjects\DateTime\Date;
9 8
 
10 9
 /**
11 10
  * Provices a class for a timestamp.
Please login to merge, or discard this patch.
src/Calendar.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         );
85 85
 
86 86
         $calendar = [
87
-          'type' => $this->type,
87
+            'type' => $this->type,
88 88
         ];
89 89
 
90 90
         empty($this->startDate) ?: $calendar['startDate'] = $this->startDate->format(DateTime::ATOM);
@@ -167,9 +167,9 @@  discard block
 block discarded – undo
167 167
             $jsonLd['subEvent'] = array();
168 168
             foreach ($timestamps as $timestamp) {
169 169
                 $jsonLd['subEvent'][] = array(
170
-                  '@type' => 'Event',
171
-                  'startDate' => $timestamp->getStartDate()->format(DateTime::ATOM),
172
-                  'endDate' => $timestamp->getEndDate()->format(DateTime::ATOM),
170
+                    '@type' => 'Event',
171
+                    'startDate' => $timestamp->getStartDate()->format(DateTime::ATOM),
172
+                    'endDate' => $timestamp->getEndDate()->format(DateTime::ATOM),
173 173
                 );
174 174
             }
175 175
         }
Please login to merge, or discard this 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/EventExport/Format/TabularData/OOXML/OOXMLFileFormat.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
     /**
25 25
      * @param EventInfoServiceInterface|null $uitpas
26
-     * @param string[]|null $include
26
+     * @param string[] $include
27 27
      */
28 28
     public function __construct($include = null, EventInfoServiceInterface $uitpas = null)
29 29
     {
Please login to merge, or discard this patch.