Open theofidry opened 7 years ago
To make this clearer: right now we have the following:
<service id="nelmio_alice.data_loader" public="true"
alias="nelmio_alice.data_loader.simple" />
<service id="nelmio_alice.data_loader.simple"
class="Nelmio\Alice\Loader\SimpleDataLoader">
<argument type="service" id="nelmio_alice.fixture_builder" />
<argument type="service" id="nelmio_alice.generator" />
</service>
Instead we should have:
<service id="Nelmio\Alice\DataLoaderInterface" public="true"
alias="nelmio_alice.data_loader.simple" />
<service id="nelmio_alice.data_loader" public="true"
alias="Nelmio\Alice\DataLoaderInterface" />
<service id="nelmio_alice.data_loader.simple"
class="Nelmio\Alice\Loader\SimpleDataLoader">
<argument type="service" id="nelmio_alice.fixture_builder" />
<argument type="service" id="nelmio_alice.generator" />
</service>
/cc @greg0ire
I'm not sure old services names should be deprecated, at least for now.
This would be cleaner IMO:
<!-- to be deprecated -->
<service id="nelmio_alice.data_loader"
alias="Nelmio\Alice\Loader\SimpleDataLoader" />
<service id="nelmio_alice.data_loader.simple"
alias="Nelmio\Alice\Loader\SimpleDataLoader" />
<!-- define default service for interface -->
<service id="Nelmio\Alice\DataLoaderInterface" public="true"
alias="Nelmio\Alice\Loader\SimpleDataLoader" />
<service id="Nelmio\Alice\Loader\SimpleDataLoader"
class="Nelmio\Alice\Loader\SimpleDataLoader">
<argument type="service" id="nelmio_alice.fixture_builder" />
<argument type="service" id="nelmio_alice.generator" />
</service>
Adding support for autowiring would be a nice feature IMO with the coming Symfony 3.3. release. Plus making it work on the bundle would pave the way for adding a support for Laravel.