Completed
Pull Request — master (#298)
by Luc
04:12
created
src/Calendar/CalendarConverter.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     public function toCdbCalendar(CalendarInterface $calendar)
25 25
     {
26 26
         $weekScheme = $this->getWeekScheme($calendar);
27
-        $calendarType = (string) $calendar->getType();
27
+        $calendarType = (string)$calendar->getType();
28 28
 
29 29
         switch ($calendarType) {
30 30
             case CalendarType::MULTIPLE:
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     private function countTimestamps(CultureFeed_Cdb_Data_Calendar_TimestampList $timestamps)
84 84
     {
85
-        $numberOfTimestamps =  iterator_count($timestamps);
85
+        $numberOfTimestamps = iterator_count($timestamps);
86 86
         $timestamps->rewind();
87 87
 
88 88
         return $numberOfTimestamps;
@@ -116,12 +116,12 @@  discard block
 block discarded – undo
116 116
             foreach ($openingHours as $openingHour) {
117 117
                 // In CDB2 every day needs to be a seperate entry.
118 118
                 if (is_array($openingHour)) {
119
-                    $openingHour = (object) $openingHour;
119
+                    $openingHour = (object)$openingHour;
120 120
                 }
121 121
                 foreach ($openingHour->getDayOfWeekCollection()->getDaysOfWeek() as $day) {
122 122
                     $openingTimesPerDay[$day->toNative()][] = new CultureFeed_Cdb_Data_Calendar_OpeningTime(
123
-                        $openingHour->getOpens()->toNativeString() . ':00',
124
-                        $openingHour->getCloses()->toNativeString() . ':00'
123
+                        $openingHour->getOpens()->toNativeString().':00',
124
+                        $openingHour->getCloses()->toNativeString().':00'
125 125
                     );
126 126
                 }
127 127
             }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
             $days = iterator_to_array($period->getDatePeriod('1 DAY'));
201 201
             $fillerTimestamps = array_map(
202
-                function (DateTimeInterface $dateTime) use ($index) {
202
+                function(DateTimeInterface $dateTime) use ($index) {
203 203
                     return new CultureFeed_Cdb_Data_Calendar_Timestamp(
204 204
                         $dateTime->format('Y-m-d'),
205 205
                         $this->createIndexedTimeString($index)
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 
211 211
             $newCalendar = array_reduce(
212 212
                 array_merge([$startTimestamp], $fillerTimestamps, [$endTimestamp]),
213
-                function (CultureFeed_Cdb_Data_Calendar_TimestampList $calendar, $timestamp) {
213
+                function(CultureFeed_Cdb_Data_Calendar_TimestampList $calendar, $timestamp) {
214 214
                     $calendar->add($timestamp);
215 215
                     return $calendar;
216 216
                 },
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         }
234 234
 
235 235
         $time = is_int($index)
236
-            ? $timestamp->format('H:i') . ':' . str_pad((string) $index, 2, '0', STR_PAD_LEFT)
236
+            ? $timestamp->format('H:i').':'.str_pad((string)$index, 2, '0', STR_PAD_LEFT)
237 237
             : $timestamp->format('H:i:s');
238 238
 
239 239
         if ($time == '00:00:00') {
@@ -249,6 +249,6 @@  discard block
 block discarded – undo
249 249
      */
250 250
     private function createIndexedTimeString($index)
251 251
     {
252
-        return '00:00:' . str_pad((string) $index, 2, '0', STR_PAD_LEFT);
252
+        return '00:00:'.str_pad((string)$index, 2, '0', STR_PAD_LEFT);
253 253
     }
254 254
 }
Please login to merge, or discard this patch.