| 1 |
# Container (Dependency Injection) |
| 2 |
|
| 3 |
[](https://github.com/philipobenito](https://github.com/philipobenito](https://github.com/philipobenito) |
| 4 |
[](https://github.com/thephpleague/container/releases](https://github.com/thephpleague/container/releases](https://github.com/thephpleague/container/releases) |
| 5 |
[](LICENSE.md](LICENSE.md](LICENSE.md) |
| 6 |
[](https://github.com/thephpleague/container/actions/workflows/test.yml](https://github.com/thephpleague/container/actions/workflows/test.yml](https://github.com/thephpleague/container/actions/workflows/test.yml) |
| 7 |
[](https://scrutinizer-ci.com/g/thephpleague/container/code-structure](https://scrutinizer-ci.com/g/thephpleague/container/code-structure](https://scrutinizer-ci.com/g/thephpleague/container/code-structure) |
| 8 |
[](https://scrutinizer-ci.com/g/thephpleague/container](https://scrutinizer-ci.com/g/thephpleague/container](https://scrutinizer-ci.com/g/thephpleague/container) |
| 9 |
[](https://packagist.org/packages/league/container](https://packagist.org/packages/league/container](https://packagist.org/packages/league/container) |
| 10 |
|
| 11 |
This package is compliant with [PSR-1], [PSR-2], [PSR-12], [PSR-4], [PSR-11] and [PSR-12]. If you notice compliance oversights, please send a patch via pull request. |
| 12 |
|
| 13 |
[PSR-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md |
| 14 |
[PSR-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md |
| 15 |
[PSR-12]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md |
| 16 |
[PSR-4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md |
| 17 |
[PSR-11]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md |
| 18 |
[PSR-12]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md |
| 19 |
|
| 20 |
## Install |
| 21 |
|
| 22 |
Via Composer |
| 23 |
|
| 24 |
``` bash |
| 25 |
composer require league/container |
| 26 |
``` |
| 27 |
|
| 28 |
## Requirements |
| 29 |
|
| 30 |
The following versions of PHP are supported by this version. |
| 31 |
|
| 32 |
* PHP 7.2 |
| 33 |
* PHP 7.3 |
| 34 |
* PHP 7.4 |
| 35 |
* PHP 8.0 |
| 36 |
* PHP 8.1 |
| 37 |
* PHP 8.2 |
| 38 |
* PHP 8.3 |
| 39 |
* PHP 8.4 |
| 40 |
|
| 41 |
## Documentation |
| 42 |
|
| 43 |
Container has [](http://container.thephpleague.comfull documentation](http://container.thephpleague.com](http://container.thephpleague.com), powered by [](http://jekyllrb.com/Jekyll](http://jekyllrb.com/](http://jekyllrb.com/). |
| 44 |
|
| 45 |
Contribute to this documentation in the [](https://github.com/thephpleague/container/tree/master/docsdocs/](https://github.com/thephpleague/container/tree/master/docs](https://github.com/thephpleague/container/tree/master/docs) sub-directory. |
| 46 |
|
| 47 |
## Testing |
| 48 |
|
| 49 |
Testing includes PHPUnit and PHPStan (Level 7). |
| 50 |
``` bash |
| 51 |
$ composer test |
| 52 |
``` |
| 53 |
|
| 54 |
## Contributing |
| 55 |
|
| 56 |
Please see [](https://github.com/thephpleague/container/blob/master/CONTRIBUTING.mdCONTRIBUTING](https://github.com/thephpleague/container/blob/master/CONTRIBUTING.md](https://github.com/thephpleague/container/blob/master/CONTRIBUTING.md) for details. |
| 57 |
|
| 58 |
## Security |
| 59 |
|
| 60 |
If you discover any security related issues, please email [email protected] instead of using the issue tracker. |
| 61 |
|
| 62 |
## Credits |
| 63 |
|
| 64 |
- [](https://github.com/philipobenitoPhil Bennett](https://github.com/philipobenito](https://github.com/philipobenito) |
| 65 |
- [](https://github.com/thephpleague/container/contributorsAll Contributors](https://github.com/thephpleague/container/contributors](https://github.com/thephpleague/container/contributors) |
| 66 |
- `Orno\Di` contributors |
| 67 |
|
| 68 |
## License |
| 69 |
|
| 70 |
The MIT License (MIT). Please see [](https://github.com/thephpleague/container/blob/master/LICENSE.mdLicense File](https://github.com/thephpleague/container/blob/master/LICENSE.md](https://github.com/thephpleague/container/blob/master/LICENSE.md) for more information. |
| 71 |
|