定制 interophp/injector 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

interophp/injector

最新稳定版本:v1.0.0

Composer 安装命令:

composer require interophp/injector

包简介

Inject dependencies into constructors and methods

README 文档

README

Simple constructor and method argument injector.

You can pass a context to the injector to resolve parameters into injectable values.

Supported contexts:

  • ArrayContext: Resolves by a simple associative array's key/value
  • RequestContext: Uses a PSR7 ServerRequest to resolve values from request attributes
  • InteropContainerContext: Add support for DI containers implementing Interop\Container\ContainerInterface
  • PsrContainerContext: Add support for DI containers implementing Psr\Container\ContainerInterface
  • MultiContext: Pass an array of one or more of the above contexts to resolve from multiple contexts.

It's simple to add your own contexts by implementing InteroPhp\Injector\Context\ContextInterface

Examples and usage

Please check the included example/ directory for usage examples.

License

MIT (see LICENSE.md)

Brought to you by the LinkORB Engineering team


Check out our other projects at linkorb.com/engineering.

Btw, we're hiring!

统计信息

  • 总下载量: 2.34k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-10