Paving the way for Symfony 3 with the "Deprecation Detector" tool
October 21, 2015 • Published by Javier Eguiluz
Symfony 3 will be released at the end of November 2015. Learning from our own history, the transition from Symfony 2 to 3 will be much more pleasant than the transition from symfony 1 to 2 that happened in July 2011.
Technically speaking, Symfony 3 includes no new features comparing it with Symfony 2.8, which will be released at the same time. The main change introduced by Symfony 3 is that any feature, option or behavior marked as deprecated in 2.8 version will be removed.
This means that your Symfony applications won't work on Symfony 3 unless you remove all their deprecations. In order to simplify the task of finding which deprecations affect your applications, a new tool called Deprecation Detector has just been released.
This command console application runs a static code analysis against your
project's source code to find usages of deprecated methods, classes, interfaces
and services. Specifically, it identifies the use of deprecated code thanks to
the @deprecated
annotation.
Although this tool is still in a very early stage of development, you can already test it in your own applications:
1 2 3 4
$ git clone git@github.com:sensiolabs-de/deprecation-detector.git
$ cd deprecation-detector
$ composer install
$ ./bin/deprecation-detector check /path/to/your-project/src /path/to/your-project/vendor
Tip
Since you are probably going to use this tool very frequently, it's better to build a PHAR file and install it globally, as explained in its documentation.
Deprecation Detector is a project developed by the team at SensioLabs Deutschland, maintained by Marvin Klemp and published as Open Source. Your issues and pull requests are more than welcome to improve the project.
Help the Symfony project!
As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.
Comments are closed.
To ensure that comments stay relevant, they are closed for old posts.
There may be a typo ? "composer install" should come after "cd deprecation-detector" ?
11:42 $ ./bin/deprecation-detector check -vvv examples/
Checking your application for deprecations - this could take a while ...
Loading rule sets: 27/27
Checking files for deprecations: 8/8
There are no violations - congratulations!
Checked source files in 1.981 seconds, 7 MB memory used
✔ ~/deprecation-detector [master|✔]
$ cd project_directory/
$ /path/to/deprecation-detector check