protected function addModulesDependencies(array $modules = [])
    {
        if (empty($modules)) {
            return [];
        }

        // Thelia is always a dependency
        if (!\in_array('Thelia', $modules)) {
            $modules[] = 'Thelia';
        }

        foreach ($modules as $module) {
            // Thelia is not a real module, do not try to get its dependencies
            if ($module === 'Thelia') {
                continue;
            }

            $moduleValidator = new ModuleValidator("{$this->theliaModuleDir}/{$module}");
            $dependencies = $moduleValidator->getCurrentModuleDependencies(true);
            foreach ($dependencies as $dependency) {
                if (!\in_array($dependency['code'], $modules)) {
                    $modules[] = $dependency['code'];
                }
            }
        }

        return $modules;
    }