@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | /** |
64 | 64 | * Get poll statistics. |
65 | 65 | * |
66 | - * @param Poll $poll |
|
66 | + * @param \AppBundle\Entity\Poll $poll |
|
67 | 67 | * |
68 | 68 | * @return array |
69 | 69 | */ |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** |
79 | 79 | * Get the result of the poll (in terms of a choice). |
80 | 80 | * |
81 | - * @param Poll $poll |
|
81 | + * @param \AppBundle\Entity\Poll $poll |
|
82 | 82 | * |
83 | 83 | * @return \AppBundle\Entity\Choice |
84 | 84 | */ |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | namespace AppBundle\Utils; |
4 | 4 | |
5 | 5 | use AppBundle\Entity\{ |
6 | - Choice, Poll, PollType |
|
6 | + Choice, Poll, PollType |
|
7 | 7 | }; |
8 | 8 | use Doctrine\Common\Persistence\ManagerRegistry; |
9 | 9 | |
@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | protected $doctrineRegistry; |
13 | 13 | protected $electionManager; |
14 | 14 | |
15 | - /** |
|
16 | - * Constructor. |
|
17 | - * |
|
18 | - * @param \Doctrine\Common\Persistence\ManagerRegistry $doctrineRegistry |
|
19 | - * @param \AppBundle\Utils\ElectionManager $electionManager |
|
20 | - */ |
|
21 | - public function __construct(ManagerRegistry $doctrineRegistry, ElectionManager $electionManager) |
|
15 | + /** |
|
16 | + * Constructor. |
|
17 | + * |
|
18 | + * @param \Doctrine\Common\Persistence\ManagerRegistry $doctrineRegistry |
|
19 | + * @param \AppBundle\Utils\ElectionManager $electionManager |
|
20 | + */ |
|
21 | + public function __construct(ManagerRegistry $doctrineRegistry, ElectionManager $electionManager) |
|
22 | 22 | { |
23 | 23 | $this->doctrineRegistry = $doctrineRegistry; |
24 | 24 | $this->electionManager = $electionManager; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function getAllPolls(): array |
57 | 57 | { |
58 | - $polls = $this->doctrineRegistry->getEntityManager()->getRepository('AppBundle:Poll')->findAll(); |
|
58 | + $polls = $this->doctrineRegistry->getEntityManager()->getRepository('AppBundle:Poll')->findAll(); |
|
59 | 59 | |
60 | 60 | return $polls; |
61 | 61 | } |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | return []; |
76 | 76 | } |
77 | 77 | |
78 | - /** |
|
79 | - * Get the result of the poll (in terms of a choice). |
|
80 | - * |
|
81 | - * @param Poll $poll |
|
82 | - * |
|
83 | - * @return \AppBundle\Entity\Choice |
|
84 | - */ |
|
78 | + /** |
|
79 | + * Get the result of the poll (in terms of a choice). |
|
80 | + * |
|
81 | + * @param Poll $poll |
|
82 | + * |
|
83 | + * @return \AppBundle\Entity\Choice |
|
84 | + */ |
|
85 | 85 | public function getPollResult(Poll $poll): Choice |
86 | 86 | { |
87 | 87 | // If election then call Election Manager |
@@ -3,22 +3,22 @@ discard block |
||
3 | 3 | namespace AppBundle\Utils; |
4 | 4 | |
5 | 5 | use AppBundle\Entity\{ |
6 | - Choice, Poll |
|
6 | + Choice, Poll |
|
7 | 7 | }; |
8 | 8 | use Doctrine\Common\Persistence\ManagerRegistry; |
9 | 9 | |
10 | 10 | class ElectionManager |
11 | 11 | { |
12 | - protected $doctrineRegistry; |
|
13 | - |
|
14 | - /** |
|
15 | - * Constructor. |
|
16 | - * |
|
17 | - * @param \Doctrine\Common\Persistence\ManagerRegistry $doctrineRegistry |
|
18 | - */ |
|
19 | - public function __construct(ManagerRegistry $doctrineRegistry) |
|
12 | + protected $doctrineRegistry; |
|
13 | + |
|
14 | + /** |
|
15 | + * Constructor. |
|
16 | + * |
|
17 | + * @param \Doctrine\Common\Persistence\ManagerRegistry $doctrineRegistry |
|
18 | + */ |
|
19 | + public function __construct(ManagerRegistry $doctrineRegistry) |
|
20 | 20 | { |
21 | - $this->doctrineRegistry = $doctrineRegistry; |
|
21 | + $this->doctrineRegistry = $doctrineRegistry; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function isElection(Poll $poll): boolean |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | |
34 | 34 | public function calculateElectionResult(Poll $poll): array |
35 | 35 | { |
36 | - return $this->getElectionResults($poll); |
|
36 | + return $this->getElectionResults($poll); |
|
37 | 37 | } |
38 | 38 | |
39 | - public function getElectionResults(Poll $poll): array |
|
40 | - { |
|
41 | - return []; |
|
42 | - } |
|
39 | + public function getElectionResults(Poll $poll): array |
|
40 | + { |
|
41 | + return []; |
|
42 | + } |
|
43 | 43 | |
44 | 44 | public function submitVotes(array $choices) |
45 | 45 | { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | return []; |
52 | 52 | } |
53 | 53 | |
54 | - public function getElectionWinner(Poll $poll): Choice |
|
54 | + public function getElectionWinner(Poll $poll): Choice |
|
55 | 55 | { |
56 | 56 | return; |
57 | 57 | } |