From c1b6f0cafab3020164344eccd5d3653c1ffe1cc1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 7 Jan 2026 15:53:26 +0100 Subject: [PATCH] Remove some outdated contents related to annotations --- bundles/extension.rst | 6 ++++++ cache.rst | 2 +- configuration/micro_kernel_trait.rst | 9 +++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/bundles/extension.rst b/bundles/extension.rst index d2792efc47..deba20e468 100644 --- a/bundles/extension.rst +++ b/bundles/extension.rst @@ -206,3 +206,9 @@ the full classmap executing the ``dump-autoload`` command of Composer. 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. + +.. deprecated:: 7.1 + + The ``addAnnotatedClassesToCompile()`` method was deprecated in Symfony 7.1 + and will be removed in Symfony 8.0. No alternative is provided because the + technique explained in this section is no longer necessary with modern PHP. diff --git a/cache.rst b/cache.rst index 9ed4984058..097d42e71d 100644 --- a/cache.rst +++ b/cache.rst @@ -47,7 +47,7 @@ When configuring the cache component there are a few concepts you should know: .. _cache-app-system: There are two pools that are always enabled by default. They are ``cache.app`` and -``cache.system``. The system cache is used for things like annotations, serializer, +``cache.system``. The system cache is used for things like the serializer, and validation. The ``cache.app`` can be used in your code. You can configure which adapter (template) they use by using the ``app`` and ``system`` key like: diff --git a/configuration/micro_kernel_trait.rst b/configuration/micro_kernel_trait.rst index 542532ee1a..aa1768fe73 100644 --- a/configuration/micro_kernel_trait.rst +++ b/configuration/micro_kernel_trait.rst @@ -211,8 +211,10 @@ events directly from the kernel, again it will be registered automatically:: } } -Advanced Example: Twig, Annotations and the Web Debug Toolbar -------------------------------------------------------------- +.. _advanced-example-twig-annotations-and-the-web-debug-toolbar: + +Advanced Example: Twig, Attributes and the Web Debug Toolbar +------------------------------------------------------------ The purpose of the ``MicroKernelTrait`` is *not* to have a single-file application. Instead, its goal is to give you the power to choose your bundles and structure. @@ -236,7 +238,7 @@ your ``composer.json`` file to load from there: Then, run ``composer dump-autoload`` to dump your new autoload config. Now, suppose you want to define a custom configuration for your app, -use Twig and load routes via annotations. Instead of putting *everything* +use Twig and load routes via attributes. Instead of putting *everything* in ``index.php``, create a new ``src/Kernel.php`` to hold the kernel. Now it looks like this:: @@ -301,7 +303,6 @@ Now it looks like this:: } // load the routes defined as PHP attributes - // (use 'annotation' as the second argument if you define routes as annotations) $routes->import(__DIR__.'/Controller/', 'attribute'); }