Completed
Pull Request — master (#336)
by Luc
04:36
created
src/Organizer/Commands/AbstractLabelCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
      */
49 49
     public function getName()
50 50
     {
51
-        return new StringLiteral((string) $this->label);
51
+        return new StringLiteral((string)$this->label);
52 52
     }
53 53
 
54 54
     public function getPermission()
Please login to merge, or discard this patch.
src/Media/Commands/UploadImage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
      */
118 118
     public function getItemId()
119 119
     {
120
-        return (string) $this->getFileId();
120
+        return (string)$this->getFileId();
121 121
     }
122 122
 
123 123
     /**
Please login to merge, or discard this patch.
src/Role/Commands/AbstractCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     public function getItemId()
37 37
     {
38
-        return (string) $this->getUuid();
38
+        return (string)$this->getUuid();
39 39
     }
40 40
 
41 41
     /**
Please login to merge, or discard this patch.
src/Event/EventThemeResolver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 
591 591
         $this->themes = array_reduce(
592 592
             $themePerType,
593
-            function ($themes, array $type) {
593
+            function($themes, array $type) {
594 594
                 if (array_key_exists('themes', $type)) {
595 595
                     foreach ($type['themes'] as $themeData) {
596 596
                         $themes[$themeData['id']] = new Theme($themeData['id'], $themeData['label']);
@@ -608,9 +608,9 @@  discard block
 block discarded – undo
608 608
      */
609 609
     public function byId(StringLiteral $themeId)
610 610
     {
611
-        if (!array_key_exists((string) $themeId, $this->themes)) {
612
-            throw new \Exception("Unknown event theme id: " . $themeId);
611
+        if (!array_key_exists((string)$themeId, $this->themes)) {
612
+            throw new \Exception("Unknown event theme id: ".$themeId);
613 613
         }
614
-        return $this->themes[(string) $themeId];
614
+        return $this->themes[(string)$themeId];
615 615
     }
616 616
 }
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
@@ -43,9 +43,9 @@
 block discarded – undo
43 43
      */
44 44
     public function byId(StringLiteral $typeId)
45 45
     {
46
-        if (!array_key_exists((string) $typeId, $this->types)) {
47
-            throw new \Exception("Unknown event type id: " . $typeId);
46
+        if (!array_key_exists((string)$typeId, $this->types)) {
47
+            throw new \Exception("Unknown event type id: ".$typeId);
48 48
         }
49
-        return $this->types[(string) $typeId];
49
+        return $this->types[(string)$typeId];
50 50
     }
51 51
 }
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
@@ -41,9 +41,9 @@
 block discarded – undo
41 41
      */
42 42
     public function byId(StringLiteral $typeId)
43 43
     {
44
-        if (!array_key_exists((string) $typeId, $this->types)) {
45
-            throw new \Exception("Unknown place type id: " . $typeId);
44
+        if (!array_key_exists((string)$typeId, $this->types)) {
45
+            throw new \Exception("Unknown place type id: ".$typeId);
46 46
         }
47
-        return $this->types[(string) $typeId];
47
+        return $this->types[(string)$typeId];
48 48
     }
49 49
 }
Please login to merge, or discard this patch.
src/Place/PlaceThemeResolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@
 block discarded – undo
23 23
      */
24 24
     public function byId(StringLiteral $themeId)
25 25
     {
26
-        if (!array_key_exists((string) $themeId, $this->themes)) {
27
-            throw new \Exception("Unknown place theme id: " . $themeId);
26
+        if (!array_key_exists((string)$themeId, $this->themes)) {
27
+            throw new \Exception("Unknown place theme id: ".$themeId);
28 28
         }
29
-        return $this->themes[(string) $themeId];
29
+        return $this->themes[(string)$themeId];
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
src/Place/ReadModel/JSONLD/PlaceLDProjector.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@
 block discarded – undo
241 241
 
242 242
     /**
243 243
      * @param PlaceDeleted $placeDeleted
244
-     * @return null
244
+     * @return JsonDocument
245 245
      */
246 246
     protected function applyPlaceDeleted(PlaceDeleted $placeDeleted)
247 247
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
 use CultuurNet\UDB3\Event\EventType;
13 13
 use CultuurNet\UDB3\Event\ReadModel\DocumentGoneException;
14 14
 use CultuurNet\UDB3\Event\ReadModel\DocumentRepositoryInterface;
15
-use CultuurNet\UDB3\Facility;
16 15
 use CultuurNet\UDB3\Iri\IriGeneratorInterface;
17 16
 use CultuurNet\UDB3\Language;
18 17
 use CultuurNet\UDB3\Offer\AvailableTo;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         );
205 205
 
206 206
         $calendarJsonLD = $placeCreated->getCalendar()->toJsonLd();
207
-        $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD);
207
+        $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD);
208 208
 
209 209
         $availableTo = AvailableTo::createFromCalendar($placeCreated->getCalendar());
210 210
         $jsonLD->availableTo = (string)$availableTo;
@@ -279,8 +279,8 @@  discard block
 block discarded – undo
279 279
         $jsonLD->availableTo = (string)$availableTo;
280 280
 
281 281
         // Remove old theme and event type.
282
-        $jsonLD->terms = array_filter($jsonLD->terms, function ($term) {
283
-            return $term->domain !== EventType::DOMAIN &&  $term->domain !== Theme::DOMAIN;
282
+        $jsonLD->terms = array_filter($jsonLD->terms, function($term) {
283
+            return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN;
284 284
         });
285 285
 
286 286
         $eventType = $majorInfoUpdated->getEventType();
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
             // @replay_i18n
347 347
             // @see https://jira.uitdatabank.be/browse/III-2201
348 348
             $mainLanguageCode = $this->getMainLanguage($jsonLd)->getCode();
349
-            $jsonLd->address = (object) [
349
+            $jsonLd->address = (object)[
350 350
                 $mainLanguageCode => $jsonLd->address,
351 351
             ];
352 352
         }
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 
365 365
         $placeLd = $document->getBody();
366 366
 
367
-        $placeLd->geo = (object) [
367
+        $placeLd->geo = (object)[
368 368
             'latitude' => $geoCoordinatesUpdated->getCoordinates()->getLatitude()->toDouble(),
369 369
             'longitude' => $geoCoordinatesUpdated->getCoordinates()->getLongitude()->toDouble(),
370 370
         ];
Please login to merge, or discard this patch.
src/Organizer/OrganizerLDProjector.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
         $this->setMainLanguage($jsonLD, new Language('nl'));
215 215
 
216
-        $jsonLD->url = (string) $organizerCreated->getWebsite();
216
+        $jsonLD->url = (string)$organizerCreated->getWebsite();
217 217
 
218 218
         $jsonLD->name = [
219 219
             $this->getMainLanguage($jsonLD)->getCode() => $organizerCreated->getTitle(),
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         $document = $this->repository->get($organizerId);
245 245
 
246 246
         $jsonLD = $document->getBody();
247
-        $jsonLD->url = (string) $websiteUpdated->getWebsite();
247
+        $jsonLD->url = (string)$websiteUpdated->getWebsite();
248 248
 
249 249
         return $document->withBody($jsonLD);
250 250
     }
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
         $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels';
353 353
 
354 354
         $labels = isset($jsonLD->{$labelsProperty}) ? $jsonLD->{$labelsProperty} : [];
355
-        $label = (string) $labelAdded->getLabel();
355
+        $label = (string)$labelAdded->getLabel();
356 356
 
357 357
         $labels[] = $label;
358 358
         $jsonLD->{$labelsProperty} = array_unique($labels);
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             if (isset($jsonLD->{$labelsProperty}) && is_array($jsonLD->{$labelsProperty})) {
377 377
                 $jsonLD->{$labelsProperty} = array_filter(
378 378
                     $jsonLD->{$labelsProperty},
379
-                    function ($label) use ($labelRemoved) {
379
+                    function($label) use ($labelRemoved) {
380 380
                         return !$labelRemoved->getLabel()->equals(
381 381
                             new Label($label)
382 382
                         );
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
     private function applyOrganizerDeleted(
404 404
         OrganizerDeleted $organizerDeleted
405 405
     ) {
406
-        $document =  $this->repository->get($organizerDeleted->getOrganizerId());
406
+        $document = $this->repository->get($organizerDeleted->getOrganizerId());
407 407
 
408 408
         $jsonLD = $document->getBody();
409 409
 
Please login to merge, or discard this patch.