/**
* Get the "MediaWiki is copyright 2001-20xx by lots of cool guys" text
*
- * @return String
+ * @return string
*/
public static function getCopyrightAndAuthorList() {
global $wgLang;
/**
* Return a string of the MediaWiki version with SVN revision if available.
*
- * @param $flags String
+ * @param string $flags
* @return mixed
*/
public static function getVersion( $flags = '' ) {
*
* @since 1.17
*
- * @param $type String
+ * @param string $type
*
* @return string
*/
$extensionTypes = self::getExtensionTypes();
- /**
- * @deprecated as of 1.17, use hook ExtensionTypes instead.
- */
- wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) );
+ wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ), '1.17' );
$out = Xml::element(
'h2',
*
* @since 1.17
*
- * @param $type String
- * @param $message String
+ * @param string $type
+ * @param string $message
*
* @return string
*/
/**
* Callback to sort extensions by type.
- * @param $a array
- * @param $b array
+ * @param array $a
+ * @param array $b
* @return int
*/
function compare( $a, $b ) {
* - Description of extension (descriptionmsg or description)
* - List of authors (author) and link to a ((AUTHORS)|(CREDITS))(\.txt)? file if it exists
*
- * @param $extension Array
+ * @param array $extension
*
- * @return string raw HTML
+ * @return string Raw HTML
*/
function getCreditsForExtension( array $extension ) {
$out = $this->getOutput();
* @return string
*/
function listToText( $list, $sort = true ) {
- $cnt = count( $list );
-
- if ( $cnt == 1 ) {
- // Enforce always returning a string
- return (string)self::arrayToString( $list[0] );
- } elseif ( $cnt == 0 ) {
+ if ( !count( $list ) ) {
return '';
- } else {
- if ( $sort ) {
- sort( $list );
- }
-
- return $this->getLanguage()
- ->listToText( array_map( array( __CLASS__, 'arrayToString' ), $list ) );
}
+ if ( $sort ) {
+ sort( $list );
+ }
+
+ return $this->getLanguage()
+ ->listToText( array_map( array( __CLASS__, 'arrayToString' ), $list ) );
}
/**
* Convert an array or object to a string for display.
*
- * @param mixed $list will convert an array to string if given and return
+ * @param mixed $list Will convert an array to string if given and return
* the paramater unaltered otherwise
*
* @return mixed
* url The subversion URL of the directory
* repo-url The base URL of the repository
* viewvc-url A ViewVC URL pointing to the checked-out revision
- * @param $dir string
+ * @param string $dir
* @return array|bool
*/
public static function getSvnInfo( $dir ) {
/**
* Retrieve the revision number of a Subversion working directory.
*
- * @param string $dir directory of the svn checkout
+ * @param string $dir Directory of the svn checkout
*
* @return int Revision number
*/
}
/**
- * @param string $dir directory of the git checkout
- * @return bool|String sha1 of commit HEAD points to
+ * @param string $dir Directory of the git checkout
+ * @return bool|string Sha1 of commit HEAD points to
*/
public static function getGitHeadSha1( $dir ) {
$repo = new GitInfo( $dir );
return $repo->getHeadSHA1();
}
+ /**
+ * @param string $dir Directory of the git checkout
+ * @return bool|string Branch currently checked out
+ */
+ public static function getGitCurrentBranch( $dir ) {
+ $repo = new GitInfo( $dir );
+ return $repo->getCurrentBranch();
+ }
+
/**
* Get the list of entry points and their URLs
* @return string Wikitext