Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/constants/PhabricatorRepositoryType.php
<?php | <?php | ||||
final class PhabricatorRepositoryType extends Phobject { | final class PhabricatorRepositoryType extends Phobject { | ||||
const REPOSITORY_TYPE_GIT = 'git'; | const REPOSITORY_TYPE_GIT = 'git'; | ||||
const REPOSITORY_TYPE_SVN = 'svn'; | const REPOSITORY_TYPE_SVN = 'svn'; | ||||
const REPOSITORY_TYPE_MERCURIAL = 'hg'; | const REPOSITORY_TYPE_MERCURIAL = 'hg'; | ||||
public static function getAllRepositoryTypes() { | public static function getAllRepositoryTypes() { | ||||
static $map = array( | $map = array( | ||||
self::REPOSITORY_TYPE_GIT => 'Git', | self::REPOSITORY_TYPE_GIT => pht('Git'), | ||||
self::REPOSITORY_TYPE_SVN => 'Subversion', | self::REPOSITORY_TYPE_MERCURIAL => pht('Mercurial'), | ||||
self::REPOSITORY_TYPE_MERCURIAL => 'Mercurial', | self::REPOSITORY_TYPE_SVN => pht('Subversion'), | ||||
); | ); | ||||
return $map; | return $map; | ||||
} | } | ||||
public static function getNameForRepositoryType($type) { | public static function getNameForRepositoryType($type) { | ||||
$map = self::getAllRepositoryTypes(); | $map = self::getAllRepositoryTypes(); | ||||
return idx($map, $type, pht('Unknown')); | return idx($map, $type, pht('Unknown')); | ||||
} | } | ||||
} | } |