From 2a3e7d2cc9ccfe02de6c5b705cb7d015db05c151 Mon Sep 17 00:00:00 2001 From: Hugo Hamon Date: Tue, 30 Dec 2014 13:40:50 +0100 Subject: [PATCH] Normalizes deprecation notice messages. --- .../Templating/Helper/RequestHelper.php | 2 +- .../Templating/Helper/SessionHelper.php | 2 +- src/Symfony/Bundle/TwigBundle/TwigEngine.php | 7 ++++--- .../ClassLoader/ApcUniversalClassLoader.php | 5 ++++- src/Symfony/Component/ClassLoader/CHANGELOG.md | 5 ----- .../ClassLoader/DebugUniversalClassLoader.php | 5 ++++- .../ClassNotFoundFatalErrorHandler.php | 2 +- .../HttpFoundation/Session/Flash/FlashBag.php | 2 +- .../Storage/Handler/LegacyPdoSessionHandler.php | 4 ++-- .../HttpKernel/EventListener/ExceptionListener.php | 2 +- .../HttpKernel/EventListener/RouterListener.php | 2 +- .../Component/Serializer/Encoder/JsonDecode.php | 3 ++- .../Component/Serializer/Encoder/JsonEncode.php | 3 ++- .../Component/Serializer/Encoder/JsonEncoder.php | 4 ++-- .../Validator/Constraints/GroupSequence.php | 12 ++++++------ .../Context/LegacyExecutionContextFactory.php | 2 +- src/Symfony/Component/Validator/ExecutionContext.php | 2 +- .../Component/Validator/Mapping/ClassMetadata.php | 2 +- 18 files changed, 35 insertions(+), 31 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php index 297b2884f6..4aba0c202f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php @@ -30,7 +30,7 @@ class RequestHelper extends Helper * * @param Request|RequestStack $requestStack A RequestStack instance or a Request instance * - * @deprecated since version 2.5, passing a Request instance is deprecated and support for it will be removed in 3.0 + * @deprecated since version 2.5, passing a Request instance is deprecated and support for it will be removed in 3.0. */ public function __construct($requestStack) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php index b23a26fe22..3558b9ce04 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php @@ -30,7 +30,7 @@ class SessionHelper extends Helper * * @param Request|RequestStack $requestStack A RequestStack instance or a Request instance * - * @deprecated since version 2.5, passing a Request instance is deprecated and support for it will be removed in 3.0 + * @deprecated since version 2.5, passing a Request instance is deprecated and support for it will be removed in 3.0. */ public function __construct($requestStack) { diff --git a/src/Symfony/Bundle/TwigBundle/TwigEngine.php b/src/Symfony/Bundle/TwigBundle/TwigEngine.php index 324cd34fc9..493d70dae2 100644 --- a/src/Symfony/Bundle/TwigBundle/TwigEngine.php +++ b/src/Symfony/Bundle/TwigBundle/TwigEngine.php @@ -42,8 +42,8 @@ class TwigEngine extends BaseEngine implements EngineInterface } /** - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Inject the escaping - * strategy on Twig_Environment instead + * @deprecated since version 2.3, to be removed in 3.0. + * Inject the escaping strategy on \Twig_Environment instead. */ public function setDefaultEscapingStrategy($strategy) { @@ -51,7 +51,8 @@ class TwigEngine extends BaseEngine implements EngineInterface } /** - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use TwigDefaultEscapingStrategy instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use TwigDefaultEscapingStrategy instead. */ public function guessDefaultEscapingStrategy($filename) { diff --git a/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php b/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php index 65b7b10b23..dd95413caf 100644 --- a/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php +++ b/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php @@ -11,6 +11,8 @@ namespace Symfony\Component\ClassLoader; +trigger_error('The '.__NAMESPACE__.'\ApcUniversalClassLoader class is deprecated since version 2.7 and will be removed in 3.0. Use the Symfony\Component\ClassLoader\ApcClassLoader class instead.', E_USER_DEPRECATED); + /** * ApcUniversalClassLoader implements a "universal" autoloader cached in APC for PHP 5.3. * @@ -60,7 +62,8 @@ namespace Symfony\Component\ClassLoader; * * @api * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. Use the ApcClassLoader class instead. + * @deprecated since version 2.4, to be removed in 3.0. + * Use the {@link ClassLoader} class instead. */ class ApcUniversalClassLoader extends UniversalClassLoader { diff --git a/src/Symfony/Component/ClassLoader/CHANGELOG.md b/src/Symfony/Component/ClassLoader/CHANGELOG.md index 211af2eff4..64660a8768 100644 --- a/src/Symfony/Component/ClassLoader/CHANGELOG.md +++ b/src/Symfony/Component/ClassLoader/CHANGELOG.md @@ -1,11 +1,6 @@ CHANGELOG ========= -2.7.0 ------ - - * The UniversalClassLoader class has been deprecated in favor of ClassLoader class - 2.4.0 ----- diff --git a/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php b/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php index 40d847c178..2a102dbbf4 100644 --- a/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php +++ b/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php @@ -11,12 +11,15 @@ namespace Symfony\Component\ClassLoader; +trigger_error('The '.__NAMESPACE__.'\DebugUniversalClassLoader class is deprecated since version 2.4 and will be removed in 3.0. Use the Symfony\Component\Debug\DebugClassLoader class instead.', E_USER_DEPRECATED); + /** * Checks that the class is actually declared in the included file. * * @author Fabien Potencier * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. Use the DebugClassLoader provided by the Debug component instead. + * @deprecated since version 2.4, to be removed in 3.0. + * Use the {@link \Symfony\Component\Debug\DebugClassLoader} class instead. */ class DebugUniversalClassLoader extends UniversalClassLoader { diff --git a/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php b/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php index c75f17edff..2af0859792 100644 --- a/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php +++ b/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php @@ -101,7 +101,7 @@ class ClassNotFoundFatalErrorHandler implements FatalErrorHandlerInterface if ($function[0] instanceof DebugClassLoader) { $function = $function[0]->getClassLoader(); - // Since 2.5, returning an object from DebugClassLoader::getClassLoader() is @deprecated + // @deprecated since version 2.5. Returning an object from DebugClassLoader::getClassLoader() is deprecated. if (is_object($function)) { $function = array($function); } diff --git a/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php b/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php index b8a62bb07f..bbe7561be7 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php +++ b/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php @@ -169,7 +169,7 @@ class FlashBag implements FlashBagInterface, \IteratorAggregate /** * Returns an iterator for flashes. * - * @deprecated Will be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. * * @return \ArrayIterator An \ArrayIterator instance */ diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php index 6f89f38077..fd0c58275d 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php @@ -11,6 +11,8 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; +trigger_error('The '.__NAMESPACE__.'\LegacyPdoSessionHandler class is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler class instead.', E_USER_DEPRECATED); + /** * Session handler using a PDO connection to read and write data. * @@ -77,8 +79,6 @@ class LegacyPdoSessionHandler implements \SessionHandlerInterface throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __CLASS__)); } - trigger_error('"Symfony\Component\HttpFoundation\Session\Storage\Handler\LegacyPdoSessionHandler" is deprecated since version 2.6 and will be removed in 3.0. Use "Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler" instead.', E_USER_DEPRECATED); - $this->pdo = $pdo; $dbOptions = array_merge(array( 'db_id_col' => 'sess_id', diff --git a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php index 5b0ec0ec50..46c298e1b8 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php @@ -116,7 +116,7 @@ class ExceptionListener implements EventSubscriberInterface 'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null, // keep for BC -- as $format can be an argument of the controller callable // see src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php - // @deprecated in 2.4, to be removed in 3.0 + // @deprecated since version 2.4, to be removed in 3.0 'format' => $request->getRequestFormat(), ); $request = $request->duplicate(null, null, $attributes); diff --git a/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php b/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php index 10ed27cd7b..a116e55e88 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php @@ -86,7 +86,7 @@ class RouterListener implements EventSubscriberInterface * * @param Request|null $request A Request instance * - * @deprecated since version 2.4, to be moved to a private function in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function setRequest(Request $request = null) { diff --git a/src/Symfony/Component/Serializer/Encoder/JsonDecode.php b/src/Symfony/Component/Serializer/Encoder/JsonDecode.php index 408ce07e3f..14c1a752c9 100644 --- a/src/Symfony/Component/Serializer/Encoder/JsonDecode.php +++ b/src/Symfony/Component/Serializer/Encoder/JsonDecode.php @@ -55,7 +55,8 @@ class JsonDecode implements DecoderInterface * * @return int * - * @deprecated since version 2.5, decode() throws an exception if error found, will be removed in 3.0 + * @deprecated since version 2.5, to be removed in 3.0. + * The {@self decode()} method throws an exception if error found. * * @see http://php.net/manual/en/function.json-last-error.php json_last_error */ diff --git a/src/Symfony/Component/Serializer/Encoder/JsonEncode.php b/src/Symfony/Component/Serializer/Encoder/JsonEncode.php index f80072956e..76345bed69 100644 --- a/src/Symfony/Component/Serializer/Encoder/JsonEncode.php +++ b/src/Symfony/Component/Serializer/Encoder/JsonEncode.php @@ -33,7 +33,8 @@ class JsonEncode implements EncoderInterface * * @return int * - * @deprecated since version 2.5, encode() throws an exception if error found, will be removed in 3.0 + * @deprecated since version 2.5, to be removed in 3.0. + * The {@self encode()} throws an exception if error found. * * @see http://php.net/manual/en/function.json-last-error.php json_last_error */ diff --git a/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php b/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php index 18d27a554b..1f7a1fb0e3 100644 --- a/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php @@ -41,7 +41,7 @@ class JsonEncoder implements EncoderInterface, DecoderInterface * * @return int * - * @deprecated since version 2.5, JsonEncode throws exception if an error is found, will be removed in 3.0 + * @deprecated since version 2.5, to be removed in 3.0. JsonEncode throws exception if an error is found. */ public function getLastEncodingError() { @@ -55,7 +55,7 @@ class JsonEncoder implements EncoderInterface, DecoderInterface * * @return int * - * @deprecated since version 2.5, JsonDecode throws exception if an error is found, will be removed in 3.0 + * @deprecated since version 2.5, to be removed in 3.0. JsonDecode throws exception if an error is found. */ public function getLastDecodingError() { diff --git a/src/Symfony/Component/Validator/Constraints/GroupSequence.php b/src/Symfony/Component/Validator/Constraints/GroupSequence.php index 9a3cad2581..52d7539431 100644 --- a/src/Symfony/Component/Validator/Constraints/GroupSequence.php +++ b/src/Symfony/Component/Validator/Constraints/GroupSequence.php @@ -103,7 +103,7 @@ class GroupSequence implements \ArrayAccess, \IteratorAggregate, \Countable * * @see \IteratorAggregate::getIterator() * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function getIterator() { @@ -121,7 +121,7 @@ class GroupSequence implements \ArrayAccess, \IteratorAggregate, \Countable * * @return bool Whether the offset exists * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function offsetExists($offset) { @@ -141,7 +141,7 @@ class GroupSequence implements \ArrayAccess, \IteratorAggregate, \Countable * * @throws OutOfBoundsException If the object does not exist * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function offsetGet($offset) { @@ -165,7 +165,7 @@ class GroupSequence implements \ArrayAccess, \IteratorAggregate, \Countable * @param int $offset The offset * @param string $value The group name * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function offsetSet($offset, $value) { @@ -187,7 +187,7 @@ class GroupSequence implements \ArrayAccess, \IteratorAggregate, \Countable * * @param int $offset The offset * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function offsetUnset($offset) { @@ -203,7 +203,7 @@ class GroupSequence implements \ArrayAccess, \IteratorAggregate, \Countable * * @return int The number of groups * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function count() { diff --git a/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php b/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php index 9b225636e2..9ca93bc8fd 100644 --- a/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php +++ b/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Validator\Context; -trigger_error('The '.__NAMESPACE__.'\LegacyExecutionContextFactory is deprecated since version 2.5 and will be removed in 3.0.'); +trigger_error('The '.__NAMESPACE__.'\LegacyExecutionContextFactory is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\MetadataFactoryInterface; diff --git a/src/Symfony/Component/Validator/ExecutionContext.php b/src/Symfony/Component/Validator/ExecutionContext.php index 2469c389eb..d21dd780f1 100644 --- a/src/Symfony/Component/Validator/ExecutionContext.php +++ b/src/Symfony/Component/Validator/ExecutionContext.php @@ -23,7 +23,7 @@ use Symfony\Component\Translation\TranslatorInterface; * @author Fabien Potencier * @author Bernhard Schussek * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Context\ExecutionContext} instead. */ class ExecutionContext implements ExecutionContextInterface diff --git a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php index 72e0cec99c..ab945f0c30 100644 --- a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php @@ -373,7 +373,7 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface * * @param MemberMetadata $metadata * - * @deprecated since version 2.6, to be in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ protected function addMemberMetadata(MemberMetadata $metadata) {