litphp/air

simple & smart dependency injection

Maintainers

Details

github.com/litphp/air

Source

Issues

Installs: 234

Dependents: 4

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/litphp/air

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

This package is auto-updated.

Last update: 2025-10-06 02:49:20 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)