8000 Merge branch '2.7' into 2.8 · symfony/symfony-docs@95cd2d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95cd2d3

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Use PHP 5.5's ::class notation [#7243] minor tweak Deletes duplicate "Deprecated" and adds a more explicit example.
2 parents ce79cff + 85093fd commit 95cd2d3

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

contributing/code/conventions.rst

Lines changed: 20 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-
* @deprecated Deprecated since 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,22 @@ 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 ``trigger_error()`` call should be placed
116+
between the namespace and the use declarations, like in this example from
117+
`ArrayParserCache`_::
118+
119+
namespace Symfony\Component\ExpressionLanguage\ParserCache;
120+
121+
@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);
122+
123+
use Symfony\Component\ExpressionLanguage\ParsedExpression;
124+
125+
/**
126+
* @author Adrien Brault <adrien.brault@gmail.com>
127+
8000 *
128+
* @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.
129+
*/
130+
class ArrayParserCache implements ParserCacheInterface
131+
132+
.. _`ArrayParserCache`: https://github.com/symfony/symfony/blob/3.2/src/Symfony/Component/ExpressionLanguage/ParserCache/ArrayParserCache.php

form/dynamic_form_modification.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ and fill in the listener logic::
270270
use Symfony\Component\Form\Extension\Core\Type\TextType;
271271
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
272272
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
273-
274273
// ...
275274

276275
class FriendMessageFormType extends AbstractType

form/unit_testing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@ make sure the ``FormRegistry`` uses the created instance::
122122
// src/AppBundle/Tests/Form/Type/TestedTypeTests.php
123123
namespace AppBundle\Tests\Form\Type;
124124

125+
use AppBundle\Form\Type\TestedType;
125126
use Doctrine\Common\Persistence\ObjectManager;
126127
use Symfony\Component\Form\PreloadedExtension;
128+
use Symfony\Component\Form\Test\TypeTestCase;
127129
// ...
128130

129131
class TestedTypeTest extends TypeTestCase
@@ -175,6 +177,7 @@ allows you to return a list of extensions to register::
175177
namespace AppBundle\Tests\Form\Type;
176178

177179
// ...
180+
use AppBundle\Form\Type\TestedType;
178181
use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
179182
use Symfony\Component\Validator\ConstraintViolationList;
180183
use Symfony\Component\Validator\Validator\ValidatorInterface;
@@ -208,7 +211,6 @@ a good opportunity to use them::
208211
namespace AppBundle\Tests\Form\Type;
209212

210213
use AppBundle\Form\Type\TestedType;
211-
use AppBundle\Model\TestObject;
212214
use Symfony\Component\Form\Test\TypeTestCase;
213215

214216
class TestedTypeTest extends TypeTestCase

0 commit comments

Comments
 (0)
0