From 78eaf0d0715259cdc4c212b277861296ba552c0e Mon Sep 17 00:00:00 2001 From: Lucas Mlsna Date: Sat, 22 Mar 2025 23:33:16 -0500 Subject: [PATCH] Update micro_kernel_trait.rst Yielded classes in registerBundles() function example code require "new" keyword to work. Also removed getLogDir() and getCacheDir() functions in example code (these functions are already defined in an identical way by the parent class). --- configuration/micro_kernel_trait.rst | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/configuration/micro_kernel_trait.rst b/configuration/micro_kernel_trait.rst index 62e8c2d4128..dbe8d1b27b9 100644 --- a/configuration/micro_kernel_trait.rst +++ b/configuration/micro_kernel_trait.rst @@ -260,11 +260,11 @@ Now it looks like this:: public function registerBundles(): iterable { - yield FrameworkBundle(); - yield TwigBundle(); + yield new FrameworkBundle(); + yield new TwigBundle(); if ('dev' === $this->getEnvironment()) { - yield WebProfilerBundle(); + yield new WebProfilerBundle(); } } @@ -305,18 +305,6 @@ Now it looks like this:: // (use 'annotation' as the second argument if you define routes as annotations) $routes->import(__DIR__.'/Controller/', 'attribute'); } - - // optional, to use the standard Symfony cache directory - public function getCacheDir(): string - { - return __DIR__.'/../var/cache/'.$this->getEnvironment(); - } - - // optional, to use the standard Symfony logs directory - public function getLogDir(): string - { - return __DIR__.'/../var/log'; - } } Before continuing, run this command to add support for the new dependencies: