Platformsh\Cli\Helper\GitHelper::getVersion PHP Method

getVersion() public method

Get the installed version of the Git CLI.
public getVersion ( ) : string | false
return string | false The version number, or false on failure.
    public function getVersion()
    {
        static $version;
        if (!$version) {
            $version = false;
            $string = $this->execute(['--version'], false);
            if ($string && preg_match('/(^| )([0-9]+[^ ]*)/', $string, $matches)) {
                $version = $matches[2];
            }
        }
        return $version;
    }