Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[2.7] adds deprecation notices. #13060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jan 5, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Normalizes deprecation notice messages.
  • Loading branch information
Hugo Hamon committed Jan 5, 2015
commit 2a3e7d2cc9ccfe02de6c5b705cb7d015db05c151
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
7 changes: 4 additions & 3 deletions 7 src/Symfony/Bundle/TwigBundle/TwigEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ public function __construct(\Twig_Environment $environment, TemplateNameParserIn
}

/**
* @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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a deprecation warning in it (TwigBundle does not call this method anymore. It sets the strategy directly in Twig)

{
$this->environment->getExtension('escaper')->setDefaultStrategy($strategy);
}

/**
* @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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, this message should mention the patch version of 2.3, because TwigDefaultEscapingStrategy does not exist in 2.3.0. It was added in a recent patch version to fix a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain more, I don't understand what you're meaning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message is completely wrong, isn't it? As this deprecation was done 6 days ago, meaning in 2.7-dev: #13141 The message states version 2.3 already deprecated it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deprecation is in 2.3 branch... Which deprecation message shall we set instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, my bad. It was merged in 2.3 indeed.

However, and this is what @stof also meant, it's not deprecated in 2.3.0. It's going to be deprecated in 2.3.24 (the next symfony 2.3.x release). So the message should actually say:

@deprecated since version 2.3.24, to be removed in 3.0.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it was deprecated in a patch version it was a mistake imo. we should not do that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should mark it as deprecated from 2.7 only (given it is the first minor version which will have the new method from the start, even though the method is not used by Symfony even in older versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's mark it as deprecated since 2.7 then.

* Use TwigDefaultEscapingStrategy instead.
*/
public function guessDefaultEscapingStrategy($filename)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a warning here (TwigBundle does not use the deprecated method anymore.

{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -60,7 +62,8 @@
*
* @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
{
Expand Down
5 changes: 0 additions & 5 deletions 5 src/Symfony/Component/ClassLoader/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
CHANGELOG
=========

2.7.0
-----

* The UniversalClassLoader class has been deprecated in favor of ClassLoader class

2.4.0
-----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <fabien@symfony.com>
*
* @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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private function getClassCandidates($class)
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function clear()
/**
* 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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -77,8 +79,6 @@ public function __construct(\PDO $pdo, array $dbOptions = array())
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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ protected function duplicateRequest(\Exception $exception, Request $request)
'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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function __construct($matcher, RequestContext $context = null, LoggerInte
*
* @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)
{
Expand Down
3 changes: 2 additions & 1 deletion 3 src/Symfony/Component/Serializer/Encoder/JsonDecode.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public function __construct($associative = false, $depth = 512)
*
* @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
*/
Expand Down
3 changes: 2 additions & 1 deletion 3 src/Symfony/Component/Serializer/Encoder/JsonEncode.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public function __construct($bitmask = 0)
*
* @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
*/
Expand Down
4 changes: 2 additions & 2 deletions 4 src/Symfony/Component/Serializer/Encoder/JsonEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(JsonEncode $encodingImpl = null, JsonDecode $decodin
*
* @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()
{
Expand All @@ -55,7 +55,7 @@ public function getLastEncodingError()
*
* @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()
{
Expand Down
12 changes: 6 additions & 6 deletions 12 src/Symfony/Component/Validator/Constraints/GroupSequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function __construct(array $groups)
*
* @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()
{
Expand All @@ -121,7 +121,7 @@ public function getIterator()
*
* @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)
{
Expand All @@ -141,7 +141,7 @@ public function offsetExists($offset)
*
* @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)
{
Expand All @@ -165,7 +165,7 @@ public function offsetGet($offset)
* @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)
{
Expand All @@ -187,7 +187,7 @@ public function offsetSet($offset, $value)
*
* @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)
{
Expand All @@ -203,7 +203,7 @@ public function offsetUnset($offset)
*
* @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()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be removed, because Symfony uses this class all the time to be able to use the BC layer.


use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\MetadataFactoryInterface;
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/Validator/ExecutionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @author Fabien Potencier <fabien@symfony.com>
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @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
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/Validator/Mapping/ClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public function mergeConstraints(ClassMetadata $source)
*
* @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)
{
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.