Skip to content

projek-xyz/container

Repository files navigation

Version Lisence Actions Status Coverage Status SymfonyInsight Grade

Simple yet Flexible PSR-11 Container Implementation

This tiny library aims to provide a dead-simple PSR-11 implementation with flexible service registration.

Features

  • PSR-11 Compliant: Fully implements the PSR-11 ContainerInterface.
  • Autowiring: Automatically resolves dependencies for constructors and callables using type-hints or parameter names.
  • Flexible Registration: Register services using closures, class names, instances, or even class-method pairs.
  • Service Extension: Easily modify or wrap existing services using the extend() method.
  • On-the-fly Resolution: Create instances without adding them to the container stack using make().
  • PSR-14 Event Lifecycle: Fully supports PSR-14 event dispatching for intercepting and filtering container operations.
  • Container Awareness: Automatically inject the container into services that implement ContainerAware.
  • Lightweight: Minimal dependencies (only PSR-11 and PSR-14 interfaces) and a small footprint.

Installation

Use Composer

$ composer require projek-xyz/container --prefer-dist

Documentation

Documentations and usages available on wiki

License

This library is open-sourced software licensed under MIT license.

About

Simple yet flexible PSR-11 Container Implementation

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

2 watching

Forks

Sponsor this project

  •  
  •  

Contributors

Languages