Code Duplication    Length = 19-19 lines in 2 locations

src/Event/ReadModel/JSONLD/CdbXMLImporter.php 1 location

@@ 381-399 (lines=19) @@
378
        $bookingInfo = array();
379
380
        $price = $detail->getPrice();
381
        if ($price) {
382
            if ($price->getDescription()) {
383
                $bookingInfo['description'] = $price->getDescription();
384
            }
385
            if ($price->getTitle()) {
386
                $bookingInfo['name'] = $price->getTitle();
387
            }
388
            if ($price->getValue() !== null) {
389
                $bookingInfo['priceCurrency'] = 'EUR';
390
                $bookingInfo['price'] = floatval($price->getValue());
391
            }
392
            if ($bookingPeriod = $event->getBookingPeriod()) {
393
                $startDate = $this->dateFromUdb2UnixTime($bookingPeriod->getDateFrom());
394
                $endDate = $this->dateFromUdb2UnixTime($bookingPeriod->getDateTill());
395
396
                $bookingInfo['availabilityStarts'] = $startDate->format('c');
397
                $bookingInfo['availabilityEnds'] = $endDate->format('c');
398
            }
399
        }
400
401
        // Add reservation contact data.
402
        $contactInfo = $event->getContactInfo();

src/Offer/ReadModel/JSONLD/CdbXmlContactInfoImporter.php 1 location

@@ 18-36 (lines=19) @@
15
    ) {
16
        $bookingInfo = array();
17
18
        if ($price) {
19
            if ($price->getDescription()) {
20
                $bookingInfo['description'] = $price->getDescription();
21
            }
22
            if ($price->getTitle()) {
23
                $bookingInfo['name'] = $price->getTitle();
24
            }
25
            if ($price->getValue() !== null) {
26
                $bookingInfo['priceCurrency'] = 'EUR';
27
                $bookingInfo['price'] = floatval($price->getValue());
28
            }
29
            if ($bookingPeriod) {
30
                $startDate = $this->dateFromUdb2UnixTime($bookingPeriod->getDateFrom());
31
                $endDate = $this->dateFromUdb2UnixTime($bookingPeriod->getDateTill());
32
33
                $bookingInfo['availabilityStarts'] = $startDate->format('c');
34
                $bookingInfo['availabilityEnds'] = $endDate->format('c');
35
            }
36
        }
37
38
        // Add reservation contact data.
39
        /** @var \CultureFeed_Cdb_Data_Url[] $urls */