Webmozart\Console\Util\SimilarCommandName::filterDuplicates PHP Method

filterDuplicates() private static method

private static filterDuplicates ( array $names, CommandCollection $commands )
$names array
$commands Webmozart\Console\Api\Command\CommandCollection
    private static function filterDuplicates(array $names, CommandCollection $commands)
    {
        $filteredNames = array();
        foreach ($names as $nameToFilter) {
            // Check all existing names for duplicates
            foreach ($filteredNames as $filteredName) {
                // $nameToFilter is a duplicate - skip
                if ($commands->get($nameToFilter) === $commands->get($filteredName)) {
                    continue 2;
                }
            }
            $filteredNames[] = $nameToFilter;
        }
        return $filteredNames;
    }