Completed
Pull Request — master (#6)
by Ondrej
02:53
created

VotingResult   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 42
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getDecision() 0 4 1
A getPartialResults() 0 4 1
1
<?php
2
namespace SpareParts\Overseer;
3
4
use SpareParts\Overseer\Voter\ISingleVoterResult;
5
6
class VotingResult implements IVotingResult
7
{
8
    /**
9
     * @var VotingDecisionEnum
10
     */
11
    private $decision;
12
13
    /**
14
     * @var ISingleVoterResult[]
15
     */
16
    private $partialResults;
17
18
19
    /**
20
     * VotingResult constructor.
21
     * @param VotingDecisionEnum $decision
22
     * @param ISingleVoterResult[] $partialResults
23
     */
24 17
    public function __construct(VotingDecisionEnum $decision, $partialResults)
25
	{
26 17
        $this->decision = $decision;
27 17
        $this->partialResults = $partialResults;
28 17
    }
29
30
31
    /**
32
     * @return VotingDecisionEnum
33
     */
34 17
    public function getDecision()
35
    {
36 17
        return $this->decision;
37
    }
38
39
40
    /**
41
     * @return ISingleVoterResult[]
42
     */
43 17
    public function getPartialResults()
44
    {
45 17
        return $this->partialResults;
46
    }
47
}
48