public function ModuleBuildDependencies::moduleBuildDependencies in X Autoload 7.5
Parameters
object[] $files:
Return value
object[]
See also
File
- tests/
src/ VirtualDrupal/ ModuleBuildDependencies.php, line 16
Class
Namespace
Drupal\xautoload\Tests\VirtualDrupalCode
public function moduleBuildDependencies($files) {
foreach ($files as $file) {
$graph[$file->name]['edges'] = array();
if (isset($file->info['dependencies']) && is_array($file->info['dependencies'])) {
foreach ($file->info['dependencies'] as $dependency) {
$dependency_data = $this
->drupalParseDependency($dependency);
$graph[$file->name]['edges'][$dependency_data['name']] = $dependency_data;
}
}
}
$this
->drupalDepthFirstSearch($graph);
foreach ($graph as $module => $data) {
$files[$module]->required_by = isset($data['reverse_paths']) ? $data['reverse_paths'] : array();
$files[$module]->requires = isset($data['paths']) ? $data['paths'] : array();
$files[$module]->sort = $data['weight'];
}
return $files;
}