diff --git a/bundles/extension.rst b/bundles/extension.rst index d2792efc477..f3cc943e515 100644 --- a/bundles/extension.rst +++ b/bundles/extension.rst @@ -169,40 +169,3 @@ Using Configuration to Change the Services The Extension is also the class that handles the configuration for that particular bundle (e.g. the configuration in ``config/packages/.yaml``). To read more about it, see the ":doc:`/bundles/configuration`" article. - -Adding Classes to Compile -------------------------- - -Bundles can hint Symfony about which of their classes contain annotations so -they are compiled when generating the application cache to improve the overall -performance. Define the list of annotated classes to compile in the -``addAnnotatedClassesToCompile()`` method:: - - public function load(array $configs, ContainerBuilder $container): void - { - // ... - - $this->addAnnotatedClassesToCompile([ - // you can define the fully qualified class names... - 'Acme\\BlogBundle\\Controller\\AuthorController', - // ... but glob patterns are also supported: - 'Acme\\BlogBundle\\Form\\**', - - // ... - ]); - } - -.. note:: - - If some class extends from other classes, all its parents are automatically - included in the list of classes to compile. - -Patterns are transformed into the actual class namespaces using the classmap -generated by Composer. Therefore, before using these patterns, you must generate -the full classmap executing the ``dump-autoload`` command of Composer. - -.. warning:: - - This technique can't be used when the classes to compile use the ``__DIR__`` - or ``__FILE__`` constants, because their values will change when loading - these classes from the ``classes.php`` file.