InstalledPackage   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 84.62%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 61
ccs 11
cts 13
cp 0.8462
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getVersion() 0 4 1
A getUniqueName() 0 4 1
A __construct() 0 6 1
A getName() 0 4 1
A getInstalledFiles() 0 4 1
1
<?php
2
3
namespace MagentoHackathon\Composer\Magento;
4
5
/**
6
 * Class InstalledPackage
7
 * @package MagentoHackathon\Composer\Magento
8
 * @author Aydin Hassan <[email protected]>
9
 */
10
class InstalledPackage
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $name;
16
17
    /**
18
     * @var string
19
     */
20
    protected $version;
21
22
    /**
23
     * @var array
24
     */
25
    protected $installedFiles;
26
27
    /**
28
     * @param string $name
29
     * @param string $version
30
     * @param array $files
31
     */
32 14
    public function __construct($name, $version, array $files)
33
    {
34 14
        $this->name = $name;
35 14
        $this->installedFiles = $files;
36 14
        $this->version = $version;
37 14
    }
38
39
    /**
40
     * @return string
41
     */
42 13
    public function getName()
43
    {
44 13
        return $this->name;
45
    }
46
47
    /**
48
     * @return string
49
     */
50 8
    public function getVersion()
51
    {
52 8
        return $this->version;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getUniqueName()
59
    {
60
        return sprintf('%s-%s', $this->getName(), $this->getVersion());
61
    }
62
63
    /**
64
     * @return array
65
     */
66 10
    public function getInstalledFiles()
67
    {
68 10
        return $this->installedFiles;
69
    }
70
}
71