Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony 3.4: How to get a list of all Deprecated warnings?

I have quite a big project in Symfony 3.4 and I wish to update to Symfony 4.
And I get a lot of deprecation warnings. Which is ok I need to fix those, but I cant check each route for my site... there is too many.

Is there a way to get all the depreciation for Symfony 3.4 in my project?

like image 780
NaGeL182 Avatar asked Feb 28 '18 12:02

NaGeL182


3 Answers

I use the sensiolabs-de/deprecation-detector first to find a lot of them but you never cover them all with that tool.

After that, you can go trough the .md files in your Symfony project, they are located at

  • vendor/symfony/symfony/UPGRADE-3.0.md
  • vendor/symfony/symfony/UPGRADE-3.1.md
  • vendor/symfony/symfony/UPGRADE-3.2.md
  • vendor/symfony/symfony/UPGRADE-3.3.md
  • vendor/symfony/symfony/UPGRADE-3.4.md
  • vendor/symfony/symfony/UPGRADE-4.0.md

Or you can read them online https://github.com/symfony/symfony/tree/3.4

Start with the first one (3.0). Take your time and read carefully.

Make use of a good tool to search your Symfony project (PHPStorm, Netbeans, Sublime, ...)

Everything should be in there, good luck!

When you have a good IDE (like PHPStorm) you can use its code inspection tool. I just inspected the src code of a legacy project in PHPStorm and got this as result:

PHPStorm inspection result

So still a lot of work to do ;)

like image 157
Julesezaar Avatar answered Nov 10 '22 03:11

Julesezaar


may be this will help you to get all deprications:

composer global require sensiolabs-de/deprecation-detector
$ deprecation-detector check src/ vendor/
$ deprecation-detector check src/ composer.lock

You can look here for more information: https://github.com/sensiolabs-de/deprecation-detector

like image 41
l13 Avatar answered Nov 10 '22 01:11

l13


This is how you scan your files for deprecated code:

$ git clone [email protected]:sensiolabs-de/deprecation-detector.git
$ cd deprecation-detector
$ composer install
$ ./bin/deprecation-detector check /path/to/your-project/src /path/to/your-project/vendor

Source Paving the way for Symfony 3 with the "Deprecation Detector" tool

like image 1
Achraf JEDAY Avatar answered Nov 10 '22 01:11

Achraf JEDAY