Deprecating changes for 1 release instead of removing #383
Description
What do you feel about 'officially' deprecating methods that are to be removed? (Where reasonably possible).
For example:
share Method Removed - The share method has been removed from the container. This was a legacy method that has not been documented in several years.
Instead of removing them directly, can't we deprecate them first, for a single release?
Similar to Symfony; http://symfony.com/doc/current/contributing/code/conventions.html#deprecations
A feature is marked as deprecated by adding a
@deprecated
phpdoc to relevant classes, methods, properties, ...:
/**
* @deprecated since version 2.8, to be removed in 3.0. Use XXX instead.
*/
A PHP E_USER_DEPRECATED error must also be triggered to help people with the migration starting one or two minor versions before the version where the feature will be removed (depending on the criticality of the removal):
@trigger_error('XXX() is deprecated since version 2.8 and will be removed in 3.0. Use XXX instead.', E_USER_DEPRECATED);
So trigger a silent deprecation error, and add a custom error listener to show them only in dev mode, log them, show them in de debugbar etc.
This would ease the transition between upgrades for application AND packages.
(And if a half year is too long, perhaps start deprecating them half-cycle as they occur, so you will at least receive them earlier)