* Returns the array of attributes used when linking to the Title $target
*
* @param $target Title
+ * @param $attribs
+ * @param $options
+ *
+ * @return array
*/
private static function linkAttribs( $target, $attribs, $options ) {
wfProfileIn( __METHOD__ );
* This will make a broken link if $file is false.
*
* @param $title Title object.
- * @param $file mixed File object or false
+ * @param $file File|false mixed File object or false
* @param $text String: pre-sanitized HTML
* @return String: HTML
*
}
/**
- * Make a link to a special page given its name and, optionally,
+ * Make a link to a special page given its name and, optionally,
* a message key from the link text.
* Usage example: $skin->specialLink( 'recentchanges' )
+ *
+ * @return bool
*/
static function specialLink( $name, $key = '' ) {
- if ( $key == '' ) { $key = strtolower( $name ); }
+ if ( $key == '' ) {
+ $key = strtolower( $name );
+ }
return self::linkKnown( SpecialPage::getTitleFor( $name ) , wfMsg( $key ) );
}
return $comment;
}
+ /**
+ * @param $match
+ * @return string
+ */
private static function formatAutocommentsCallback( $match ) {
$title = self::$autocommentTitle;
$local = self::$autocommentLocal;
return $comment;
}
+ /**
+ * @var Title
+ */
static $commentContextTitle;
static $commentLocal;
return $html;
}
+ /**
+ * @param $match
+ * @return mixed
+ */
protected static function formatLinksInCommentCallback( $match ) {
global $wgContLang;
return $block;
}
+ /**
+ * @param $size
+ * @return string
+ */
public static function formatRevisionSize( $size ) {
if ( $size == 0 ) {
$stxt = wfMsgExt( 'historyempty', 'parsemag' );
/**
* Add another level to the Table of Contents
+ *
+ * @return string
*/
static function tocIndent() {
return "\n<ul>";
/**
* Finish one or more sublevels on the Table of Contents
+ *
+ * @return string
*/
static function tocUnindent( $level ) {
return "</li>\n" . str_repeat( "</ul>\n</li>\n", $level > 0 ? $level : 0 );
/**
* parameter level defines if we are on an indentation level
+ *
+ * @return string
*/
static function tocLine( $anchor, $tocline, $tocnumber, $level, $sectionIndex = false ) {
$classes = "toclevel-$level";
- if ( $sectionIndex !== false )
+ if ( $sectionIndex !== false ) {
$classes .= " tocsection-$sectionIndex";
+ }
return "\n<li class=\"$classes\"><a href=\"#" .
$anchor . '"><span class="tocnumber">' .
$tocnumber . '</span> <span class="toctext">' .
*
* STUB
* Overridden by LocalFile, UnregisteredLocalFile
+ *
+ * @return false|number
*/
public function getHeight( $page = 1 ) {
return false;
* STUB
*
* @param $type string 'text' or 'id'
+ *
+ * @return string|int
*/
- public function getUser( $type='text' ) {
+ public function getUser( $type = 'text' ) {
return null;
}
}
/**
- * Return true if the file is vectorized
+ * Return true if the file is vectorized
*
- * @retur bool
+ * @return bool
*/
public function isVectorized() {
$handler = $this->getHandler();
* Overridden by LocalFile, UnregisteredLocalFile
* STUB
*/
- public function getMetadata() { return false; }
+ public function getMetadata() {
+ return false;
+ }
/**
* get versioned metadata
* Overridden by LocalFile
* STUB
*/
- public function getBitDepth() { return 0; }
+ public function getBitDepth() {
+ return 0;
+ }
/**
* Return the size of the image file, in bytes
* Overridden by LocalFile, UnregisteredLocalFile
* STUB
*/
- public function getSize() { return false; }
+ public function getSize() {
+ return false;
+ }
/**
* Returns the mime type of the file.
*
* @return string
*/
- function getMimeType() { return 'unknown/unknown'; }
+ function getMimeType() {
+ return 'unknown/unknown';
+ }
/**
* Return the type of the media in the file.
return $this->isSafeFile;
}
- /** Accessor for __get() */
+ /**
+ * Accessor for __get()
+ *
+ * @return bool
+ */
protected function getIsSafeFile() {
return $this->isSafeFile();
}
- /** Uncached accessor */
+ /**
+ * Uncached accessor
+ *
+ * @return bool
+ */
protected function _getIsSafeFile() {
if ( $this->allowInlineDisplay() ) {
return true;
* @return string
*/
function getArchivePath( $suffix = false ) {
- return $this->repo->getZonePath('public') . '/' . $this->getArchiveRel( $suffix );
+ return $this->repo->getZonePath( 'public' ) . '/' . $this->getArchiveRel( $suffix );
}
/**
* @return string
*/
function getThumbPath( $suffix = false ) {
- $path = $this->repo->getZonePath('thumb') . '/' . $this->getRel();
+ $path = $this->repo->getZonePath( 'thumb' ) . '/' . $this->getRel();
if ( $suffix !== false ) {
$path .= '/' . $suffix;
}
/**
* Get the virtual URL for an archive file or directory
*
- * @param $suffix string
+ * @param bool|string $suffix
*
* @return string
*/
return $this->repo->isHashed();
}
+ /**
+ * @throws MWException
+ */
function readOnlyError() {
throw new MWException( get_class($this) . ': write operations are not supported' );
}
return new PPCustomFrame_Hash( $this, $args );
}
+ /**
+ * @param $values array
+ * @return PPNode_Hash_Array
+ */
function newPartNodeArray( $values ) {
$list = array();
* cache may be implemented at a later date which takes further advantage of these strict
* dependency requirements.
*
- * @private
+ * @return PPNode_Hash_Tree
*/
function preprocessToObj( $text, $flags = 0 ) {
wfProfileIn( __METHOD__ );
extract( $stack->getFlags() );
$i += $count;
}
- }
-
- elseif ( $found == 'line-end' ) {
+ } elseif ( $found == 'line-end' ) {
$piece = $stack->top;
// A heading must be open, otherwise \n wouldn't have been in the search list
assert( $piece->open == "\n" );
// another heading. Infinite loops are avoided because the next iteration MUST
// hit the heading open case above, which unconditionally increments the
// input pointer.
- }
-
- elseif ( $found == 'open' ) {
+ } elseif ( $found == 'open' ) {
# count opening brace characters
$count = strspn( $text, $curChar, $i );
$accum->addLiteral( str_repeat( $curChar, $count ) );
}
$i += $count;
- }
-
- elseif ( $found == 'close' ) {
+ } elseif ( $found == 'close' ) {
$piece = $stack->top;
# lets check if there are enough characters for closing brace
$maxCount = $piece->count;
} else {
$accum->addAccum( $element );
}
- }
-
- elseif ( $found == 'pipe' ) {
+ } elseif ( $found == 'pipe' ) {
$findEquals = true; // shortcut for getFlags()
$stack->addPart();
$accum =& $stack->getAccum();
++$i;
- }
-
- elseif ( $found == 'equals' ) {
+ } elseif ( $found == 'equals' ) {
$findEquals = false; // shortcut for getFlags()
$accum->addNodeWithText( 'equals', '=' );
$stack->getCurrentPart()->eqpos = $accum->lastNode;
/**
* Get the accumulator that would result if the close is not found.
+ *
+ * @return PPDAccum_Hash
*/
function breakSyntax( $openingCount = false ) {
if ( $this->open == "\n" ) {
/**
* Create a new child frame
* $args is optionally a multi-root PPNode or array containing the template arguments
+ *
+ * @param $args PPNode_Hash_Array|array
+ * @param $title Title|false
+ *
+ * @return PPTemplateFrame_Hash
*/
function newChild( $args = false, $title = false ) {
$namedArgs = array();
return new PPTemplateFrame_Hash( $this->preprocessor, $this, $numberedArgs, $namedArgs, $title );
}
+ /**
+ * @throws MWException
+ * @param $root
+ * @param $flags int
+ * @return string
+ */
function expand( $root, $flags = 0 ) {
static $expansionDepth = 0;
if ( is_string( $root ) ) {
return $outStack[0];
}
+ /**
+ * @param $sep
+ * @param $flags
+ * @return string
+ */
function implodeWithFlags( $sep, $flags /*, ... */ ) {
$args = array_slice( func_get_args(), 2 );
/**
* Implode with no flags specified
* This previously called implodeWithFlags but has now been inlined to reduce stack depth
+ * @return string
*/
function implode( $sep /*, ... */ ) {
$args = array_slice( func_get_args(), 1 );
/**
* Makes an object that, when expand()ed, will be the same as one obtained
* with implode()
+ *
+ * @return PPNode_Hash_Array
*/
function virtualImplode( $sep /*, ... */ ) {
$args = array_slice( func_get_args(), 1 );
/**
* Virtual implode with brackets
+ *
+ * @return PPNode_Hash_Array
*/
function virtualBracketedImplode( $start, $sep, $end /*, ... */ ) {
$args = array_slice( func_get_args(), 3 );
return 'frame{}';
}
+ /**
+ * @param $level bool
+ * @return array|bool|String
+ */
function getPDBK( $level = false ) {
if ( $level === false ) {
return $this->title->getPrefixedDBkey();
}
}
+ /**
+ * @return array
+ */
function getArguments() {
return array();
}
+ /**
+ * @return array
+ */
function getNumberedArguments() {
return array();
}
+ /**
+ * @return array
+ */
function getNamedArguments() {
return array();
}
/**
* Returns true if there are no arguments in this frame
+ *
+ * @return bool
*/
function isEmpty() {
return true;
}
+ /**
+ * @param $name
+ * @return bool
+ */
function getArgument( $name ) {
return false;
}
* Returns true if the infinite loop check is OK, false if a loop is detected
*
* @param $title Title
+ *
+ * @return bool
*/
function loopCheck( $title ) {
return !isset( $this->loopCheckHash[$title->getPrefixedDBkey()] );
/**
* Return true if the frame is a template frame
+ *
+ * @return bool
*/
function isTemplate() {
return false;
return $arguments;
}
+ /**
+ * @param $index
+ * @return array|bool
+ */
function getNumberedArgument( $index ) {
if ( !isset( $this->numberedArgs[$index] ) ) {
return false;
return $this->numberedExpansionCache[$index];
}
+ /**
+ * @param $name
+ * @return bool
+ */
function getNamedArgument( $name ) {
if ( !isset( $this->namedArgs[$name] ) ) {
return false;
return $this->namedExpansionCache[$name];
}
+ /**
+ * @param $name
+ * @return array|bool
+ */
function getArgument( $name ) {
$text = $this->getNumberedArgument( $name );
if ( $text === false ) {
/**
* Return true if the frame is a template frame
+ *
+ * @return bool
*/
function isTemplate() {
return true;
return $s;
}
+ /**
+ * @return bool
+ */
function isEmpty() {
return !count( $this->args );
}
+ /**
+ * @param $index
+ * @return bool
+ */
function getArgument( $index ) {
if ( !isset( $this->args[$index] ) ) {
return false;
}
}
+ /**
+ * @param $name
+ * @param $text
+ * @return PPNode_Hash_Tree
+ */
static function newWithText( $name, $text ) {
$obj = new self( $name );
$obj->addChild( new PPNode_Hash_Text( $text ) );
}
}
+ /**
+ * @return PPNode_Hash_Array
+ */
function getChildren() {
$children = array();
for ( $child = $this->firstChild; $child; $child = $child->nextSibling ) {
return $children;
}
- function getLength() { return false; }
- function item( $i ) { return false; }
+ /**
+ * @return bool
+ */
+ function getLength() {
+ return false;
+ }
+
+ /**
+ * @param $i
+ * @return bool
+ */
+ function item( $i ) {
+ return false;
+ }
+ /**
+ * @return string
+ */
function getName() {
return $this->name;
}
* name PPNode name
* index String index
* value PPNode value
+ *
+ * @return array
*/
function splitArg() {
$bits = array();
/**
* Split an <ext> node into an associative array containing name, attr, inner and close
* All values in the resulting array are PPNodes. Inner and close are optional.
+ *
+ * @return array
*/
function splitExt() {
$bits = array();
/**
* Split an <h> node
+ *
+ * @return array
*/
function splitHeading() {
if ( $this->name !== 'h' ) {
/**
* Split a <template> or <tplarg> node
+ *
+ * @return array
*/
function splitTemplate() {
$parts = array();