phact-cmf/container

PSR-11 compatible dependency injection container

v1.0.1 2020-06-30 10:11 UTC

This package is auto-updated.

Last update: 2024-03-29 04:05:55 UTC


README

Scrutinizer Code Quality Code Coverage Build Status

Follows PSR-11, and PSR-1, PSR-2, PSR-4.

Inspired by [league/container](https://container.thephpleague.com/).

Main ideas

  • Creating objects, described by definitions
  • Creating objects not described by definitions (to any level of nesting)
  • Ability to make calls and set properties after creating an object
  • Ability to make calls and set properties by class / interface (for example, "Aware" interfaces)
  • Creating objects using factories
  • Aliases (tags) for any service
  • Ability to analyze method / constructor dependencies using reflection
  • Ability to add child containers to retrieve objects not described in the current container

Installation

composer require phact-cmf/container

Requirements

  • PHP >= 7.2

Documentation

Full documentation in progress.

Доступна полная документация на русском языке

License

The MIT License (MIT). License File.