Skip to content

Commit

Permalink
Merge pull request #7803 from cakephp/5.x-dic
Browse files Browse the repository at this point in the history
remove info about cyclic dependency problem in auto-wiring DIC feature
  • Loading branch information
markstory authored Jan 24, 2024
2 parents 73343c3 + 35365d6 commit b752149
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions en/development/dependency-injection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,11 @@ Auto Wiring is turned off by default. To enable it::
// In src/Application.php
public function services(ContainerInterface $container): void
{
$container->add(\Cake\Controller\ComponentRegistry::class);
$container->delegate(
new \League\Container\ReflectionContainer()
);
}

The ``$container->add(\Cake\Controller\ComponentRegistry::class);`` is needed to
fix a cyclic dependency between ``ComponentRegistry`` and ``Controller``.

While your dependencies will now be resolved automatically, this approach will
not cache resolutions which can be detrimental to performance. To enable
caching::
Expand Down

0 comments on commit b752149

Please sign in to comment.