protected function getConfigurationsFromFile($fileName, ContainerBuilder $container, $merge = true)
    {
        $configs = [];

        /** @var \Symfony\Component\Finder\SplFileInfo $file */
        foreach ($this->getFinder($fileName, $container) as $file) {
            $currentConfiguration = Yaml::parse($file->getContents());

            // skip empty files
            if (empty($currentConfiguration)) {
                continue;
            }

            // merge configurations recursively or just stack
            if ($merge) {
                $configs = array_merge_recursive($configs, $currentConfiguration);
            } else {
                $configs[] = reset($currentConfiguration);
            }
        }

        return $configs;
    }