Passed
Push — master ( 2aad05...4fe473 )
by Yo
02:45
created

Package   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 40
ccs 8
cts 10
cp 0.8
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A getVersionConstraint() 0 4 1
A getItemId() 0 4 1
1
<?php
2
namespace Yoanm\ComposerConfigManager\Domain\Model;
3
4
class Package implements ConfigurationItemInterface
5
{
6
    /** @var string */
7
    private $name;
8
    /** @var string */
9
    private $versionConstraint;
10
    /**
11
     * @param string $name
12
     * @param string $versionConstraint
13
     */
14 5
    public function __construct($name, $versionConstraint)
15
    {
16 5
        $this->name = $name;
17 5
        $this->versionConstraint = $versionConstraint;
18 5
    }
19
20
    /**
21
     * @return string
22
     */
23 5
    public function getName()
24
    {
25 5
        return $this->name;
26
    }
27
28
    /**
29
     * @return string
30
     */
31 5
    public function getVersionConstraint()
32
    {
33 5
        return $this->versionConstraint;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getItemId()
40
    {
41
        return $this->getName();
42
    }
43
}
44