|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | +/** |
| 5 | + * This file is part of Hyperf. |
| 6 | + * |
| 7 | + * @link https://www.hyperf.io |
| 8 | + * @document https://hyperf.wiki |
| 9 | + |
| 10 | + * @license https://github.com/hyperf/hyperf/blob/master/LICENSE |
| 11 | + */ |
| 12 | +namespace HyperfTest\Di\Stub; |
| 13 | + |
| 14 | +use Hyperf\Di\Aop\ProxyTrait; |
| 15 | + |
| 16 | +trait ProxyTraitOnTrait |
| 17 | +{ |
| 18 | + use ProxyTrait; |
| 19 | + |
| 20 | + /** |
| 21 | + * @var string |
| 22 | + */ |
| 23 | + public $name; |
| 24 | + |
| 25 | + public function __construct(string $name = 'Hyperf') |
| 26 | + { |
| 27 | + $this->name = $name; |
| 28 | + } |
| 29 | + |
| 30 | + public function get(?int $id, string $str = '') |
| 31 | + { |
| 32 | + return $this->__getParamsMap(__TRAIT__, 'get', func_get_args()); |
| 33 | + } |
| 34 | + |
| 35 | + public function get2(?int $id = 1, string $str = '') |
| 36 | + { |
| 37 | + return $this->__getParamsMap(__TRAIT__, 'get2', func_get_args()); |
| 38 | + } |
| 39 | + |
| 40 | + public function get3(?int $id = 1, string $str = '', float $num = 1.0) |
| 41 | + { |
| 42 | + return $this->__getParamsMap(__TRAIT__, 'get3', func_get_args()); |
| 43 | + } |
| 44 | + |
| 45 | + public function incr() |
| 46 | + { |
| 47 | + return self::__proxyCall(__TRAIT__, __FUNCTION__, self::__getParamsMap(__TRAIT__, __FUNCTION__, func_get_args()), function () { |
| 48 | + return 1; |
| 49 | + }); |
| 50 | + } |
| 51 | + |
| 52 | + public function getName() |
| 53 | + { |
| 54 | + return self::__proxyCall(__TRAIT__, __FUNCTION__, self::__getParamsMap(__TRAIT__, __FUNCTION__, func_get_args()), function () { |
| 55 | + return 'HyperfCloud'; |
| 56 | + }); |
| 57 | + } |
| 58 | + |
| 59 | + public function getName2() |
| 60 | + { |
| 61 | + return self::__proxyCall(__TRAIT__, __FUNCTION__, self::__getParamsMap(__TRAIT__, __FUNCTION__, func_get_args()), function () { |
| 62 | + return 'HyperfCloud'; |
| 63 | + }); |
| 64 | + } |
| 65 | +} |
0 commit comments