eee
This commit is contained in:
+16
-2
@@ -225,7 +225,14 @@ class Container implements ContainerInterface
|
||||
$construct = $this->getMethodParams($handler);
|
||||
}
|
||||
|
||||
$newInstance = $reflect->newInstanceArgs($construct);
|
||||
$isController = class_exists(\Kiri\Router\Base\Controller::class) && $reflect->isSubclassOf(\Kiri\Router\Base\Controller::class);
|
||||
$needsProxy = !$isController && class_exists(\Kiri\Router\Annotate\DeferRegistry::class) && \Kiri\Router\Annotate\DeferRegistry::hasAny($className);
|
||||
|
||||
if ($needsProxy) {
|
||||
$newInstance = \Kiri\Router\Annotate\DeferProxyGenerator::create($className, $construct);
|
||||
} else {
|
||||
$newInstance = $reflect->newInstanceArgs($construct);
|
||||
}
|
||||
|
||||
return $this->runInit($reflect, static::configure($newInstance, $config));
|
||||
}
|
||||
@@ -252,7 +259,14 @@ class Container implements ContainerInterface
|
||||
if (empty($construct) && ($handler = $reflect->getConstructor()) !== null) {
|
||||
$construct = $this->getMethodParams($handler);
|
||||
}
|
||||
$newInstance = $reflect->newInstanceArgs($construct);
|
||||
$isController = class_exists(\Kiri\Router\Base\Controller::class) && $reflect->isSubclassOf(\Kiri\Router\Base\Controller::class);
|
||||
$needsProxy = !$isController && class_exists(\Kiri\Router\Annotate\DeferRegistry::class) && \Kiri\Router\Annotate\DeferRegistry::hasAny($reflect->getName());
|
||||
|
||||
if ($needsProxy) {
|
||||
$newInstance = \Kiri\Router\Annotate\DeferProxyGenerator::create($reflect->getName(), $construct);
|
||||
} else {
|
||||
$newInstance = $reflect->newInstanceArgs($construct);
|
||||
}
|
||||
|
||||
return $this->runInit($reflect, static::configure($newInstance, $config));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user