PhpCsFixer\Console\Command\DescribeCommand::getAlternative PHP Метод

getAlternative() приватный Метод

private getAlternative ( string $type, string $name ) : null | string
$type string 'rule'|'set'
$name string
Результат null | string
    private function getAlternative($type, $name)
    {
        $other = null;
        $alternatives = 'set' === $type ? $this->getSetNames() : array_keys($this->getFixers());
        foreach ($alternatives as $alternative) {
            $distance = levenshtein($name, $alternative);
            if (3 > $distance) {
                $other = $alternative;
                break;
            }
        }
        return $other;
    }