src/i18n/TextCollection/i18nTextCollector.php
protected function resolveDuplicateConflicts($entitiesByModule)
    {
        // Find all keys that exist across multiple modules
        $conflicts = $this->getConflicts($entitiesByModule);
        foreach ($conflicts as $conflict) {
            // Determine if we can narrow down the ownership
            $bestModule = $this->getBestModuleForKey($entitiesByModule, $conflict);
            if (!$bestModule || !isset($entitiesByModule[$bestModule])) {
                continue;
            }

            // Remove foreign duplicates
            foreach ($entitiesByModule as $module => $entities) {
                if ($module !== $bestModule) {
                    unset($entitiesByModule[$module][$conflict]);
                }
            }
        }
        return $entitiesByModule;
    }
protected function resolveDuplicateConflicts($entitiesByModule)
    {
        // Find all keys that exist across multiple modules
        $conflicts = $this->getConflicts($entitiesByModule);
        foreach ($conflicts as $conflict) {
            // Determine if we can narrow down the ownership
            $bestModule = $this->getBestModuleForKey($entitiesByModule, $conflict);
            if (!$bestModule || !isset($entitiesByModule[$bestModule])) {
                continue;
            }

            // Remove foreign duplicates
            foreach ($entitiesByModule as $module => $entities) {
                if ($module !== $bestModule) {
                    unset($entitiesByModule[$module][$conflict]);
                }
            }
        }
        return $entitiesByModule;
    }
protected function resolveDuplicateConflicts ( $ entitiesByModule ) { // Find all keys that exist across multiple modules $ conflicts = $ this -> getConflicts ( $ entitiesByModule ) ; foreach ( $ conflicts as $ conflict ) { // Determine if we can narrow down the ownership $ bestModule = $ this -> getBestModuleForKey ( $ entitiesByModule , $ conflict ) ; if ( ! $ bestModule || ! isset ( $ entitiesByModule [ $ bestModule ] ) ) { continue ; } // Remove foreign duplicates foreach ( $ entitiesByModule as $ module => $ entities ) { if ( $ module !== $ bestModule ) { unset ( $ entitiesByModule [ $ module ] [ $ conflict ] ) ; } } } return $ entitiesByModule ; }
Resolve conflicts between duplicate keys across modules

@param array $entitiesByModule List of all modules with keys
@return array Filtered listo of modules with duplicate keys unassigned
Resolve conflicts between duplicate keys across modules