Code Duplication    Length = 9-11 lines in 2 locations

src/Service/Tracking.php 2 locations

@@ 11-19 (lines=9) @@
8
{
9
    public function __construct(){}
10
11
    public static function track($trackingnumber)
12
    {
13
        $track = new \SimpleXMLElement("<TrackRequest></TrackRequest>");
14
        $track->addAttribute('USERID', self::$user);
15
        $pack = $track->addChild('TrackID');
16
        $pack->addAttribute('ID', $trackingnumber);
17
        $url = self::$service . 'TrackV2&XML='.$track->asXML();
18
        return simplexml_load_file($url);
19
    }
20
21
    public static function trackMultiple($trackingarray)
22
    {
@@ 21-31 (lines=11) @@
18
        return simplexml_load_file($url);
19
    }
20
21
    public static function trackMultiple($trackingarray)
22
    {
23
        $track = new \SimpleXMLElement("<TrackRequest></TrackRequest>");
24
        $track->addAttribute('USERID', self::$user);
25
        foreach($trackingarray as $trackingnumber){
26
            $pack = $track->addChild('TrackID');
27
            $pack->addAttribute('ID', $trackingnumber);
28
        }
29
        $url = self::$service . 'TrackV2&XML='.$track->asXML();
30
        return simplexml_load_file($url);
31
    }
32
}
33