Completed
Branch 2.0.1 (3659a8)
by Serhii
03:59
created

Robot::getOwner()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
/**
3
 * @author Sergey Nehaenko <[email protected]>
4
 * @license GPL
5
 * @copyright Sergey Nehaenko &copy 2016
6
 * @version 2.0
7
 * @project browser-detector
8
 */
9
10
namespace EndorphinStudio\Detector;
11
12
13
class Robot extends Data
14
{
15
    /**
16
     * @return string
17
     */
18
    public function getHomepage()
19
    {
20
        return $this->Homepage;
21
    }
22
23
    /**
24
     * @return boolean
25
     */
26
    public function isSearchEngine()
27
    {
28
        return $this->SearchEngine;
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getOwner()
35
    {
36
        return $this->Owner;
37
    }
38
39
    /**
40
     * @param string $Homepage
41
     */
42
    public function setHomepage($Homepage)
43
    {
44
        $this->Homepage = $Homepage;
45
    }
46
47
    /**
48
     * @param string $Owner
49
     */
50
    public function setOwner($Owner)
51
    {
52
        $this->Owner = $Owner;
53
    }
54
55
    /**
56
     * @param boolean $isSearchEngine
57
     */
58
    public function setSearchEngine($isSearchEngine)
59
    {
60
        $this->SearchEngine = $isSearchEngine;
61
    }
62
    /** @var string Crawler homepage */
63
    private $Homepage;
64
65
    /** @var boolean Search Engine */
66
    private $SearchEngine;
67
68
    /** @var string Crawler Owner */
69
    private $Owner;
70
71 View Code Duplication
    public function __construct(\SimpleXMLElement $xmlData)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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