Skip to content

Commit 984f8e9

Browse files
authored
Provided reasoning as to why not use autowiring in public reusable bundles
1 parent 5fcedb6 commit 984f8e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

service_container/autowiring.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,9 @@ Public and Reusable Bundles
506506
---------------------------
507507

508508
Public bundles should explicitly configure their services and not rely on autowiring.
509+
Autowiring depends on the services that are available in the container and bundles have
510+
no control over the service container of apps they are included in. You can use autowiring
511+
when building reusable bundles within your company, as you have full control over all code.
509512

510513
.. _ROT13: https://en.wikipedia.org/wiki/ROT13
511514
.. _service definition prototype: https://symfony.com/blog/new-in-symfony-3-3-psr-4-based-service-discovery

0 commit comments

Comments
 (0)