Lately, I’ve been playing quite a lot with the notion of container definition interoperability.
Container definition interoperability? Why?
The problem we are trying to solve is the problem of packages interoperability between frameworks. Have a look at this packagist search for the "Glide" library.
See? There is the code for Glide, and then, there are a million of small libraries that provide Glide services for each framework out there (laravel-glide, glide-symfony, yii2-glide, cakephp-glide, lumen-glide...) It doesn't make any sense! Package writers are loosing precious time writing spaghetti code for each framework out there. This needs to be fixed.
But each framework out there has its own format (or uses PHP directly), so it will be hard to have everybody agree on a single file format for services, right?
That's why we are proposing a common set of interfaces that describe a container entry.
The final goal is the ability for any PHP package (on Composer) to provide the container of your application with a set a container definitions. The container of your application can then take these definitions and turn them into actual container entries.
You can have a look at the proposed interfaces on the definition-interop project (work in progress)
Objects implementing the definition-interop interfaces are meant to be consumed by a container (or even better, by a compiler that generates an optimized container).
Actually, in definition-interop, containers are consuming definition providers which are objects providing a set of definitions.
Wanna have a look at a definition provider written in pure PHP? Have a look at this provide for the Glide library. It is written using the Assembly library that provides definitions implementing definition-interop.