Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitc4d1f54

Browse files
committed
minor#7243 Removes duplicated Deprecated and adds an example. (dbrumann)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes#7243).Discussion----------Removes duplicated Deprecated and adds an example.Removes the duplicate "Deprecated" after `@deprecated` annotation as was asked in my PRsymfony/symfony#20735. Also adds a randomly selected example that shows how the abstract `XXX` should look like and an edge case of `trigger_error()` when deprecating a whole class.Commits-------a2c04e7 Deletes duplicate "Deprecated" and adds a more explicit example.
2 parents7cbf8be +a2c04e7 commitc4d1f54

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

‎contributing/code/conventions.rst‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ A feature is marked as deprecated by adding a ``@deprecated`` phpdoc to
9292
relevant classes, methods, properties, ...::
9393

9494
/**
95-
* @deprecatedDeprecatedsince version 2.8, to be removed in 3.0. Use XXX instead.
95+
* @deprecated since version 2.8, to be removed in 3.0. Use XXX instead.
9696
*/
9797

9898
The deprecation message should indicate the version when the class/method was
@@ -111,3 +111,21 @@ ready to cope with them (by adding a custom error handler like the one used by
111111
the Web Debug Toolbar or by the PHPUnit bridge).
112112

113113
.. _`@-silencing operator`:https://php.net/manual/en/language.operators.errorcontrol.php
114+
115+
When deprecating a whole class the error should be placed between namespace and
116+
use declarations, like in this example from `ArrayParserCache`_::
117+
118+
namespace Symfony\Component\ExpressionLanguage\ParserCache;
119+
120+
@trigger_error('The '.__NAMESPACE__.'\ArrayParserCache class is deprecated since version 3.2 and will be removed in 4.0. Use the Symfony\Component\Cache\Adapter\ArrayAdapter class instead.', E_USER_DEPRECATED);
121+
122+
use Symfony\Component\ExpressionLanguage\ParsedExpression;
123+
124+
/**
125+
* @author Adrien Brault <adrien.brault@gmail.com>
126+
*
127+
* @deprecated ArrayParserCache class is deprecated since version 3.2 and will be removed in 4.0. Use the Symfony\Component\Cache\Adapter\ArrayAdapter class instead.
128+
*/
129+
class ArrayParserCache implements ParserCacheInterface
130+
131+
.. _`ArrayParserCache`:https://github.com/symfony/symfony/blob/3.2/src/Symfony/Component/ExpressionLanguage/ParserCache/ArrayParserCache.php

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp