ElectionManager::calculateElectionResult()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace AppBundle\Utils;
4
5
use AppBundle\Entity\{
6
	Choice, Poll
7
};
8
use Doctrine\Common\Persistence\ManagerRegistry;
9
10
class ElectionManager
11
{
12
	private $doctrineRegistry;
13
14
	/**
15
	 * Constructor.
16
	 *
17
	 * @param \Doctrine\Common\Persistence\ManagerRegistry $doctrineRegistry
18 1
	 */
19
	public function __construct(ManagerRegistry $doctrineRegistry)
20 1
    {
21 1
	    $this->doctrineRegistry = $doctrineRegistry;
22 1
    }
23
24
    public function isElection(Poll $poll): boolean
0 ignored issues
show
Unused Code introduced by
The parameter $poll is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    {
26
        return false;
27
    }
28
29
    public function getEligibleVoters(): array
30
    {
31
        return [];
32
    }
33
34
    public function calculateElectionResult(Poll $poll): array
35
    {
36
	    return $this->getElectionResults($poll);
37
    }
38
39
	public function getElectionResults(Poll $poll): array
0 ignored issues
show
Unused Code introduced by
The parameter $poll is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
40
	{
41
		return [];
42
	}
43
44
    public function submitVotes(array $choices)
0 ignored issues
show
Unused Code introduced by
The parameter $choices is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
45
    {
46
        return;
47
    }
48
49
    public function getElectionPollVotes(Poll $poll): array
0 ignored issues
show
Unused Code introduced by
The parameter $poll is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
50
    {
51
        return [];
52
    }
53
54
	public function getElectionWinner(Poll $poll): Choice
0 ignored issues
show
Unused Code introduced by
The parameter $poll is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
55
    {
56
        return;
57
    }
58
}
59