Skip to content

Instantly share code, notes, and snippets.

@javiereguiluz
Last active May 3, 2017 18:21
Show Gist options
  • Save javiereguiluz/a5514ec6cde2a63be441 to your computer and use it in GitHub Desktop.
Save javiereguiluz/a5514ec6cde2a63be441 to your computer and use it in GitHub Desktop.
How to add a deprecation note about Symfony features

In order to generate and log a warning message about a deprecated Symfony feature, use the trigger_error() function as follows:

trigger_error('The enctype method of the form helper was removed. You should use the new method start instead.', E_USER_DEPRECATED);

Please, be as explicit as possible in the deprecation message and always explain the alternative way to use that feature, property, method or class.

@xabbuh
Copy link

xabbuh commented Nov 29, 2014

@CalinBolea noticed that we also have a part about deprecations in the contribution docs: http://symfony.com/doc/current/contributing/code/conventions.html#deprecations

@h4cc
Copy link

h4cc commented Nov 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment