承接 konekt/xtend 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

konekt/xtend

最新稳定版本:2.0.0

Composer 安装命令:

composer require konekt/xtend

包简介

Library to support creating extendable, plugin-aware applications

README 文档

README

Tests Packagist version Packagist downloads StyleCI MIT Software License

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:

  1. Create a class
  2. Add the Registry interface
  3. Use the HasRegistry and RequiresClassOrInterface traits
  4. Add the $requiredInterface static 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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-30