How to wire two different services, implementing same interface based on environment in symfony 7

  Kiến thức lập trình

I am trying to wire two different Adapter services, which implement the same interface.
But still using when@dev clause dont work in this case

    AppMocksAdapterExampleAdapterMock: ~
    AppAdapterExampleAdapter: ~

    AppAdapterExampleAdapterInterface: '@AppMocksAdapterExampleAdapterMock' ``

when@dev:
    services:
        AppAdapterExampleAdapterInterface: '@AppMocksAdapterExampleAdapterMock'

when@prod: &prod_adapter
    services:
        AppAdapterExampleAdapterInterface: '@AppAdapterExampleAdapter'

when@qas: *prod_adapter

LEAVE A COMMENT