src/Leevel/Di/Container.php
protected function getInjectionObject(string $classname, array $args = [])
    {
        if (interface_exists($classname)) {
            $e = sprintf('Interface %s cannot be normalize because not binded.', $classname);

            throw new ContainerInvalidArgumentException($e);
        }

        if (!class_exists($classname)) {
            return $classname;
        }

        $args = $this->normalizeInjectionArgs($classname, $args);

        return $this->newInstanceArgs($classname, $args);
    }
protected function getInjectionObject(string $classname, array $args = [])
    {
        if (interface_exists($classname)) {
            $e = sprintf('Interface %s cannot be normalize because not binded.', $classname);

            throw new ContainerInvalidArgumentException($e);
        }

        if (!class_exists($classname)) {
            return $classname;
        }

        $args = $this->normalizeInjectionArgs($classname, $args);

        return $this->newInstanceArgs($classname, $args);
    }
根据 class 名字创建实例.

@param string $classname
@param array  $args

@return object|string