Skip to content

Commit 78eaf0d

Browse files
authored
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).
1 parent 106f088 commit 78eaf0d

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

configuration/micro_kernel_trait.rst

+3-15
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ Now it looks like this::
260260

261261
public function registerBundles(): iterable
262262
{
263-
yield FrameworkBundle();
264-
yield TwigBundle();
263+
yield new FrameworkBundle();
264+
yield new TwigBundle();
265265

266266
if ('dev' === $this->getEnvironment()) {
267-
yield WebProfilerBundle();
267+
yield new WebProfilerBundle();
268268
}
269269
}
270270

@@ -305,18 +305,6 @@ Now it looks like this::
305305
// (use 'annotation' as the second argument if you define routes as annotations)
306306
$routes->import(__DIR__.'/Controller/', 'attribute');
307307
}
308-
309-
// optional, to use the standard Symfony cache directory
310-
public function getCacheDir(): string
311-
{
312-
return __DIR__.'/../var/cache/'.$this->getEnvironment();
313-
}
314-
315-
// optional, to use the standard Symfony logs directory
316-
public function getLogDir(): string
317-
{
318-
return __DIR__.'/../var/log';
319-
}
320308
}
321309

322310
Before continuing, run this command to add support for the new dependencies:

0 commit comments

Comments
 (0)