Skip to content

[DI][DX] Raise a warning at build-time if lazy=true is encountered, but ProxyManager bridge is not present #27865

Closed
@dkarlovi

Description

@dkarlovi

Description

The docs says:

NOTE
If you don't install the ProxyManager bridge and the ocramius/proxy-manager, the container will just skip over the lazy flag and simply instantiate the service as it would normally do.

This detail is vital to the functionality of lazy services (which might be yours or 3rd-party bundles', relying on it for specific features) and having it silently not working is confusing at best.

I propose DI raises a build-time warning for each lazy=true service if the bridge is not present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)DependencyInjection

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions