This commit is contained in:
2021-09-02 11:27:59 +08:00
parent 428987406c
commit ef1d542814
+1 -2
View File
@@ -17,7 +17,6 @@ use Kiri\Abstracts\Logger;
use Kiri\Exception\NotFindClassException;
use Kiri\Kiri;
use Psr\Log\LoggerInterface;
use Psr\Log\Test\TestLogger;
use ReflectionClass;
use ReflectionException;
use ReflectionFunction;
@@ -252,7 +251,7 @@ class Container extends BaseObject implements ContainerInterface
private function onAfterInit($object, $config): mixed
{
Kiri::configure($object, $config);
if (method_exists($object, 'init')) {
if (method_exists($object, 'init') && is_callable([$object, 'init'])) {
call_user_func([$object, 'init']);
}
return $object;