Completed
Pull Request — master (#471)
by
unknown
01:44
created
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   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -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
@@ -155,13 +155,13 @@  discard block
 block discarded – undo
155 155
             !empty($data['startDate']) ? self::deserializeDateTime($data['startDate']) : null,
156 156
             !empty($data['endDate']) ? self::deserializeDateTime($data['endDate']) : null,
157 157
             !empty($data['timestamps']) ? array_map(
158
-                function ($timestamp) {
158
+                function($timestamp) {
159 159
                     return Timestamp::deserialize($timestamp);
160 160
                 },
161 161
                 $data['timestamps']
162 162
             ) : $defaultTimeStamps,
163 163
             !empty($data['openingHours']) ? array_map(
164
-                function ($openingHour) {
164
+                function($openingHour) {
165 165
                     return OpeningHour::deserialize($openingHour);
166 166
                 },
167 167
                 $data['openingHours']
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 
323 323
         if ($calendar instanceof CalendarWithSubEvents) {
324 324
             $timestamps = array_map(
325
-                function (DateRange $dateRange) {
325
+                function(DateRange $dateRange) {
326 326
                     return Timestamp::fromUdb3ModelDateRange($dateRange);
327 327
                 },
328 328
                 $calendar->getSubEvents()->toArray()
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 
332 332
         if ($calendar instanceof CalendarWithOpeningHours) {
333 333
             $openingHours = array_map(
334
-                function (Udb3ModelOpeningHour $openingHour) {
334
+                function(Udb3ModelOpeningHour $openingHour) {
335 335
                     return OpeningHour::fromUdb3ModelOpeningHour($openingHour);
336 336
                 },
337 337
                 $calendar->getOpeningHours()->toArray()
Please login to merge, or discard this patch.