litphp/air

simple & smart dependency injection

v0.9.2 2019-10-27 12:24 UTC

This package is auto-updated.

Last update: 2024-12-06 01:11:54 UTC


README

Dependency Injection for Lit

Scrutinizer Code Quality Code Coverage Build Status

Documentation

Features

  • PSR-11 compliant

  • Recipe (for singleton, alias, lazy instantiate, etc.)

  • Delegate lookup

    • works with composite container pattern
    • provide features for other container
  • Smart autowire

    Factory::of($container)->produce($className[, $extraParameters]);
    • in addition to classname, search parameter name & position for dependency
    • parameter with default value can safely ignored
    • provide extra parameter at call time
  • Method injection and injected instantiate

    Factory::of($container)->instantiate($className[, $extraParameters]); //this won't write $className to $container
    Factory::of($container)->invoke($callback[, $extraParameters]);
    • one-shot dependency injection
  • Configure your container with several approach

    • chained method call (php native)
    • php array
    • ​json/yaml (not yet)