http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89068
Revision: 89068
Author: reedy
Date: 2011-05-28 20:44:24 +0000 (Sat, 28 May 2011)
Log Message:
-----------
Documentation
Modified Paths:
--------------
trunk/extensions/Cite/Cite.php
trunk/extensions/Cite/Cite_body.php
trunk/extensions/Cite/SpecialCite.php
trunk/extensions/Cite/SpecialCite_body.php
Modified: trunk/extensions/Cite/Cite.php
===================================================================
--- trunk/extensions/Cite/Cite.php 2011-05-28 20:12:02 UTC (rev 89067)
+++ trunk/extensions/Cite/Cite.php 2011-05-28 20:44:24 UTC (rev 89068)
@@ -47,6 +47,10 @@
* Performs the hook registration.
* Note that several extensions (and even core!) try to detect if Cite is
* installed by looking for wfCite().
+ *
+ * @param $parser Parser
+ *
+ * @return bool
*/
function wfCite( $parser ) {
return Cite::setHooks( $parser );
Modified: trunk/extensions/Cite/Cite_body.php
===================================================================
--- trunk/extensions/Cite/Cite_body.php 2011-05-28 20:12:02 UTC (rev 89067)
+++ trunk/extensions/Cite/Cite_body.php 2011-05-28 20:44:24 UTC (rev 89068)
@@ -87,7 +87,6 @@
*/
var $mBacklinkLabels;
-
/**
* The links to use per group, in order.
*
@@ -96,7 +95,7 @@
var $mLinkLabels = array();
/**
- * @var object
+ * @var Parser
*/
var $mParser;
@@ -141,6 +140,7 @@
/**
* Variable holding the singleton.
+ * @var Cite
*/
static protected $instance = null;
@@ -149,8 +149,10 @@
/**
* Callback function for <ref>
*
- * @param string $str Input
- * @param array $argv Arguments
+ * @param $str string Input
+ * @param $argv array Arguments
+ * @param $parser Parser
+ *
* @return string
*/
function ref( $str, $argv, $parser ) {
@@ -165,6 +167,13 @@
}
}
+ /**
+ * @param $str string Input
+ * @param $argv array Arguments
+ * @param $parser Parser
+ * @param $default_group string
+ * @return string
+ */
function guardedRef( $str, $argv, $parser, $default_group =
CITE_DEFAULT_GROUP ) {
$this->mParser = $parser;
@@ -291,9 +300,8 @@
* "group" : Group to which it belongs. Needs to be passed to
<references /> too.
* "follow" : If the current reference is the continuation of another,
key of that reference.
*
- * @static
*
- * @param array $argv The argument vector
+ * @param $argv array The argument vector
* @return mixed false on invalid input, a string on valid
* input and null on no input
*/
@@ -350,8 +358,12 @@
/**
* Populate $this->mRefs based on input and arguments to <ref>
*
- * @param string $str Input from the <ref> tag
- * @param mixed $key Argument to the <ref> tag as returned by
$this->refArg()
+ * @param $str string Input from the <ref> tag
+ * @param $key mixed Argument to the <ref> tag as returned by
$this->refArg()
+ * @param $group
+ * @param $follow
+ * @param $call
+ *
* @return string
*/
function stack( $str, $key = null, $group, $follow, $call ) {
@@ -453,6 +465,11 @@
* This function is not a total rollback since some internal
* counters remain incremented. Doing so prevents accidentally
* corrupting certain links.
+ *
+ * @param $type
+ * @param $key
+ * @param $group
+ * @param $index
*/
function rollbackRef( $type, $key, $group, $index ) {
if ( !isset( $this->mRefs[$group] ) ) {
@@ -502,8 +519,10 @@
/**
* Callback function for <references>
*
- * @param string $str Input
- * @param array $argv Arguments
+ * @param $str string Input
+ * @param $argv array Arguments
+ * @param $parser Parser
+ *
* @return string
*/
function references( $str, $argv, $parser ) {
@@ -522,6 +541,13 @@
}
}
+ /**
+ * @param $str string
+ * @param $argv array
+ * @param $parser Parser
+ * @param $group string
+ * @return string
+ */
function guardedReferences( $str, $argv, $parser, $group =
CITE_DEFAULT_GROUP ) {
global $wgAllowCiteGroups;
@@ -591,7 +617,9 @@
/**
* Make output to be returned from the references() function
- *
+ *
+ * @param $group
+ *
* @return string XHTML ready for output
*/
function referencesFormat( $group ) {
@@ -845,12 +873,15 @@
* Generate a link (<sup ...) for the <ref> element from a key
* and return XHTML ready for output
*
- * @param string $key The key for the link
- * @param int $count The index of the key, used for distinguishing
+ * @param $group
+ * @param $key string The key for the link
+ * @param $count int The index of the key, used for distinguishing
* multiple occurances of the same key
- * @param int $label The label to use for the link, I want to
+ * @param $label int The label to use for the link, I want to
* use the same label for all occourances of
* the same named reference.
+ * @param $subkey string
+ *
* @return string
*/
function linkRef( $group, $key, $count = null, $label = null, $subkey =
'' ) {
@@ -864,7 +895,7 @@
$this->refKey( $key, $count ),
$this->referencesKey( $key . $subkey ),
$this->getLinkLabel( $label, $group,
- ( ( $group ==
CITE_DEFAULT_GROUP ) ? '':"$group " ) . $wgContLang->formatNum( $label ) )
+ ( ( $group ==
CITE_DEFAULT_GROUP ) ? '' : "$group " ) . $wgContLang->formatNum( $label ) )
)
);
}
@@ -966,6 +997,9 @@
* Generate the labels to pass to the
* 'cite_reference_link' message instead of numbers, the format is an
* arbitrary number of tokens separated by [\t\n ]
+ *
+ * @param $group
+ * @param $message
*/
function genLinkLabels( $group, $message ) {
wfProfileIn( __METHOD__ );
@@ -981,6 +1015,10 @@
/**
* Gets run when Parser::clearState() gets run, since we don't
* want the counts to transcend pages and other instances
+ *
+ * @param $parser Parser
+ *
+ * @return bool
*/
function clearState( $parser ) {
global $wgParser;
@@ -1004,6 +1042,11 @@
/**
* Called at the end of page processing to append an error if refs were
* used without a references tag.
+ *
+ * @param $parser Parser
+ * @param $text string
+ *
+ * @return bool
*/
function checkRefsNoReferences( &$parser, &$text ) {
if ( $parser->getOptions()->getIsSectionPreview() ) {
@@ -1027,6 +1070,10 @@
/**
* Hook for the InlineEditor extension. If any ref or reference
reference tag is in the text, the entire
* page should be reparsed, so we return false in that case.
+ *
+ * @param $output
+ *
+ * @return bool
*/
function checkAnyCalls( &$output ) {
return ( $this->mCallCnt <= 0 );
@@ -1034,6 +1081,10 @@
/**
* Initialize the parser hooks
+ *
+ * @param $parser Parser
+ *
+ * @return bool
*/
static function setHooks( $parser ) {
global $wgHooks;
Modified: trunk/extensions/Cite/SpecialCite.php
===================================================================
--- trunk/extensions/Cite/SpecialCite.php 2011-05-28 20:12:02 UTC (rev
89067)
+++ trunk/extensions/Cite/SpecialCite.php 2011-05-28 20:44:24 UTC (rev
89068)
@@ -33,6 +33,13 @@
$wgSpecialPages['Cite'] = 'SpecialCite';
$wgAutoloadClasses['SpecialCite'] = $dir . 'SpecialCite_body.php';
+/**
+ * @param $skintemplate SkinTemplate
+ * @param $nav_urls
+ * @param $oldid
+ * @param $revid
+ * @return bool
+ */
function wfSpecialCiteNav( &$skintemplate, &$nav_urls, &$oldid, &$revid ) {
// check whether we’re in the right namespace, the $revid has the
correct type and is not empty
// (what would mean that the current page doesn’t exist)
@@ -46,9 +53,13 @@
/**
* add the cite link to the toolbar
+ *
+ * @param $skin Skin
+ *
+ * @return bool
*/
function wfSpecialCiteToolbox( &$skin ) {
-global $wgUser;
+ global $wgUser;
if ( isset( $skin->data['nav_urls']['cite'] ) ) {
echo Html::rawElement(
Modified: trunk/extensions/Cite/SpecialCite_body.php
===================================================================
--- trunk/extensions/Cite/SpecialCite_body.php 2011-05-28 20:12:02 UTC (rev
89067)
+++ trunk/extensions/Cite/SpecialCite_body.php 2011-05-28 20:44:24 UTC (rev
89068)
@@ -32,9 +32,9 @@
}
$cform = new CiteForm( $title );
- if ( !$title || ! $article->exists() )
+ if ( !$title || ! $article->exists() ) {
$cform->execute();
- else {
+ } else {
$cform->execute();
$cout = new CiteOutput( $title, $article, $id );
@@ -44,6 +44,10 @@
}
class CiteForm {
+
+ /**
+ * @var Title
+ */
var $mTitle;
function __construct( &$title ) {
@@ -88,9 +92,31 @@
}
class CiteOutput {
- var $mTitle, $mArticle, $mId;
- var $mParser, $mParserOptions, $mSpTitle;
+ /**
+ * @var Title
+ */
+ var $mTitle;
+
+ /**
+ * @var Article
+ */
+ var $mArticle;
+
+ var $mId;
+
+ /**
+ * @var Parser
+ */
+ var $mParser;
+
+ /**
+ * @var ParserOptions
+ */
+ var $mParserOptions;
+
+ var $mSpTitle;
+
function __construct( &$title, &$article, $id ) {
global $wgHooks, $wgParser;
@@ -138,11 +164,14 @@
return $ret->getText();
}
- function varCache() { return false; }
+ function varCache() {
+ return false;
+ }
function timestamp( &$parser, &$ts ) {
- if ( isset( $parser->mTagHooks['citation'] ) )
+ if ( isset( $parser->mTagHooks['citation'] ) ) {
$ts = wfTimestamp( TS_UNIX,
$this->mArticle->getTimestamp() );
+ }
return true;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs