定制 dudu/proxy-interceptors 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dudu/proxy-interceptors

Composer 安装命令:

composer require dudu/proxy-interceptors

包简介

This bundle provides Magento 2 style interceptors for Symfony

README 文档

README

Getting started

This bundle adds Magneto 2-like plugin support for symfony

Adding Example Plugin

  • create plugin class and implement before*, after* or around* methods for target class, ex. afterGetName
  • register service with tag app.interceptor, ex:
    <service id="Vendor\Plugin\Service" public="false" autowire="true" autoconfigure="false">
      <tag name="app.interceptor"
          target="Target\Class\To\Be\Intercepted"
          sortOrder="10" />
    </service>
    

Before methods

public function beforeGetName(object $subject, ...$arguments): ?array

$subject - class that has been intercepted

$arguments - array of method arguments

The method should return an array of new arguments or a null value (arguments will not be changed).

Around methods

public function aroundGetName(object $subject, \Callable $proceed, ...$arguments): mixed

$subject - class that has been intercepted

$proceed - callable for execute original function

$arguments - array of method arguments

After methods

public function afterGetName(object $subject, mixed $result, ...$arguments): mixed

$subject - that has been intercepted

$result - method result

$arguments - array of method arguments

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-19