AttributeScore   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getAttribute() 0 4 1
A getScore() 0 4 1
A getScoreValue() 0 4 1
1
<?php
2
3
namespace Pbmedia\Specifications;
4
5
use Pbmedia\Specifications\Interfaces\Attribute;
6
use Pbmedia\Specifications\Interfaces\Score;
7
8
class AttributeScore
9
{
10
    /**
11
     * Instance of Attribute.
12
     *
13
     * @var \Pbmedia\Specifications\Interfaces\Attribute
14
     */
15
    protected $attribute;
16
17
    /**
18
     * Instance of Score.
19
     *
20
     * @var \Pbmedia\Specifications\Interfaces\Score
21
     */
22
    protected $score;
23
24
    /**
25
     * Create a new AttributeScore instance.
26
     *
27
     * @param  \Pbmedia\Specifications\Interfaces\Attribute   $attribute
28
     * @param  \Pbmedia\Specifications\Interfaces\Score   $score
29
     */
30
    public function __construct(Attribute $attribute, Score $score)
31
    {
32
        $this->attribute = $attribute;
33
        $this->score     = $score;
34
    }
35
36
    /**
37
     * Get the Attribute object.
38
     *
39
     * @return \Pbmedia\Specifications\Interfaces\Attribute
40
     */
41
    public function getAttribute(): Attribute
42
    {
43
        return $this->attribute;
44
    }
45
46
    /**
47
     * Get the Score object.
48
     *
49
     * @return \Pbmedia\Specifications\Interfaces\Score
50
     */
51
    public function getScore(): Score
52
    {
53
        return $this->score;
54
    }
55
56
    /**
57
     * Get the value of the Score object.
58
     *
59
     * @return mixed
60
     */
61
    public function getScoreValue()
62
    {
63
        return $this->getScore()->getValue();
64
    }
65
}
66