protected function getClassParentModule(
        Container $container,
        $className,
        array $ignoredClasses = [
            ExternalModule::class,
            CompressableExternalModule::class,
            \samson\core\Service::class,
            CompressableService::class
        ]
    ) {
        // Skip ignored class names
        if (!in_array($className, $ignoredClasses, true)) {
            try {
                $instance = $container->get(trim($className));
                $instance->parent = $this->getClassParentModule($container, get_parent_class($instance));
                return $instance;
            } catch (\Exception $exception) {
                return null;
            }
//            // Iterate loaded services
//            foreach ($container->getServices('module') as $service) {
//                if (get_class($service) === $className) {
//                    return $service;
//                }
//            }
        }
        return null;
    }