/** * @return array */ protected function resolveInfo() : array { return ['name' => $this->module->name(), 'title' => $this->module->title(), 'version' => $this->module->version(), 'description' => $this->module->description(), 'dependencies' => array_map(function (Module $module) { return $module->name(); }, $this->module->dependencies()), 'dependents' => array_map(function (Module $module) { return $module->name(); }, $this->module->dependents()), 'hidden' => $this->module->isHidden(), 'collector' => $this->module->collector(), 'installer' => $this->module->installer(), 'assets' => $this->module->assets()]; }
/** * @param ColibriModule $module * @param array $d * @return ColibriModule[] */ protected function buildDependencyTree(ColibriModule $module, array &$d = []) { $d[$module->name()] = $module; foreach ($module->dependencies() as $dep) { if (!isset($d[$dep->name()])) { $this->buildDependencyTree($dep, $d); } else { $mdl = $d[$dep->name()]; unset($d[$dep->name()]); $d[$dep->name()] = $mdl; } } return $d; }