Browse Source

service listener mattermost propre

François 6 years ago
parent
commit
2d029fe052
2 changed files with 4 additions and 3 deletions
  1. 3 0
      app/config/services.yml
  2. 1 3
      src/AppBundle/Service/FilmCreationListener.php

+ 3 - 0
app/config/services.yml

@@ -64,5 +64,8 @@ services:
         - "@security.password_encoder"
 
     AppBundle\Service\FilmCreationListener:
+        arguments:
+            - "@AppBundle\\Service\\Mattermost"
+            - "@session"
         tags:
         - { name: doctrine.event_listener, event: postPersist }

+ 1 - 3
src/AppBundle/Service/FilmCreationListener.php

@@ -5,7 +5,6 @@ namespace AppBundle\Service;
 use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
 use AppBundle\Entity\Film;
 use Symfony\Component\Config\Definition\Exception\Exception;
-use Symfony\Component\HttpFoundation\Session\Session;
 
 class FilmCreationListener
 {
@@ -13,7 +12,6 @@ class FilmCreationListener
      * var mattermostSender
      */
     private $mattermostSender;
-    private $session;
 
     public function __construct(Mattermost $mattermostSender)
     {
@@ -31,7 +29,7 @@ class FilmCreationListener
         try {
             $this->mattermostSender->sendNouveauFilm($entity);
         } catch (Exception $exception) {
-            // Ajouter flashbag
+
         }
     }
 }