The first Long Term Support version of Symfony2 will be 2.3, to be released in May 2013. In the meantime, we are in a race where we try to finish and polish everything as we won't allow BC breaks after 2.3 without a very good reason (a security issue for instance). So, since 2.0, instead of just replacing or removing existing features, we deprecate them and they will be removed in 2.3.

But how can you track those deprecated features? Of course, the CHANGELOGs and the UPGRADE file mention all the BC breaks and the deprecated features. But the code itself also contains some hints about deprecated methods and classes as they are tagged with @deprecated. But what if you miss some occurrences in your code? Will your code explode when upgrading to 2.3? The short answer is yes.

Colin Frei
Contributed by Colin Frei in #6173 and #6180

So, to provide a smoother transition, Symfony 2.2 introduces a new feature: the logging of deprecated calls. Whenever you call a deprecated method or whenever you create an instance of a deprecated class, Symfony will now log the call and alert you in the debug toolbar:

Deprecated calls logged in the web debug toolbar

Victor Berchet
Contributed by Victor Berchet in #6232

That's really nice, but there is more. You can also go to the web profiler, and the log panel will tell you exactly where the call occurred:

Deprecated calls logged in the profiler

And if you have some functional tests, or just by browsing your application manually, you can automate everything by parsing the Symfony log file:

1
2
3
4
5
6
[2012-12-17 11:24:03] deprecation.WARNING: foo {
    "type":-100,
    "file":"/path/to/Controller/SomeController.php",
    "line":37,
    "stack":[/* stack trace not show here */]
}
Published in #Living on the edge