henderjon / chevron-containers
an implementation of the registry pattern for fun and profit
Requires
- php: >=5.4.0
- chevron/objectloader: ~1.0
Requires (Dev)
- phpunit/phpunit: ~4.0
README
Containers is a simple implementation of a registry pattern. The base container takes values and returns them, the deferred container is built to handle callables, and the reference container is meant to handle maps--wait for it--by reference.
Containers started as a pretty basic set of registry objects because you end up using them everywhere. Deferred, however, ended up making a pretty good simple DI container. But "Deferred" isn't as intuitive as "Di", which is why there is a DiInterface (for typehints) and a ServiceLoader for creating and populating the Di.
Peruse the tests or, if present, the examples directory to see usage.
See packagist for version/installation info.