konekt/xtend
最新稳定版本:2.0.0
Composer 安装命令:
composer require konekt/xtend
包简介
Library to support creating extendable, plugin-aware applications
README 文档
README
Requirements
- PHP 8.2+
Features
- Registries
- Hooks
Installation
You can install the package via composer:
composer require konekt/xtend
Usage
Registries
The following example shows a sample registry that holds reference to various PaymentGateway implementations.
Steps:
- Create a class
- Add the
Registryinterface - Use the
HasRegistryandRequiresClassOrInterfacetraits - Add the
$requiredInterfacestatic property, and set the interface
final class PaymentGateways implements Registry { use HasRegistry; use RequiresClassOrInterface; private static string $requiredInterface = PaymentGateway::class; }
Having that, other developers can add new payment gateways:
PaymentGateways::add('braintree', BrainTreePaymentGateway::class);
统计信息
- 总下载量: 34.33k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 7
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-30