Fix unused variables

Fix trailing whitespace

Add/Improve documentation

Explicit member variable declaration
This commit is contained in:
Sam Reed 2012-01-28 17:05:20 +00:00
parent 59b52cc430
commit 92dcd85c98
Notes: Sam Reed 2012-01-28 17:05:20 +00:00
2 changed files with 21 additions and 1 deletions

View file

@ -13,6 +13,10 @@ $wgExtensionCredits['parserhook']['ImageMap'] = array(
'descriptionmsg' => 'imagemap_desc',
);
/**
* @param $parser Parser
* @return bool
*/
function wfSetupImageMap( &$parser ) {
$parser->setHook( 'imagemap', array( 'ImageMap', 'render' ) );
return true;

View file

@ -26,7 +26,13 @@ class ImageMap {
const TOP_LEFT = 3;
const NONE = 4;
static function render( $input, $params, $parser ) {
/**
* @param $input
* @param $params
* @param $parser Parser
* @return array|mixed|string
*/
public static function render( $input, $params, $parser ) {
global $wgScriptPath, $wgUrlProtocols, $wgNoFollowLinks;
$lines = explode( "\n", $input );
@ -346,6 +352,11 @@ class ImageMap {
return $output;
}
/**
* @param $count int
* @param $lineNum int|string
* @return array|string
*/
static function tokenizeCoords( $count, $lineNum ) {
$coords = array();
for ( $i = 0; $i < $count; $i++ ) {
@ -361,6 +372,11 @@ class ImageMap {
return $coords;
}
/**
* @param $name string
* @param $line string|int
* @return string
*/
static function error( $name, $line = false ) {
return '<p class="error">' . wfMsgForContent( $name, $line ) . '</p>';
}