Completed
Pull Request — master (#243)
by Luc
04:56
created
src/Event/ReadModel/JSONLD/CdbXMLImporter.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     private function dateFromUdb2UnixTime($unixTime)
163 163
     {
164 164
         $dateTime = new \DateTime(
165
-            '@' . $unixTime,
165
+            '@'.$unixTime,
166 166
             new \DateTimeZone('Europe/Brussels')
167 167
         );
168 168
 
@@ -201,21 +201,21 @@  discard block
 block discarded – undo
201 201
 
202 202
         $validKeywords = array_filter(
203 203
             $keywords,
204
-            function (CultureFeed_Cdb_Data_Keyword $keyword) {
204
+            function(CultureFeed_Cdb_Data_Keyword $keyword) {
205 205
                 return strlen(trim($keyword->getValue())) > 0;
206 206
             }
207 207
         );
208 208
 
209 209
         $visibleKeywords = array_filter(
210 210
             $validKeywords,
211
-            function (CultureFeed_Cdb_Data_Keyword $keyword) {
211
+            function(CultureFeed_Cdb_Data_Keyword $keyword) {
212 212
                 return $keyword->isVisible();
213 213
             }
214 214
         );
215 215
 
216 216
         $hiddenKeywords = array_filter(
217 217
             $validKeywords,
218
-            function (CultureFeed_Cdb_Data_Keyword $keyword) {
218
+            function(CultureFeed_Cdb_Data_Keyword $keyword) {
219 219
                 return !$keyword->isVisible();
220 220
             }
221 221
         );
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     private function addKeywordsAsLabelsProperty($jsonLD, $labelsPropertyName, array $keywords)
234 234
     {
235 235
         $labels = array_map(
236
-            function ($keyword) {
236
+            function($keyword) {
237 237
                 /** @var CultureFeed_Cdb_Data_Keyword $keyword */
238 238
                 return $keyword->getValue();
239 239
             },
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
                     'addressLocality' => $address->getCity(),
320 320
                     'postalCode' => $address->getZip(),
321 321
                     'streetAddress' =>
322
-                        $address->getStreet() . ' ' . $address->getHouseNumber(
322
+                        $address->getStreet().' '.$address->getHouseNumber(
323 323
                         ),
324 324
                 );
325 325
             }
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
     ) {
500 500
         $contactInfo = $event->getContactInfo();
501 501
 
502
-        $notForReservations = function ($item) {
502
+        $notForReservations = function($item) {
503 503
             /** @var \CultureFeed_Cdb_Data_Url|\CultureFeed_Cdb_Data_Phone|\CultureFeed_Cdb_Data_Mail $item */
504 504
             return !$item->isForReservations();
505 505
         };
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 
512 512
             if (!empty($emails)) {
513 513
                 $contactPoint['email'] = array_map(
514
-                    function (\CultureFeed_Cdb_Data_Mail $email) {
514
+                    function(\CultureFeed_Cdb_Data_Mail $email) {
515 515
                         return $email->getMailAddress();
516 516
                     },
517 517
                     $emails
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 
524 524
             if (!empty($phones)) {
525 525
                 $contactPoint['phone'] = array_map(
526
-                    function (\CultureFeed_Cdb_Data_phone $phone) {
526
+                    function(\CultureFeed_Cdb_Data_phone $phone) {
527 527
                         return $phone->getNumber();
528 528
                     },
529 529
                     $phones
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 
536 536
             if (!empty($urls)) {
537 537
                 $contactPoint['url'] = array_map(
538
-                    function (\CultureFeed_Cdb_Data_Url $url) {
538
+                    function(\CultureFeed_Cdb_Data_Url $url) {
539 539
                         return $url->getUrl();
540 540
                     },
541 541
                     $urls
@@ -606,14 +606,14 @@  discard block
 block discarded – undo
606 606
         if ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_PeriodList) {
607 607
             /** @var \CultureFeed_Cdb_Data_Calendar_Period $period */
608 608
             $period = $cdbCalendar->current();
609
-            $startDateString = $period->getDateFrom() . 'T00:00:00';
609
+            $startDateString = $period->getDateFrom().'T00:00:00';
610 610
         } else if ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_TimestampList) {
611 611
             /** @var \CultureFeed_Cdb_Data_Calendar_Timestamp $timestamp */
612 612
             $timestamp = $cdbCalendar->current();
613 613
             if ($timestamp->getStartTime()) {
614
-                $startDateString = $timestamp->getDate() . 'T' . $timestamp->getStartTime();
614
+                $startDateString = $timestamp->getDate().'T'.$timestamp->getStartTime();
615 615
             } else {
616
-                $startDateString = $timestamp->getDate() . 'T00:00:00';
616
+                $startDateString = $timestamp->getDate().'T00:00:00';
617 617
             }
618 618
         }
619 619
         $startDate = !empty($startDateString) ? DateTimeFactory::dateTimeFromDateString($startDateString) : null;
@@ -626,17 +626,17 @@  discard block
 block discarded – undo
626 626
         if ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_PeriodList) {
627 627
             /** @var \CultureFeed_Cdb_Data_Calendar_Period $period */
628 628
             $period = $cdbCalendar->current();
629
-            $endDateString = $period->getDateTo() . 'T00:00:00';
629
+            $endDateString = $period->getDateTo().'T00:00:00';
630 630
         } else if ($cdbCalendar instanceof \CultureFeed_Cdb_Data_Calendar_TimestampList) {
631 631
             $firstTimestamp = $cdbCalendar->current();
632 632
             /** @var \CultureFeed_Cdb_Data_Calendar_Timestamp $timestamp */
633 633
             $cdbCalendarAsArray = iterator_to_array($cdbCalendar);
634 634
             $timestamp = iterator_count($cdbCalendar) > 1 ? end($cdbCalendarAsArray) : $firstTimestamp;
635 635
             if ($timestamp->getEndTime()) {
636
-                $endDateString = $timestamp->getDate() . 'T' . $timestamp->getEndTime();
636
+                $endDateString = $timestamp->getDate().'T'.$timestamp->getEndTime();
637 637
             } else {
638 638
                 $endTime = $timestamp->getStartTime() ? $timestamp->getStartTime() : '00:00:00';
639
-                $endDateString = $timestamp->getDate() . 'T' . $endTime;
639
+                $endDateString = $timestamp->getDate().'T'.$endTime;
640 640
             }
641 641
         }
642 642
         $endDate = !empty($endDateString) ? DateTimeFactory::dateTimeFromDateString($endDateString) : null;
@@ -653,13 +653,13 @@  discard block
 block discarded – undo
653 653
                 $cdbCalendar->next();
654 654
 
655 655
                 if ($timestamp->getStartTime()) {
656
-                    $startDateString = $timestamp->getDate() . 'T' . $timestamp->getStartTime();
656
+                    $startDateString = $timestamp->getDate().'T'.$timestamp->getStartTime();
657 657
 
658 658
                     if ($timestamp->getEndTime()) {
659
-                        $endDateString = $timestamp->getDate() . 'T' . $timestamp->getEndTime();
659
+                        $endDateString = $timestamp->getDate().'T'.$timestamp->getEndTime();
660 660
                     } else {
661 661
                         $endTime = $timestamp->getStartTime() ? $timestamp->getStartTime() : '00:00:00';
662
-                        $endDateString = $timestamp->getDate() . 'T' . $endTime;
662
+                        $endDateString = $timestamp->getDate().'T'.$endTime;
663 663
                     }
664 664
                 }
665 665
 
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
                 foreach ($openingHours as $openingHour) {
728 728
                     $openingHoursAsArray[] = [
729 729
                         'dayOfWeek' => array_map(
730
-                            function (WeekDay $weekDay) {
730
+                            function(WeekDay $weekDay) {
731 731
                                 return strtolower($weekDay->toNative());
732 732
                             },
733 733
                             $openingHour->getWeekDays()
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
             $slug = '';
846 846
         }
847 847
 
848
-        $reference = 'http://www.uitinvlaanderen.be/agenda/e/' . $slug . '/' . $event->getCdbId();
848
+        $reference = 'http://www.uitinvlaanderen.be/agenda/e/'.$slug.'/'.$event->getCdbId();
849 849
 
850 850
 
851 851
         if (!property_exists($jsonLD, 'sameAs')) {
Please login to merge, or discard this patch.