8000 [Translation] Deprecate the PhpExtractor · symfony/symfony-docs@623f7fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 623f7fb

8000 Browse files
committed
[Translation] Deprecate the PhpExtractor
1 parent 2174905 commit 623f7fb

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

reference/dic_tags.rst

Lines changed: 16 additions & 3 deletions
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)
0