1
votes

I see an error message:

PHP Deprecated: The Symfony\Component\DependencyInjection\Definition::getFactoryClass method is deprecated since version 2.6 and will be removed in 3.0.

when running

composer update
composer run-script post-update-cmd

on my symfony 2.7 project.

I checked app/bootstrap.php.cache

error_reporting(error_reporting() & ~E_USER_DEPRECATED);

cli/php.ini

error_reporting = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_STRICT

Even though I see error_reporting() = 0 during debug, it still shows me those messages.

How to suppress Deprecated messages in Symfony 2.7?

2

2 Answers

3
votes

At the begining of your App.php

ini_set("error_reporting", E_ALL & ~E_USER_DEPRECATED);
0
votes

Managed to suppress Deprecated messages with passing error_reporting level to Debug::enable in app/console, as follows:

if ($debug) {
    Debug::enable(E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED);
}