conia/wire
最新稳定版本:0.3.0
Composer 安装命令:
composer require conia/wire
包简介
Autowiring object creator and callable argument resolver
README 文档
README
Wire provides an autowiring object creator that utilizes PHP's reflection capabilities to automatically resolve constructor arguments recursively. It additionally comes with classes that assist in resolving arguments of callables such as functions, methods, closures or class constructors. It can be combined with a PSR-11 dependency injection container.
Documentation can be found on the website: conia.dev/wire
Installation
composer require conia/wire
Basic usage
use Conia\Wire\Wire; class Value { public function get(): string { return 'Autowired Value'; } } class Model { public function __construct(protected Value $value) {} public function value(): string { return $this->value->get(); } } $creator = Wire::creator(); $model = $creator->create(Model::class); assert($model instanceof Model); assert($model->value() === 'Autowired Value');
License
Conia Wire is released under the MIT license.
Copyright © 2023-2024 ebene fünf GmbH. All rights reserved.
统计信息
- 总下载量: 111
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-01