| Conditions | 4 |
| Paths | 3 |
| Total Lines | 22 |
| Lines | 7 |
| Ratio | 31.82 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function postPersist(LifecycleEventArgs $args) |
||
| 24 | { |
||
| 25 | $entity = $args->getEntity(); |
||
| 26 | |||
| 27 | if ($entity instanceOf Fix) { |
||
| 28 | // On poste sur Slack |
||
| 29 | $this->slackService->post( |
||
| 30 | $entity->getUser(), |
||
| 31 | $entity->getFix() ? '#depannage' : '#upont-feedback', |
||
| 32 | $entity->getProblem() |
||
| 33 | ); |
||
| 34 | |||
| 35 | // On regarde les achievements |
||
| 36 | View Code Duplication | if ($entity->getFix()) { |
|
| 37 | $achievementCheck = new AchievementCheckEvent(Achievement::BUG_CONTACT); |
||
| 38 | $this->dispatcher->dispatch('upont.achievement', $achievementCheck); |
||
| 39 | } else { |
||
| 40 | $achievementCheck = new AchievementCheckEvent(Achievement::BUG_REPORT); |
||
| 41 | $this->dispatcher->dispatch('upont.achievement', $achievementCheck); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } |
||
| 45 | } |
||
| 46 |