Code Duplication    Length = 16-20 lines in 2 locations

src/Data.php 1 location

@@ 57-72 (lines=16) @@
54
     * Data constructor.
55
     * @param \SimpleXMLElement $xmlData Xml data from file
56
     */
57
    public function __construct(\SimpleXMLElement $xmlData)
58
    {
59
        if($xmlData !== null)
60
        {
61
            foreach ($xmlData->children() as $child) {
62
                switch ($child->getName()) {
63
                    case 'name':
64
                        $this->Name = $child->__toString();
65
                        break;
66
                    case 'type':
67
                        $this->Type = $child->__toString();
68
                        break;
69
                }
70
            }
71
        }
72
    }
73
}
74

src/Robot.php 1 location

@@ 71-90 (lines=20) @@
68
    /** @var string Crawler Owner */
69
    private $Owner;
70
71
    public function __construct(\SimpleXMLElement $xmlData)
72
    {
73
        parent::__construct($xmlData);
74
75
        if($xmlData !== null)
76
        {
77
            foreach ($xmlData->children() as $child)
78
            {
79
                switch ($child->getName())
80
                {
81
                    case 'url':
82
                        $this->Homepage = $child->__toString();
83
                        break;
84
                    case 'owner':
85
                        $this->Owner = $child->__toString();
86
                        break;
87
                }
88
            }
89
        }
90
    }
91
}
92