If the bundle defines services, they must be prefixed with the bundle alias instead of using fully qualified class names like you do in your project services. For example, AcmeBlogBundle services must be prefixed with acme_blog. The reason is that bundles shouldn’t rely on features such as service autowiring or autoconfiguration to not impose an overhead when compiling application services.
In addition, services not meant to be used by the application directly, should be defined as private. For public services, aliases should be created from the interface/class to the service id. For example, in MonologBundle, an alias is created from Psr\Log\LoggerInterface to logger so that the LoggerInterface type-hint can be used for autowiring.
Services should not use autowiring or autoconfiguration. Instead, all services should be defined explicitly.
~Security which is registered by symfony/security-bundle which is not a dependency (BTW looks like security.token_storage could be used instead).~ I would leave the Security service as it is for now.
Following https://symfony.com/doc/current/bundles/best_practices.html#services:
It would be nice to follow these practices in:
https://github.com/KnpLabs/DoctrineBehaviors/blob/16cf5617882d4e5828215f2018cb58b3d24c0ee7/config/services.php#L17-L20
I could give it a try if this is fine, the only problem I see is that
UserProvider
is using:https://github.com/KnpLabs/DoctrineBehaviors/blob/16cf5617882d4e5828215f2018cb58b3d24c0ee7/src/Provider/UserProvider.php#L12-L16
~
Security
which is registered bysymfony/security-bundle
which is not a dependency (BTW looks likesecurity.token_storage
could be used instead).~ I would leave theSecurity
service as it is for now.