2

I'm trying to create a command line tool using Symfony but whenever there's an error, it throws this kind of warning:

[php] User Deprecated: The "Symfony\Component\Console\Event\ConsoleExceptionEvent" class is deprecated since Symfony 3.3 and will be removed in 4.0. Use the ConsoleErrorEvent instead.
[
  "exception" => ErrorException {
    #message: "User Deprecated: The "Symfony\Component\Console\Event\ConsoleExceptionEvent" class is deprecated since Symfony 3.3 and will be removed in 4.0. Use the ConsoleErrorEvent instead."
    #code: 0
    #file: "./vendor/symfony/symfony/src/Symfony/Component/Console/Event/ConsoleExceptionEvent.php"
    #line: 14
    #severity: E_USER_DEPRECATED
    trace: {
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Event/ConsoleExceptionEvent.php:14 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:146 { …}
      Symfony\Component\Debug\DebugClassLoader->loadClass() {}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:974 { …}
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:86 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:248 { …}
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:74 { …}
      ./vendor/xxxx/job-queue-bundle/JMS/JobQueueBundle/Console/Application.php:45 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:148 { …}
      ./bin/console:28 {
        › $application = new Application($kernel);
        › $application->run($input);
        ›
      }
    }
  }
]

So it seems the framework is throwing deprecation warning about its own classes. Is there any way to disable this?

laurent
  • 88,262
  • 77
  • 290
  • 428
  • Symfony version? Just a guess but I suspect you need to move to 3.4. – Cerad Oct 04 '18 at 12:11
  • It's v3.4, and upgrading Symfony is not an option. – laurent Oct 04 '18 at 14:45
  • Have you checked to see exactly where the exception is being thrown? Maybe the third party JobQueueBundle needs an update. I am assuming it is not your code tossing the exception. – Cerad Oct 04 '18 at 14:51
  • Actually Doctrine is also showing these deprecation warnings. At this point, I would prefer to just turn off the warnings as upgrading everything is not really possible. – laurent Oct 04 '18 at 14:54
  • I have not tried this in 3.4 so can't really help. There are several 2.x related questions out there that I would expect to work. Similar to the now deleted answer below. https://stackoverflow.com/questions/28850809/disable-deprecated-warning-in-symfony-2-7 – Cerad Oct 04 '18 at 15:02

0 Answers0