| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function createPoll(Project $project, Details $details): Poll |
||
| 33 | { |
||
| 34 | $poll = |
||
| 35 | (new Poll()) |
||
| 36 | ->setProject($project) |
||
| 37 | ->setDetails($details) |
||
| 38 | ->setCreatedAt(new \DateTime()) |
||
| 39 | ->setEndedAt(new \DateTime($this->pollDuration)) |
||
| 40 | ; |
||
| 41 | $this->em->persist($poll); |
||
| 42 | $this->em->flush(); |
||
| 43 | $this->eventDispatcher->dispatch(NewPollEvent::NAME, new NewPollEvent($poll)); |
||
| 44 | return $poll; |
||
| 45 | } |
||
| 64 | } |