catalyst/servant
Composer 安装命令:
composer require catalyst/servant
包简介
Catalyst Servant Dependency Inhibitor Library
README 文档
README
Catalyst Servant - Dependency Inhibitor Library
What is Servant ?
Servant is a dependency inhibitor based on a chain of responsibility. Servant
provides the ability to resolve a given dependency based on a class name or a
ReflectionParameter-Instance.
Usage
use Catalyst\Servant\{ RepositoryServant, BlindServant }; $servant = new RepositoryServant(); $servant->chain(new BlindServant()); $servant->ensure(DateTimeInterface::class, function() { return date_create(); }); $dateTime = $servant->resolve(DateTimeInterface::class);
Boxed Servants
This package serves the following ServantInterface-Implementations:
RepositoryServant- A repository based servant that allows to assign aliases and interfaces to concretes.BlindServant- A blind servant that allows the instancing of objects out of the blue.NullServant- A null servant that returns null and acts as an end point to guarantee a null-result when no dependency resolver was successful.
License and Maintainer(s)
This package is licensed under the MIT license. This package is actively maintained by:
- Matthias Kaschubowski
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-27