Skip to content

Commit fc0362f

Browse files
committed
minor #18515 [Translation] Deprecate the PhpExtractor (javiereguiluz)
This PR was merged into the 6.2 branch. Discussion ---------- [Translation] Deprecate the PhpExtractor Related to #18507. Commits ------- 623f7fb [Translation] Deprecate the PhpExtractor
2 parents 3cb3f0f + 623f7fb commit fc0362f

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

reference/dic_tags.rst

+16-3
Original file line numberDiff line numberDiff line change
@@ -1071,9 +1071,22 @@ file
10711071

10721072
When executing the ``translation:extract`` command, it uses extractors to
10731073
extract translation messages from a file. By default, the Symfony Framework
1074-
has a :class:`Symfony\\Bridge\\Twig\\Translation\\TwigExtractor` and a
1075-
:class:`Symfony\\Component\\Translation\\Extractor\\PhpExtractor`, which
1076-
help to find and extract translation keys from Twig templates and PHP files.
1074+
has a :class:`Symfony\\Bridge\\Twig\\Translation\\TwigExtractor` and a PHP
1075+
extractor to find and extract translation keys from Twig templates and PHP files.
1076+
1077+
Symfony includes two PHP extractors: :class:`Symfony\\Component\\Translation\\Extractor\\PhpExtractor`
1078+
and :class:`Symfony\\Component\\Translation\\Extractor\\PhpAstExtractor`. The
1079+
first one is simple but doesn't require to install any packages; the second one
1080+
is much more advanced, but requires to install this dependency in your project:
1081+
1082+
.. code-block:: terminal
1083+
1084+
$ composer require nikic/php-parser
1085+
1086+
.. deprecated:: 6.2
1087+
1088+
The ``PhpExtractor`` class is deprecated since Symfony 6.2. The ``PhpAstExtractor``
1089+
class will be the only PHP extractor available starting from Symfony 7.0.
10771090

10781091
You can create your own extractor by creating a class that implements
10791092
:class:`Symfony\\Component\\Translation\\Extractor\\ExtractorInterface`

0 commit comments

Comments
 (0)