src/Generator/Analyzer/Steps/ResolveModuleNames.php
function getKeysForDuplicates(array $array)
    {
        $duplicates = $newArray = [];

        foreach ($array as $key => $value) {

            if ( ! isset($newArray[ $value ])) {
                $newArray[ $value ] = $key;
                continue;
            }

            if (isset($duplicates[ $value ])) {
                $duplicates[ $value ][] = $key;
            } else {
                $duplicates[ $value ] = [
                    $newArray[ $value ],
                    $key
                ];
            }
        }

        return $duplicates;
    }
function getKeysForDuplicates(array $array)
    {
        $duplicates = $newArray = [];

        foreach ($array as $key => $value) {

            if ( ! isset($newArray[ $value ])) {
                $newArray[ $value ] = $key;
                continue;
            }

            if (isset($duplicates[ $value ])) {
                $duplicates[ $value ][] = $key;
            } else {
                $duplicates[ $value ] = [
                    $newArray[ $value ],
                    $key
                ];
            }
        }

        return $duplicates;
    }
function getKeysForDuplicates ( array $ array ) { $ duplicates = $ newArray = [ ] ; foreach ( $ array as $ key => $ value ) { if ( ! isset ( $ newArray [ $ value ] ) ) { $ newArray [ $ value ] = $ key ; continue ; } if ( isset ( $ duplicates [ $ value ] ) ) { $ duplicates [ $ value ] [ ] = $ key ; } else { $ duplicates [ $ value ] = [ $ newArray [ $ value ] , $ key ] ; } } return $ duplicates ; }
Returns the keys for values that occur more than once in an array

@param array $array
@return array
Returns the keys for values that occur more than once in an array