original_string: private function findNearestCommand($commandName, array $commands)
      {
          $distances = [];
          foreach (array_keys($commands) as $command) {
              $distances[$command] = levenshtein($commandName, $command);
          }
  
          $distances = array_filter(array_unique($distances), function ($distance) {
              return $distance <= 3;
          });
  
          if (empty($distances)) {
              return false;
          }
  
          return array_search(min($distances), $distances);
      }
code: private function findNearestCommand($commandName, array $commands)
      {
          $distances = [];
          foreach (array_keys($commands) as $command) {
              $distances[$command] = levenshtein($commandName, $command);
          }
  
          $distances = array_filter(array_unique($distances), function ($distance) {
              return $distance <= 3;
          });
  
          if (empty($distances)) {
              return false;
          }
  
          return array_search(min($distances), $distances);
      }
code_tokens: private function findNearestCommand ( $ commandName , array $ commands ) { $ distances = [ ] ; foreach ( array_keys ( $ commands ) as $ command ) { $ distances [ $ command ] = levenshtein ( $ commandName , $ command ) ; } $ distances = array_filter ( array_unique ( $ distances ) , function ( $ distance ) { return $ distance <= 3 ; } ) ; if ( empty ( $ distances ) ) { return false ; } return array_search ( min ( $ distances ) , $ distances ) ; }
docstring: Get the closest command to the one typed, but only if there is 3 or less
  characters different
  
  @param string $commandName
  @param array $commands
  @return string|false
docstring_tokens: Get the closest command to the one typed but only if there is 3 or less characters different