How agussuroyo/container works
This is a small PHP dependency-injection library. An application calls get() to receive a cached instance, a bound factory result, or an auto-wired object. Auto-wiring reflects on the class constructor and recursively asks the container to resolve class-typed parameters, using defaults where available. make() bypasses the instance cache; binding, binding checks, and cache clearing are separate container operations. Runtime behavior is concentrated in src/Container.php; the README documents these capabilities, but no separate implementation modules are present.
Main entry points: Container.php Get instance
Components 11
Other components
- Application
- Container
src/Container.php - Get instance
src/Container.php - Bind mapping
src/Container.php - Instance cache
src/Container.php - Make instance
src/Container.php - PHP reflection
- Resolve dependencies
src/Container.php - Bound factory
- Check binding
src/Container.php - Clear cache
src/Container.php
Connections 18
- Application → Get instance: requests instance
- Application → Make instance: requests fresh
- Application → Bind mapping: registers binding
- Application → Check binding: checks binding
- Application → Clear cache: clears cache
- Get instance → Instance cache: checks and stores
- Get instance → Bind mapping: looks up binding
- Get instance → Bound factory: invokes bound factory
- Get instance → Make instance: auto-resolves
- Get instance → Application: returns instance
- Bind mapping → Container: stores mapping
- Make instance → PHP reflection: inspects class
- Make instance → Resolve dependencies: resolves constructor args
- PHP reflection → Make instance: provides class metadata
- Resolve dependencies → Get instance: resolves class parameters
- Clear cache → Instance cache: removes instances
- Check binding → Bind mapping: checks mapping
- Check binding → Instance cache: checks instance