Page MenuHomePhabricator
Diviner libphutil Tech Docs PhutilLanguageGuesser

final class PhutilLanguageGuesser
libphutil Technical Documentation (Parsers)

Very simple class to guess the languages of source files which we failed to determine by examining file name/extension rules.

Methods

public static function guessLanguage($source)

Guess which computer programming language a file is written in.

Parameters
string$sourceSource text of the file.
Return
mixedLanguage string, or null if unable to guess.