Gitamin\Services\Git\Util::getFileType PHP Метод

getFileType() публичный Метод

The file type is used by CodeMirror, a Javascript-based IDE implemented in GitList, to properly highlight the blob syntax (if it's a source-code)
public getFileType ( string $file ) : mixed
$file string File name
Результат mixed File type
    public function getFileType($file)
    {
        if (($pos = strrpos($file, '.')) !== false) {
            $fileType = substr($file, $pos + 1);
        } else {
            return 'text';
        }
        if (isset($this->defaultFileTypes[$fileType])) {
            return $this->defaultFileTypes[$fileType];
        }
        return 'text';
    }