Completed
Pull Request — master (#8)
by Serhii
01:59
created

DataWithVersion   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 36
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getVersion() 0 4 1
A setVersion() 0 4 1
A initEmpty() 0 4 1
1
<?php
2
/**
3
 * @author Sergey Nehaenko <[email protected]>
4
 * @license GPL
5
 * @copyright Sergey Nehaenko &copy 2016
6
 * @version 3.0.0
7
 * @project browser-detector
8
 */
9
10
namespace EndorphinStudio\Detector;
11
12
13
class DataWithVersion extends Data
14
{
15
    /**
16
     * @return string
17
     */
18
    public function getVersion()
19
    {
20
        return $this->Version;
21
    }
22
23
    /**
24
     * @param string $Version
25
     */
26
    public function setVersion($Version)
27
    {
28
        $this->Version = $Version;
29
    }
30
    /**
31
     * @var string Version
32
     */
33
    protected $Version = D_NA;
34
35
    /**
36
     * DataWithVersion constructor.
37
     * @param \SimpleXMLElement $xmlData Xml data from file
38
     */
39
    public function __construct(\SimpleXMLElement $xmlData)
40
    {
41
        parent::__construct($xmlData);
42
    }
43
44
    public static function initEmpty()
45
    {
46
        return new self(new \SimpleXMLElement('<null>null</null>'));
47
    }
48
}
49