The video for this tutorial will be ready very soon!
Ideally, your outside bundles are no longer triggering deprecated warnings. Now it's
time to update our code for Symfony 3. This means finding deprecation warnings,
fixing them everywhere you can think of, and, well, repeating! It's pretty simple,
but sometimes the true source of a deprecation can be tricky to find.
Fortunately, there are 2 tools to help us. Google for Symfony Upgrade Fixer.
This is a sweet tool made by my good friend Saša. It tries to find deprecated code
and fix it for you. How nice!? It only supports a few things, but it aims to fix
the most annoying ones, like form changes.
Copy the wget line and paste it into your command line. Or just use that URL to
download the file manually. Copy the second permissions line to make that file
executable. Cool! Now we have a symfony-upgrade-fixer utility! Run it!
And then actually use it with fix and then . to fix this directory:
symfony-upgrade-fixer fix .
Behind the scenes, that's snooping through your project and writing new code for you.
Ding! It fixed two form classes:
This tool caught a few things, but there's a lot more. So... let's try another tool!
Google for Symfony Deprecation Detector.
This tool doesn't fix your project, but it detects more things than the first one.
Copy the clone command and run it in the terminal:
Boom! This correctly sees that 3 form types still have a getName() method, which
they should not have anymore. Go into AppBundle/Form, open up each form type,
and remove the getName() method from the bottom.