From 4633c0203650fad0546de21102c903efbb29b289 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Fri, 2 Sep 2022 14:28:53 +0200 Subject: [PATCH] WIP --- .../setup/library/Setup/ModuleDependency.php | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/setup/library/Setup/ModuleDependency.php b/modules/setup/library/Setup/ModuleDependency.php index 99ed29a67a9..1b7facce766 100644 --- a/modules/setup/library/Setup/ModuleDependency.php +++ b/modules/setup/library/Setup/ModuleDependency.php @@ -9,23 +9,25 @@ class ModuleDependency { - /** - * @var Module The given Module - */ + /** @var Module The given Module */ protected $module; - /** - * @var array The chosen modules - */ + /** @var array The chosen modules */ protected $checkedModules; + /** + * @param Module $module The given module + * + * @param array $checkedModules The checked modules from module page + */ public function __construct(Module $module, array $checkedModules) { $this->module = $module; $this->checkedModules = $checkedModules; } - /** Get the module dependency requirements + /** + * Get the module dependency requirements * * @return RequirementSet */ @@ -59,7 +61,7 @@ public function getRequirements() } if (! empty($icingadbAndMonitoring)) { - $icingadbOrmonitoring = new RequirementSet(false, RequirementSet::MODE_OR); + $icingadbOrMonitoring = new RequirementSet(false, RequirementSet::MODE_OR); foreach ($icingadbAndMonitoring as $name => $requiredVersion) { $options = [ 'alias' => $name, @@ -72,20 +74,20 @@ public function getRequirements() ]; if (! in_array($name, $this->checkedModules)) { - $icingadbOrmonitoring->add((new ModuleMissingRequirement($options))); + $icingadbOrMonitoring->add((new ModuleMissingRequirement($options))); } else { $options['condition'] = [$name, $requiredVersion]; - $icingadbOrmonitoring->add(new WebModuleRequirement($options)); + $icingadbOrMonitoring->add(new WebModuleRequirement($options)); } } - $set->merge($icingadbOrmonitoring); + $set->merge($icingadbOrMonitoring); $requirement = (new SetRequirement([ 'title' =>'Base Module', 'alias' => 'Monitoring OR Icingadb', 'optional' => false, - 'condition' => $icingadbOrmonitoring, + 'condition' => $icingadbOrMonitoring, 'description' => t('Module Monitoring OR Icingadb is required.') ]));