Completed
Pull Request — master (#118)
by Kristof
18:24 queued 09:02
created
src/BookingInfo.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -132,14 +132,14 @@
 block discarded – undo
132 132
     public function serialize()
133 133
     {
134 134
         return [
135
-          'phone' => $this->phone,
136
-          'email' => $this->email,
137
-          'url' => $this->url,
138
-          'urlLabel' => $this->urlLabel,
139
-          'name' => $this->name,
140
-          'description' => $this->description,
141
-          'availabilityStarts' => $this->availabilityStarts,
142
-          'availabilityEnds' => $this->availabilityEnds
135
+            'phone' => $this->phone,
136
+            'email' => $this->email,
137
+            'url' => $this->url,
138
+            'urlLabel' => $this->urlLabel,
139
+            'name' => $this->name,
140
+            'description' => $this->description,
141
+            'availabilityStarts' => $this->availabilityStarts,
142
+            'availabilityEnds' => $this->availabilityEnds
143 143
         ];
144 144
     }
145 145
 
Please login to merge, or discard this patch.
src/Calendar.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
     public function serialize()
82 82
     {
83 83
         return [
84
-          'type' => $this->getType(),
85
-          'startDate' => $this->startDate,
86
-          'endDate' => $this->endDate,
87
-          'timestamps' => $this->timestamps,
88
-          'openingHours' => $this->openingHours,
84
+            'type' => $this->getType(),
85
+            'startDate' => $this->startDate,
86
+            'endDate' => $this->endDate,
87
+            'timestamps' => $this->timestamps,
88
+            'openingHours' => $this->openingHours,
89 89
         ];
90 90
     }
91 91
 
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
             $jsonLd['subEvent'] = array();
162 162
             foreach ($timestamps as $timestamp) {
163 163
                 $jsonLd['subEvent'][] = array(
164
-                  '@type' => 'Event',
165
-                  'startDate' => $timestamp->getStartDate(),
166
-                  'endDate' => $timestamp->getEndDate(),
164
+                    '@type' => 'Event',
165
+                    'startDate' => $timestamp->getStartDate(),
166
+                    'endDate' => $timestamp->getEndDate(),
167 167
                 );
168 168
             }
169 169
         }
Please login to merge, or discard this patch.
src/Category.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,9 +70,9 @@
 block discarded – undo
70 70
     public function serialize()
71 71
     {
72 72
         return [
73
-          'id' => $this->id,
74
-          'label' => $this->label,
75
-          'domain' => $this->domain,
73
+            'id' => $this->id,
74
+            'label' => $this->label,
75
+            'domain' => $this->domain,
76 76
         ];
77 77
     }
78 78
 
Please login to merge, or discard this patch.
src/CommandHandling/Udb3CommandHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
         $method = $this->getHandleMethod($command);
25 25
 
26
-        if (! method_exists($this, $method)) {
26
+        if (!method_exists($this, $method)) {
27 27
             return;
28 28
         }
29 29
 
Please login to merge, or discard this patch.
src/ContactPoint.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,10 +72,10 @@
 block discarded – undo
72 72
     public function serialize()
73 73
     {
74 74
         return [
75
-          'phone' => $this->phones,
76
-          'email' => $this->emails,
77
-          'url' => $this->urls,
78
-          'type' => $this->type,
75
+            'phone' => $this->phones,
76
+            'email' => $this->emails,
77
+            'url' => $this->urls,
78
+            'type' => $this->type,
79 79
         ];
80 80
     }
81 81
 
Please login to merge, or discard this patch.
src/Event/EventLDProjector.php 4 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @file
4
- */
3
+     * @file
4
+     */
5 5
 
6 6
 namespace CultuurNet\UDB3\Event;
7 7
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         );
352 352
         $jsonLD->name['nl'] = $eventCreated->getTitle();
353 353
         $jsonLD->location = array(
354
-          '@type' => 'Place',
354
+            '@type' => 'Place',
355 355
         ) + (array)$this->placeJSONLD($eventCreated->getLocation()->getCdbid());
356 356
 
357 357
         $calendarJsonLD = $eventCreated->getCalendar()->toJsonLd();
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 
410 410
         $jsonLD->name->nl = $majorInfoUpdated->getTitle();
411 411
         $jsonLD->location = array(
412
-          '@type' => 'Place',
412
+            '@type' => 'Place',
413 413
         ) + (array)$this->placeJSONLD($majorInfoUpdated->getLocation()->getCdbid());
414 414
 
415 415
         $calendarJsonLD = $majorInfoUpdated->getCalendar()->toJsonLd();
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
         $eventLd = $document->getBody();
650 650
 
651 651
         $eventLd->organizer = array(
652
-          '@type' => 'Organizer',
652
+            '@type' => 'Organizer',
653 653
         ) + (array)$this->organizerJSONLD($organizerUpdated->getOrganizerId());
654 654
 
655 655
         $this->repository->save($document->withBody($eventLd));
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
         ) + (array)$this->placeJSONLD($eventCreated->getLocation()->getCdbid());
356 356
 
357 357
         $calendarJsonLD = $eventCreated->getCalendar()->toJsonLd();
358
-        $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD);
358
+        $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD);
359 359
 
360 360
         // Same as.
361 361
         $jsonLD->sameAs = $this->generateSameAs(
@@ -413,11 +413,11 @@  discard block
 block discarded – undo
413 413
         ) + (array)$this->placeJSONLD($majorInfoUpdated->getLocation()->getCdbid());
414 414
 
415 415
         $calendarJsonLD = $majorInfoUpdated->getCalendar()->toJsonLd();
416
-        $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD);
416
+        $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD);
417 417
 
418 418
         // Remove old theme and event type.
419
-        $jsonLD->terms = array_filter($jsonLD->terms, function ($term) {
420
-            return $term->domain !== EventType::DOMAIN &&  $term->domain !== Theme::DOMAIN;
419
+        $jsonLD->terms = array_filter($jsonLD->terms, function($term) {
420
+            return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN;
421 421
         });
422 422
 
423 423
         $eventType = $majorInfoUpdated->getEventType();
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
         $eventLd = $document->getBody();
478 478
 
479 479
         $labels = isset($eventLd->labels) ? $eventLd->labels : [];
480
-        $label = (string) $eventWasLabelled->getLabel();
480
+        $label = (string)$eventWasLabelled->getLabel();
481 481
 
482 482
         $labels[] = $label;
483 483
         $eventLd->labels = array_unique($labels);
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
         if (is_array($eventLd->labels)) {
495 495
             $eventLd->labels = array_filter(
496 496
                 $eventLd->labels,
497
-                function ($label) use ($unlabelled) {
497
+                function($label) use ($unlabelled) {
498 498
                     return !$unlabelled->getLabel()->equals(
499 499
                         new Label($label)
500 500
                     );
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,6 @@
 block discarded – undo
44 44
 use CultuurNet\UDB3\Label;
45 45
 use CultuurNet\UDB3\LabelCollection;
46 46
 use CultuurNet\UDB3\Offer\ReadModel\JSONLD\CdbXMLItemBaseImporter;
47
-use CultuurNet\UDB3\Media\Serialization\MediaObjectSerializer;
48 47
 use CultuurNet\UDB3\Organizer\OrganizerProjectedToJSONLD;
49 48
 use CultuurNet\UDB3\OrganizerService;
50 49
 use CultuurNet\UDB3\Place\PlaceProjectedToJSONLD;
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
     /**
370 370
      * Return the media of an event if it already exists.
371 371
      *
372
-     * @param $eventId
372
+     * @param string $eventId
373 373
      *  The id of the event.
374 374
      *
375 375
      * @return array
@@ -867,6 +867,9 @@  discard block
 block discarded – undo
867 867
         return $document;
868 868
     }
869 869
 
870
+    /**
871
+     * @param string $eventId
872
+     */
870 873
     private function generateSameAs($eventId, $name)
871 874
     {
872 875
         $eventSlug = $this->slugger->slug($name);
Please login to merge, or discard this patch.
src/Event/Events/LabelsMerged.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Created by PhpStorm.
4
- * User: nicolas
5
- * Date: 27/10/15
6
- * Time: 12:28
7
- */
3
+     * Created by PhpStorm.
4
+     * User: nicolas
5
+     * Date: 27/10/15
6
+     * Time: 12:28
7
+     */
8 8
 
9 9
 namespace CultuurNet\UDB3\Event\Events;
10 10
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     public static function deserialize(array $data)
58 58
     {
59 59
         $labels = array_map(
60
-            function ($item) {
60
+            function($item) {
61 61
                 return new Label(
62 62
                     $item['text'],
63 63
                     $item['visible']
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
     public function serialize()
79 79
     {
80 80
         $labels = array_map(
81
-            function (Label $label) {
81
+            function(Label $label) {
82 82
                 return [
83
-                    'text' => (string) $label,
83
+                    'text' => (string)$label,
84 84
                     'visible' => $label->isVisible(),
85 85
                 ];
86 86
             },
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     }
53 53
 
54 54
     /**
55
-     * @return mixed The object instance
55
+     * @return LabelsMerged The object instance
56 56
      */
57 57
     public static function deserialize(array $data)
58 58
     {
Please login to merge, or discard this patch.
src/Event/Events/TranslationApplied.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Created by PhpStorm.
4
- * User: nicolas
5
- * Date: 04/11/15
6
- * Time: 17:35
7
- */
3
+     * Created by PhpStorm.
4
+     * User: nicolas
5
+     * Date: 04/11/15
6
+     * Time: 17:35
7
+     */
8 8
 
9 9
 namespace CultuurNet\UDB3\Event\Events;
10 10
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
      * TranslationApplied constructor.
44 44
      * @param String $eventId
45 45
      * @param Language $language
46
-     * @param String|null $title
47
-     * @param String|null $shortDescription
48
-     * @param String|null $longDescription
46
+     * @param null|string $title
47
+     * @param null|string $shortDescription
48
+     * @param null|string $longDescription
49 49
      */
50 50
     public function __construct(
51 51
         String $eventId,
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     }
69 69
 
70 70
     /**
71
-     * @return mixed The object instance
71
+     * @return TranslationApplied The object instance
72 72
      */
73 73
     public static function deserialize(array $data)
74 74
     {
Please login to merge, or discard this patch.
src/Event/Events/TranslationDeleted.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Created by PhpStorm.
4
- * User: nicolas
5
- * Date: 16/11/15
6
- * Time: 14:03
7
- */
3
+     * Created by PhpStorm.
4
+     * User: nicolas
5
+     * Date: 16/11/15
6
+     * Time: 14:03
7
+     */
8 8
 
9 9
 namespace CultuurNet\UDB3\Event\Events;
10 10
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     }
39 39
 
40 40
     /**
41
-     * @return mixed The object instance
41
+     * @return TranslationDeleted The object instance
42 42
      */
43 43
     public static function deserialize(array $data)
44 44
     {
Please login to merge, or discard this patch.