Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexzvn/container-di
Simple IoC container with some method: bind, singleton, resolve, make.
https://github.com/alexzvn/container-di
composer ioc-container php-library php7 singleton
Last synced: 13 days ago
JSON representation
Simple IoC container with some method: bind, singleton, resolve, make.
- Host: GitHub
- URL: https://github.com/alexzvn/container-di
- Owner: alexzvn
- License: mit
- Created: 2020-04-27T09:41:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-27T09:44:50.000Z (over 4 years ago)
- Last Synced: 2024-04-18T18:17:09.813Z (7 months ago)
- Topics: composer, ioc-container, php-library, php7, singleton
- Language: PHP
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ContainerDI
Simple IoC container with some method: bind, singleton, resolve, make.
## Install
### Install Composer
```bash
composer require iquxbyte/container-di
```### Install Non-Composer
Just download this repo and include `path/to/src/__autoload.php`.## Use
### Bind
```php
ContainerDI::bind(Foo::class);
```### Singleton
```php
ContainerDI::singleton(FooBarContract::class, FooBar::class);
```### Make class
```php
ContainerDI::make(FooBarContract::class, FooBar::class);
```### Resolve class
```php
ContainerDI::make(Foo::class);
```## Example
```php