1212namespace AppBundle \EventListener ;
1313
1414use Doctrine \DBAL \Exception \DriverException ;
15- use Doctrine \ORM \EntityManager ;
15+ use Doctrine \ORM \EntityManagerInterface ;
1616use Symfony \Component \Console \ConsoleEvents ;
17- use Symfony \Component \Console \Event \ConsoleExceptionEvent ;
17+ use Symfony \Component \Console \Event \ConsoleErrorEvent ;
1818use Symfony \Component \Console \Style \SymfonyStyle ;
1919use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
2020use Symfony \Component \HttpKernel \Event \GetResponseForExceptionEvent ;
3030 */
3131class CheckRequirementsSubscriber implements EventSubscriberInterface
3232{
33- /** @var EntityManager */
33+ /** @var EntityManagerInterface */
3434 private $ entityManager ;
3535
3636 /**
37- * @param EntityManager $entityManager
37+ * @param EntityManagerInterface $entityManager
3838 */
39- public function __construct (EntityManager $ entityManager )
39+ public function __construct (EntityManagerInterface $ entityManager )
4040 {
4141 $ this ->entityManager = $ entityManager ;
4242 }
@@ -48,22 +48,22 @@ public function __construct(EntityManager $entityManager)
4848 public static function getSubscribedEvents ()
4949 {
5050 return [
51- // Exceptions are one of the events defined by the Console. See the
51+ // Errors are one of the events defined by the Console. See the
5252 // rest here: https://symfony.com/doc/current/components/console/events.html
53- ConsoleEvents::EXCEPTION => 'handleConsoleException ' ,
53+ ConsoleEvents::ERROR => 'handleConsoleError ' ,
5454 // See: http://api.symfony.com/master/Symfony/Component/HttpKernel/KernelEvents.html
5555 KernelEvents::EXCEPTION => 'handleKernelException ' ,
5656 ];
5757 }
5858
5959 /**
60- * This method checks if there has been an exception in a command related to
60+ * This method checks if there has been an error in a command related to
6161 * the database and then, it checks if the 'sqlite3' PHP extension is enabled
6262 * or not to display a better error message.
6363 *
64- * @param ConsoleExceptionEvent $event
64+ * @param ConsoleErrorEvent $event
6565 */
66- public function handleConsoleException ( ConsoleExceptionEvent $ event )
66+ public function handleConsoleError ( ConsoleErrorEvent $ event )
6767 {
6868 $ commandNames = ['doctrine:fixtures:load ' , 'doctrine:database:create ' , 'doctrine:schema:create ' , 'doctrine:database:drop ' ];
6969
0 commit comments