src/Shell/SeedShell.php
protected function createRelationIndex(array $modules) : array
    {
        $index = [];

        foreach ($modules as $moduleName => $module) {
            if (! isset($module['relations'])) {
                $index[$moduleName] = [];
                continue;
            }

            if (! is_array($module['relations'])) {
                $index[$moduleName] = [];
                continue;
            }

            foreach ($module['relations'] as $relatedModule) {
                if (!empty($index[$relatedModule][$moduleName])) {
                    continue;
                }
                $index[$relatedModule][] = $moduleName;
            }
        }

        return $index;
    }
protected function createRelationIndex(array $modules) : array
    {
        $index = [];

        foreach ($modules as $moduleName => $module) {
            if (! isset($module['relations'])) {
                $index[$moduleName] = [];
                continue;
            }

            if (! is_array($module['relations'])) {
                $index[$moduleName] = [];
                continue;
            }

            foreach ($module['relations'] as $relatedModule) {
                if (!empty($index[$relatedModule][$moduleName])) {
                    continue;
                }
                $index[$relatedModule][] = $moduleName;
            }
        }

        return $index;
    }
protected function createRelationIndex ( array $ modules ) : array { $ index = [ ] ; foreach ( $ modules as $ moduleName => $ module ) { if ( ! isset ( $ module [ 'relations' ] ) ) { $ index [ $ moduleName ] = [ ] ; continue ; } if ( ! is_array ( $ module [ 'relations' ] ) ) { $ index [ $ moduleName ] = [ ] ; continue ; } foreach ( $ module [ 'relations' ] as $ relatedModule ) { if ( ! empty ( $ index [ $ relatedModule ] [ $ moduleName ] ) ) { continue ; } $ index [ $ relatedModule ] [ ] = $ moduleName ; } } return $ index ; }
Create relation index between modules.

@param mixed[] $modules modules.
@return mixed[]
Create relation index between modules .