Code Duplication    Length = 14-16 lines in 2 locations

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

@@ 53-66 (lines=14) @@
50
            /** @var \CultureFeed_Cdb_Data_Address[] $addresses * */
51
            $addresses = $contact_cdb->getAddresses();
52
53
            foreach ($addresses as $address) {
54
                $address = $address->getPhysicalAddress();
55
56
                if ($address) {
57
                    $jsonLD->addresses[] = array(
58
                        'addressCountry' => $address->getCountry(),
59
                        'addressLocality' => $address->getCity(),
60
                        'postalCode' => $address->getZip(),
61
                        'streetAddress' =>
62
                            $address->getStreet() . ' ' .
63
                            $address->getHouseNumber(),
64
                    );
65
                }
66
            }
67
68
            $emails_cdb = $contact_cdb->getMails();
69
            if (count($emails_cdb) > 0) {

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

@@ 80-95 (lines=16) @@
77
        if ($contact_cdb) {
78
            $addresses = $contact_cdb->getAddresses();
79
80
            foreach ($addresses as $address) {
81
                $address = $address->getPhysicalAddress();
82
83
                if ($address) {
84
                    $jsonLD->address = array(
85
                        'addressCountry' => $address->getCountry(),
86
                        'addressLocality' => $address->getCity(),
87
                        'postalCode' => $address->getZip(),
88
                        'streetAddress' =>
89
                            $address->getStreet() . ' ' .
90
                            $address->getHouseNumber(),
91
                    );
92
93
                    break;
94
                }
95
            }
96
        }
97
98
        // Booking info.