tractorcow/classproxy
最新稳定版本:1.0.0
Composer 安装命令:
composer require tractorcow/classproxy
包简介
无描述信息
README 文档
README
Dynamically scaffold proxy classes that actually extend the class being proxied, allowing them to be used in type-strict applications.
No it's not prophecy because this is designed for partial proxies, not testing.
Installation
composer require tractorcow/classproxy
Examples
// Create a proxy creator $proxy = ProxyFactory::create(DataBase::class) ->addMethod('connect', function ($args, $next) use ($logger) { $logger->log("Connecting to server " . $args[0]['server']; return $next(...$args); }); // Generate instance of our proxy $instance = $proxy->instance(); assert($instance instanceof Database); // Yep! // Connects to underlying database, logging the call $instance->connect([ 'server' => 'localhost', 'user' => 'root' ]);
统计信息
- 总下载量: 492.91k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 未知