Code Duplication    Length = 5-5 lines in 2 locations

src/SimpleUPS/Track/SmallPackage/Package.php 1 location

@@ 370-374 (lines=5) @@
367
            );
368
        }
369
370
        if (isset($xml->ScheduledDeliveryDate) && isset($xml->ScheduledDeliveryTime)) {
371
            $package->setScheduledDeliveryTime(
372
                new \DateTime(trim($xml->ScheduledDeliveryDate . ' ' . $xml->ScheduledDeliveryTime))
373
            );
374
        }
375
376
        if (isset($xml->Reroute->Address)) {
377
            $package->setRerouteAddress(Address::fromXml($xml->Reroute->Address));

src/SimpleUPS/Track/SmallPackage/Shipment.php 1 location

@@ 234-238 (lines=5) @@
231
            $shipment->setPickupDate(new \DateTime((string)$xml->PickupDate));
232
        }
233
234
        if (isset($xml->ScheduledDeliveryDate) && isset($xml->ScheduledDeliveryTime)) {
235
            $shipment->setDeliveryTime(
236
                new \DateTime((string)trim($xml->ScheduledDeliveryDate . ' ' . $xml->ScheduledDeliveryTime))
237
            );
238
        }
239
240
        if (isset($xml->ShipmentType)) {
241
            $shipment->setShipmentType(ShipmentType::fromXml($xml->ShipmentType));