Completed
Push — master ( 3dd078...4ecbc1 )
by Jonas
14s queued 11s
created
src/Calendar/CalendarConverter.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function toCdbCalendar(CalendarInterface $calendar)
41 41
     {
42 42
         $weekScheme = $this->getWeekScheme($calendar);
43
-        $calendarType = (string) $calendar->getType();
43
+        $calendarType = (string)$calendar->getType();
44 44
 
45 45
         switch ($calendarType) {
46 46
             case CalendarType::MULTIPLE:
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     private function countTimestamps(CultureFeed_Cdb_Data_Calendar_TimestampList $timestamps)
101 101
     {
102
-        $numberOfTimestamps =  iterator_count($timestamps);
102
+        $numberOfTimestamps = iterator_count($timestamps);
103 103
         $timestamps->rewind();
104 104
 
105 105
         return $numberOfTimestamps;
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
             foreach ($openingHours as $openingHour) {
134 134
                 // In CDB2 every day needs to be a seperate entry.
135 135
                 if (is_array($openingHour)) {
136
-                    $openingHour = (object) $openingHour;
136
+                    $openingHour = (object)$openingHour;
137 137
                 }
138 138
                 foreach ($openingHour->getDayOfWeekCollection()->getDaysOfWeek() as $day) {
139 139
                     $openingTimesPerDay[$day->toNative()][] = new CultureFeed_Cdb_Data_Calendar_OpeningTime(
140
-                        $openingHour->getOpens()->toNativeString() . ':00',
141
-                        $openingHour->getCloses()->toNativeString() . ':00'
140
+                        $openingHour->getOpens()->toNativeString().':00',
141
+                        $openingHour->getCloses()->toNativeString().':00'
142 142
                     );
143 143
                 }
144 144
             }
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             } else {
222 222
                 $days = iterator_to_array($period->getDatePeriod('1 DAY'));
223 223
                 $fillerTimestamps = array_map(
224
-                    function (DateTimeInterface $dateTime) use ($index) {
224
+                    function(DateTimeInterface $dateTime) use ($index) {
225 225
                         return new CultureFeed_Cdb_Data_Calendar_Timestamp(
226 226
                             $dateTime->format('Y-m-d'),
227 227
                             $this->createIndexedTimeString($index)
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 
234 234
             $newCalendar = array_reduce(
235 235
                 array_merge([$startTimestamp], $fillerTimestamps, [$endTimestamp]),
236
-                function (CultureFeed_Cdb_Data_Calendar_TimestampList $calendar, $timestamp) {
236
+                function(CultureFeed_Cdb_Data_Calendar_TimestampList $calendar, $timestamp) {
237 237
                     $calendar->add($timestamp);
238 238
                     return $calendar;
239 239
                 },
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         }
257 257
 
258 258
         $time = is_int($index)
259
-            ? $timestamp->format('H:i') . ':' . str_pad((string) $index, 2, '0', STR_PAD_LEFT)
259
+            ? $timestamp->format('H:i').':'.str_pad((string)$index, 2, '0', STR_PAD_LEFT)
260 260
             : $timestamp->format('H:i:s');
261 261
 
262 262
         return $time;
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
      */
269 269
     private function createIndexedTimeString($index)
270 270
     {
271
-        return '00:00:' . str_pad((string) $index, 2, '0', STR_PAD_LEFT);
271
+        return '00:00:'.str_pad((string)$index, 2, '0', STR_PAD_LEFT);
272 272
     }
273 273
 
274 274
     /**
Please login to merge, or discard this patch.
src/EventSourcing/DomainMessageBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
             )
89 89
         );
90 90
 
91
-        $message =  new DomainMessage(
91
+        $message = new DomainMessage(
92 92
             $this->id ?? UUID::generateAsString(),
93 93
             $this->playhead ?? 1,
94 94
             $finalMetaData,
Please login to merge, or discard this patch.
src/CalendarFactory.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
         if ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_PeriodList) {
27 27
             /** @var \CultureFeed_Cdb_Data_Calendar_Period $period */
28 28
             $period = $cdbCalendar->current();
29
-            $startDateString = $period->getDateFrom() . 'T00:00:00';
29
+            $startDateString = $period->getDateFrom().'T00:00:00';
30 30
         } elseif ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_TimestampList) {
31 31
             $firstTimestamp = $cdbCalendar->current();
32 32
             $cdbCalendarAsArray = iterator_to_array($cdbCalendar);
33 33
             $timestamp = $this->getFirstTimestamp($cdbCalendarAsArray, $firstTimestamp);
34 34
             if ($timestamp->getStartTime()) {
35
-                $startDateString = $timestamp->getDate() . 'T' . substr($timestamp->getStartTime(), 0, 5) . ':00';
35
+                $startDateString = $timestamp->getDate().'T'.substr($timestamp->getStartTime(), 0, 5).':00';
36 36
             } else {
37
-                $startDateString = $timestamp->getDate() . 'T00:00:00';
37
+                $startDateString = $timestamp->getDate().'T00:00:00';
38 38
             }
39 39
         }
40 40
         $startDate = !empty($startDateString) ? DateTimeFactory::dateTimeFromDateString($startDateString) : null;
@@ -47,17 +47,17 @@  discard block
 block discarded – undo
47 47
         if ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_PeriodList) {
48 48
             /** @var \CultureFeed_Cdb_Data_Calendar_Period $period */
49 49
             $period = $cdbCalendar->current();
50
-            $endDateString = $period->getDateTo() . 'T00:00:00';
50
+            $endDateString = $period->getDateTo().'T00:00:00';
51 51
         } elseif ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_TimestampList) {
52 52
             $firstTimestamp = $cdbCalendar->current();
53 53
             /** @var \CultureFeed_Cdb_Data_Calendar_Timestamp $timestamp */
54 54
             $cdbCalendarAsArray = iterator_to_array($cdbCalendar);
55 55
             $timestamp = $this->getLastTimestamp($cdbCalendarAsArray, $firstTimestamp);
56 56
             if ($timestamp->getEndTime()) {
57
-                $endDateString = $timestamp->getDate() . 'T' . $timestamp->getEndTime();
57
+                $endDateString = $timestamp->getDate().'T'.$timestamp->getEndTime();
58 58
             } else {
59 59
                 $endTime = $timestamp->getStartTime() ? $timestamp->getStartTime() : '00:00:00';
60
-                $endDateString = $timestamp->getDate() . 'T' . $endTime;
60
+                $endDateString = $timestamp->getDate().'T'.$endTime;
61 61
             }
62 62
         }
63 63
         $endDate = !empty($endDateString) ? DateTimeFactory::dateTimeFromDateString($endDateString) : null;
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
                 $cdbCalendar->next();
76 76
 
77 77
                 $startTime = $timestamp->getStartTime() ? $timestamp->getStartTime() : '00:00:00';
78
-                $startDateString = $timestamp->getDate() . 'T' . $startTime;
78
+                $startDateString = $timestamp->getDate().'T'.$startTime;
79 79
 
80 80
                 if ($timestamp->getEndTime()) {
81
-                    $endDateString = $timestamp->getDate() . 'T' . $timestamp->getEndTime();
81
+                    $endDateString = $timestamp->getDate().'T'.$timestamp->getEndTime();
82 82
                 } else {
83
-                    $endDateString = $timestamp->getDate() . 'T' . $startTime;
83
+                    $endDateString = $timestamp->getDate().'T'.$startTime;
84 84
                 }
85 85
 
86 86
                 $timestamp = $this->createTimestamp(
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             }
98 98
 
99 99
             $periods = array_map(
100
-                function (array $periodParts) {
100
+                function(array $periodParts) {
101 101
                     $firstPart = array_shift($periodParts);
102 102
                     $lastPart = array_pop($periodParts);
103 103
                     return new Timestamp(
Please login to merge, or discard this patch.
src/Calendar.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         array $openingHours = array()
63 63
     ) {
64 64
         if (($type->is(CalendarType::MULTIPLE()) || $type->is(CalendarType::SINGLE())) && empty($startDate)) {
65
-            throw new \UnexpectedValueException('Start date can not be empty for calendar type: ' . $type . '.');
65
+            throw new \UnexpectedValueException('Start date can not be empty for calendar type: '.$type.'.');
66 66
         }
67 67
 
68 68
         if ($type->is(CalendarType::PERIODIC()) && (empty($startDate) || empty($endDate))) {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         $this->endDate = $endDate;
87 87
         $this->openingHours = $openingHours;
88 88
 
89
-        usort($timestamps, function (Timestamp $timestamp, Timestamp $otherTimestamp) {
89
+        usort($timestamps, function(Timestamp $timestamp, Timestamp $otherTimestamp) {
90 90
             return $timestamp->getStartDate() <=> $otherTimestamp->getStartDate();
91 91
         });
92 92
 
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
     public function serialize()
109 109
     {
110 110
         $serializedTimestamps = array_map(
111
-            function (Timestamp $timestamp) {
111
+            function(Timestamp $timestamp) {
112 112
                 return $timestamp->serialize();
113 113
             },
114 114
             $this->timestamps
115 115
         );
116 116
 
117 117
         $serializedOpeningHours = array_map(
118
-            function (OpeningHour $openingHour) {
118
+            function(OpeningHour $openingHour) {
119 119
                 return $openingHour->serialize();
120 120
             },
121 121
             $this->openingHours
@@ -143,13 +143,13 @@  discard block
 block discarded – undo
143 143
             !empty($data['startDate']) ? self::deserializeDateTime($data['startDate']) : null,
144 144
             !empty($data['endDate']) ? self::deserializeDateTime($data['endDate']) : null,
145 145
             !empty($data['timestamps']) ? array_map(
146
-                function ($timestamp) {
146
+                function($timestamp) {
147 147
                     return Timestamp::deserialize($timestamp);
148 148
                 },
149 149
                 $data['timestamps']
150 150
             ) : [],
151 151
             !empty($data['openingHours']) ? array_map(
152
-                function ($openingHour) {
152
+                function($openingHour) {
153 153
                     return OpeningHour::deserialize($openingHour);
154 154
                 },
155 155
                 $data['openingHours']
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
         if ($calendar instanceof CalendarWithSubEvents) {
310 310
             $timestamps = array_map(
311
-                function (DateRange $dateRange) {
311
+                function(DateRange $dateRange) {
312 312
                     return Timestamp::fromUdb3ModelDateRange($dateRange);
313 313
                 },
314 314
                 $calendar->getSubEvents()->toArray()
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 
318 318
         if ($calendar instanceof CalendarWithOpeningHours) {
319 319
             $openingHours = array_map(
320
-                function (Udb3ModelOpeningHour $openingHour) {
320
+                function(Udb3ModelOpeningHour $openingHour) {
321 321
                     return OpeningHour::fromUdb3ModelOpeningHour($openingHour);
322 322
                 },
323 323
                 $calendar->getOpeningHours()->toArray()
Please login to merge, or discard this patch.