改名
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Annotation\Rpc;
|
||||
|
||||
|
||||
use Annotation\Attribute;
|
||||
use Exception;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
* Class Consumer
|
||||
* @package Annotation\Rpc
|
||||
*/
|
||||
#[\Attribute(\Attribute::TARGET_METHOD)] class Consumer extends Attribute
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Consumer constructor.
|
||||
* @param string $cmd
|
||||
*/
|
||||
public function __construct(public string $cmd)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $class
|
||||
* @param mixed $method
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
public function execute(mixed $class, mixed $method = ''): bool
|
||||
{
|
||||
$rpc = Kiri::app()->getRpc();
|
||||
$rpc->addConsumer($this->cmd, [$class, $method]);
|
||||
return true; // TODO: Change the autogenerated stub
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user