改名
This commit is contained in:
@@ -255,13 +255,10 @@ class Container extends BaseObject implements ContainerInterface
|
||||
return $this->_reflection[$class];
|
||||
}
|
||||
$reflect = new ReflectionClass($class);
|
||||
if ($reflect->isAbstract() || $reflect->isTrait()) {
|
||||
if ($reflect->isAbstract() || $reflect->isTrait() || $reflect->isInterface()) {
|
||||
return $this->_reflection[$class] = $reflect;
|
||||
}
|
||||
$construct = NoteManager::resolveTarget($reflect);
|
||||
if ($reflect->isInterface()) {
|
||||
return $this->_reflection[$class] = $reflect;
|
||||
}
|
||||
if (!empty($construct) && $construct->getNumberOfParameters() > 0) {
|
||||
$this->_constructs[$class] = $construct;
|
||||
}
|
||||
|
||||
@@ -25,12 +25,7 @@ class GiiJsonRpc extends GiiBase
|
||||
|
||||
namespace Rpc;
|
||||
|
||||
use Annotation\Mapping;
|
||||
use Annotation\Target;
|
||||
use Rpc\Producers\\' . ucfirst($name) . 'RpcService;
|
||||
|
||||
#[Target]
|
||||
#[Mapping(' . ucfirst($name) . 'RpcService::class)]
|
||||
interface ' . ucfirst($name) . 'RpcInterface
|
||||
{
|
||||
|
||||
@@ -58,12 +53,14 @@ namespace Rpc\Producers;
|
||||
|
||||
|
||||
use Annotation\Target;
|
||||
use Annotation\Mapping;
|
||||
use Rpc\\' . ucfirst($name) . 'RpcInterface;
|
||||
use Exception;
|
||||
use Kiri\Rpc\JsonRpcConsumers;
|
||||
|
||||
|
||||
#[Target]
|
||||
#[Mapping(' . ucfirst($name) . 'RpcInterface::class)]
|
||||
class ' . ucfirst($name) . 'RpcService extends JsonRpcConsumers implements ' . ucfirst($name) . 'RpcInterface
|
||||
{
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ class Loader extends BaseObject
|
||||
private function getReflect(DirectoryIterator $path, string $namespace): ?ReflectionClass
|
||||
{
|
||||
$class = $this->explodeFileName($path, $namespace);
|
||||
if (!class_exists($class) && !interface_exists($class)) {
|
||||
if (!class_exists($class)) {
|
||||
return null;
|
||||
}
|
||||
return Kiri::getDi()->getReflect($class);
|
||||
|
||||
@@ -23,7 +23,7 @@ use Kiri\Kiri;
|
||||
*/
|
||||
public function execute(mixed $class, mixed $method = ''): mixed
|
||||
{
|
||||
Kiri::getDi()->mapping($class, $this->class);
|
||||
Kiri::getDi()->mapping($this->class, $class);
|
||||
|
||||
return parent::execute($class, $method);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user