改名
This commit is contained in:
+21
-15
@@ -4,8 +4,13 @@
|
||||
namespace Rpc;
|
||||
|
||||
|
||||
use Exception;
|
||||
use ReflectionException;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
|
||||
|
||||
@@ -19,14 +24,15 @@ class Producer extends Component
|
||||
private array $producers = [];
|
||||
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @return Producer|bool
|
||||
* @throws \ReflectionException
|
||||
* @throws \Snowflake\Exception\ComponentException
|
||||
* @throws \Snowflake\Exception\ConfigException
|
||||
* @throws \Snowflake\Exception\NotFindClassException
|
||||
*/
|
||||
/**
|
||||
* @param $name
|
||||
* @return Producer|bool
|
||||
* @throws ReflectionException
|
||||
* @throws ComponentException
|
||||
* @throws ConfigException
|
||||
* @throws NotFindClassException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function get($name): Client|bool
|
||||
{
|
||||
if (empty($this->producers)) {
|
||||
@@ -52,13 +58,13 @@ class Producer extends Component
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \Snowflake\Exception\ComponentException
|
||||
* @throws \Snowflake\Exception\ConfigException
|
||||
* @throws \Snowflake\Exception\NotFindClassException
|
||||
* @return Client|bool
|
||||
* @throws ReflectionException
|
||||
* @throws ComponentException
|
||||
* @throws ConfigException
|
||||
* @throws NotFindClassException
|
||||
*/
|
||||
public function __get($name): mixed
|
||||
public function __get($name): Client|bool
|
||||
{
|
||||
return $this->get($name); // TODO: Change the autogenerated stub
|
||||
}
|
||||
@@ -69,7 +75,7 @@ class Producer extends Component
|
||||
* @param $rand
|
||||
* @return string
|
||||
*/
|
||||
private function getName($name, $rand)
|
||||
private function getName($name, $rand): string
|
||||
{
|
||||
return 'rpc.client.' . $name . '.' . $rand['host'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user