public function loadInternal(array $configs, ContainerBuilder $container): void
    {
        $file = $this->getServiceName();
        if (!file_exists($file)) {
            throw new BadMethodCallException('"'.$file.'" doesn\'t exist!');
        }
        $parts = pathinfo($file);

        switch ($parts['extension']) {
            case 'xml':
                $loader = new XmlFileLoader($container, new FileLocator($parts['dirname']));
            break;
            case 'yml':
            case 'yaml':
                $loader = new YamlFileLoader($container, new FileLocator($parts['dirname']));
                break;
            default:
                throw new BadMethodCallException(
                    'This extension does not accept ".'
                    .$parts['extension']
                    .'" extension, only ".yml", ".yaml" or ".xml"!'
                );
        }
        $loader->load($parts['basename']);
        $this->setConfigParameters($configs, $container);
    }