X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FArticle.php;h=0a4b5ee30e33cfc94550873507a8a48544a48b10;hb=39aa51bfbed8dd557d945d568963c2dad5429016;hp=b132ca9f9a7875863a00acbfd96402431146c40c;hpb=89ca4641e6247f3764233a4158fe884d43288447;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/Article.php b/includes/Article.php
index b132ca9f9a..0a4b5ee30e 100644
--- a/includes/Article.php
+++ b/includes/Article.php
@@ -90,7 +90,7 @@ class Article implements Page {
/**
* URL to redirect to or false if none
- * @var string|false $mRedirectUrl
+ * @var string|bool $mRedirectUrl
*/
var $mRedirectUrl = false; // !<
@@ -116,8 +116,8 @@ class Article implements Page {
/**
* Constructor and clear the article
- * @param $title Title Reference to a Title object.
- * @param $oldId Integer revision ID, null to fetch from request, zero for current
+ * @param Title $title Reference to a Title object.
+ * @param int $oldId Revision ID, null to fetch from request, zero for current
*/
public function __construct( Title $title, $oldId = null ) {
$this->mOldId = $oldId;
@@ -125,7 +125,7 @@ class Article implements Page {
}
/**
- * @param $title Title
+ * @param Title $title
* @return WikiPage
*/
protected function newPage( Title $title ) {
@@ -134,7 +134,7 @@ class Article implements Page {
/**
* Constructor from a page id
- * @param int $id article ID to load
+ * @param int $id Article ID to load
* @return Article|null
*/
public static function newFromID( $id ) {
@@ -147,9 +147,9 @@ class Article implements Page {
/**
* Create an Article object of the appropriate class for the given page.
*
- * @param $title Title
- * @param $context IContextSource
- * @return Article object
+ * @param Title $title
+ * @param IContextSource $context
+ * @return Article
*/
public static function newFromTitle( $title, IContextSource $context ) {
if ( NS_MEDIA == $title->getNamespace() ) {
@@ -179,9 +179,9 @@ class Article implements Page {
/**
* Create an Article object of the appropriate class for the given page.
*
- * @param $page WikiPage
- * @param $context IContextSource
- * @return Article object
+ * @param WikiPage $page
+ * @param IContextSource $context
+ * @return Article
*/
public static function newFromWikiPage( WikiPage $page, IContextSource $context ) {
$article = self::newFromTitle( $page->getTitle(), $context );
@@ -192,7 +192,7 @@ class Article implements Page {
/**
* Tell the page view functions that this view was redirected
* from another page on the wiki.
- * @param $from Title object.
+ * @param Title $from
*/
public function setRedirectedFrom( Title $from ) {
$this->mRedirectedFrom = $from;
@@ -201,7 +201,7 @@ class Article implements Page {
/**
* Get the title object of the article
*
- * @return Title object of this page
+ * @return Title Title object of this page
*/
public function getTitle() {
return $this->mPage->getTitle();
@@ -238,7 +238,7 @@ class Article implements Page {
* This function has side effects! Do not use this function if you
* only want the real revision text if any.
*
- * @deprecated in 1.21; use WikiPage::getContent() instead
+ * @deprecated since 1.21; use WikiPage::getContent() instead
*
* @return string Return the text of this revision
*/
@@ -290,8 +290,7 @@ class Article implements Page {
}
/**
- * @return int The oldid of the article that is to be shown, 0 for the
- * current revision
+ * @return int The oldid of the article that is to be shown, 0 for the current revision
*/
public function getOldID() {
if ( is_null( $this->mOldId ) ) {
@@ -355,7 +354,7 @@ class Article implements Page {
/**
* Load the revision (including text) into this object
*
- * @deprecated in 1.19; use fetchContent()
+ * @deprecated since 1.19; use fetchContent()
*/
function loadContent() {
wfDeprecated( __METHOD__, '1.19' );
@@ -367,12 +366,14 @@ class Article implements Page {
* Does *NOT* follow redirects.
*
* @protected
- * @note this is really internal functionality that should really NOT be used by other functions. For accessing
- * article content, use the WikiPage class, especially WikiBase::getContent(). However, a lot of legacy code
- * uses this method to retrieve page text from the database, so the function has to remain public for now.
+ * @note This is really internal functionality that should really NOT be
+ * used by other functions. For accessing article content, use the WikiPage
+ * class, especially WikiBase::getContent(). However, a lot of legacy code
+ * uses this method to retrieve page text from the database, so the function
+ * has to remain public for now.
*
- * @return mixed string containing article contents, or false if null
- * @deprecated in 1.21, use WikiPage::getContent() instead
+ * @return string|bool String containing article contents, or false if null
+ * @deprecated since 1.21, use WikiPage::getContent() instead
*/
function fetchContent() { #BC cruft!
ContentHandler::deprecated( __METHOD__, '1.21' );
@@ -385,6 +386,11 @@ class Article implements Page {
$content = $this->fetchContentObject();
+ if ( !$content ) {
+ wfProfileOut( __METHOD__ );
+ return false;
+ }
+
// @todo Get rid of mContent everywhere!
$this->mContent = ContentHandler::getContentText( $content );
ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent', array( &$this, &$this->mContent ) );
@@ -397,11 +403,12 @@ class Article implements Page {
/**
* Get text content object
* Does *NOT* follow redirects.
- * TODO: when is this null?
+ * @todo When is this null?
*
- * @note code that wants to retrieve page content from the database should use WikiPage::getContent().
+ * @note Code that wants to retrieve page content from the database should
+ * use WikiPage::getContent().
*
- * @return Content|null|boolean false
+ * @return Content|null|bool
*
* @since 1.21
*/
@@ -434,7 +441,8 @@ class Article implements Page {
}
} else {
if ( !$this->mPage->getLatest() ) {
- wfDebug( __METHOD__ . " failed to find page data for title " . $this->getTitle()->getPrefixedText() . "\n" );
+ wfDebug( __METHOD__ . " failed to find page data for title " .
+ $this->getTitle()->getPrefixedText() . "\n" );
wfProfileOut( __METHOD__ );
return false;
}
@@ -442,7 +450,8 @@ class Article implements Page {
$this->mRevision = $this->mPage->getRevision();
if ( !$this->mRevision ) {
- wfDebug( __METHOD__ . " failed to retrieve current page, rev_id " . $this->mPage->getLatest() . "\n" );
+ wfDebug( __METHOD__ . " failed to retrieve current page, rev_id " .
+ $this->mPage->getLatest() . "\n" );
wfProfileOut( __METHOD__ );
return false;
}
@@ -450,7 +459,11 @@ class Article implements Page {
// @todo FIXME: Horrible, horrible! This content-loading interface just plain sucks.
// We should instead work with the Revision object when we need it...
- $this->mContentObject = $this->mRevision->getContent( Revision::FOR_THIS_USER, $this->getContext()->getUser() ); // Loads if user is allowed
+ // Loads if user is allowed
+ $this->mContentObject = $this->mRevision->getContent(
+ Revision::FOR_THIS_USER,
+ $this->getContext()->getUser()
+ );
$this->mRevIdFetched = $this->mRevision->getId();
wfRunHooks( 'ArticleAfterFetchContentObject', array( &$this, &$this->mContentObject ) );
@@ -490,7 +503,7 @@ class Article implements Page {
/**
* Use this to fetch the rev ID used on page views
*
- * @return int revision ID of last article revision
+ * @return int Revision ID of last article revision
*/
public function getRevIdFetched() {
if ( $this->mRevIdFetched ) {
@@ -711,7 +724,8 @@ class Article implements Page {
# Don't cache a dirty ParserOutput object
if ( $poolArticleView->getIsDirty() ) {
$outputPage->setSquidMaxage( 0 );
- $outputPage->addHTML( "\n" );
+ $outputPage->addHTML( "\n" );
}
$outputDone = true;
@@ -759,7 +773,7 @@ class Article implements Page {
/**
* Adjust title for pages with displaytitle, -{T|}- or language conversion
- * @param $pOutput ParserOutput
+ * @param ParserOutput $pOutput
*/
public function adjustDisplayTitle( ParserOutput $pOutput ) {
# Adjust the title if it was set by displaytitle, -{T|}- or language conversion
@@ -794,13 +808,21 @@ class Article implements Page {
}
$contentHandler = $rev->getContentHandler();
- $de = $contentHandler->createDifferenceEngine( $this->getContext(), $oldid, $diff, $rcid, $purge, $unhide );
+ $de = $contentHandler->createDifferenceEngine(
+ $this->getContext(),
+ $oldid,
+ $diff,
+ $rcid,
+ $purge,
+ $unhide
+ );
// DifferenceEngine directly fetched the revision:
$this->mRevIdFetched = $de->mNewid;
$de->showDiffPage( $diffOnly );
- // Run view updates for the newer revision being diffed (and shown below the diff if not $diffOnly)
+ // Run view updates for the newer revision being diffed (and shown
+ // below the diff if not $diffOnly).
list( $old, $new ) = $de->mapDiffPrevNext( $oldid, $diff );
// New can be false, convert it to 0 - this conveniently means the latest revision
$this->mPage->doViewUpdates( $user, (int)$new );
@@ -813,7 +835,8 @@ class Article implements Page {
* This is hooked by SyntaxHighlight_GeSHi to do syntax highlighting of these
* page views.
*
- * @param bool $showCacheHint whether to show a message telling the user to clear the browser cache (default: true).
+ * @param bool $showCacheHint Whether to show a message telling the user
+ * to clear the browser cache (default: true).
*/
protected function showCssOrJsPage( $showCacheHint = true ) {
$outputPage = $this->getContext()->getOutput();
@@ -822,15 +845,20 @@ class Article implements Page {
$dir = $this->getContext()->getLanguage()->getDir();
$lang = $this->getContext()->getLanguage()->getCode();
- $outputPage->wrapWikiMsg( "
\n$1\n
",
- 'clearyourcache' );
+ $outputPage->wrapWikiMsg(
+ "\n$1\n
",
+ 'clearyourcache'
+ );
}
$this->fetchContentObject();
if ( $this->mContentObject ) {
// Give hooks a chance to customise the output
- if ( ContentHandler::runLegacyHooks( 'ShowRawCssJs', array( $this->mContentObject, $this->getTitle(), $outputPage ) ) ) {
+ if ( ContentHandler::runLegacyHooks(
+ 'ShowRawCssJs',
+ array( $this->mContentObject, $this->getTitle(), $outputPage ) )
+ ) {
$po = $this->mContentObject->getParserOutput( $this->getTitle() );
$outputPage->addHTML( $po->getText() );
}
@@ -839,10 +867,10 @@ class Article implements Page {
/**
* Get the robot policy to be used for the current view
- * @param string $action the action= GET parameter
- * @param $pOutput ParserOutput|null
- * @return Array the policy that should be set
- * TODO: actions other than 'view'
+ * @param string $action The action= GET parameter
+ * @param ParserOutput|null $pOutput
+ * @return array The policy that should be set
+ * @todo: actions other than 'view'
*/
public function getRobotPolicy( $action, $pOutput = null ) {
global $wgArticleRobotPolicies, $wgNamespaceRobotPolicies, $wgDefaultRobotPolicy;
@@ -920,9 +948,9 @@ class Article implements Page {
/**
* Converts a String robot policy into an associative array, to allow
* merging of several policies using array_merge().
- * @param $policy Mixed, returns empty array on null/false/'', transparent
- * to already-converted arrays, converts String.
- * @return Array: 'index' => \, 'follow' => \
+ * @param array|string $policy Returns empty array on null/false/'', transparent
+ * to already-converted arrays, converts string.
+ * @return array 'index' => \, 'follow' => \
*/
public static function formatRobotPolicy( $policy ) {
if ( is_array( $policy ) ) {
@@ -951,7 +979,7 @@ class Article implements Page {
* the output. Returns true if the header was needed, false if this is not
* a redirect view. Handles both local and remote redirects.
*
- * @return boolean
+ * @return bool
*/
public function showRedirectedFromHeader() {
global $wgRedirectSources;
@@ -1007,7 +1035,10 @@ class Article implements Page {
public function showNamespaceHeader() {
if ( $this->getTitle()->isTalkPage() ) {
if ( !wfMessage( 'talkpageheader' )->isDisabled() ) {
- $this->getContext()->getOutput()->wrapWikiMsg( "", array( 'talkpageheader' ) );
+ $this->getContext()->getOutput()->wrapWikiMsg(
+ "",
+ array( 'talkpageheader' )
+ );
}
}
}
@@ -1017,7 +1048,9 @@ class Article implements Page {
*/
public function showViewFooter() {
# check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page
- if ( $this->getTitle()->getNamespace() == NS_USER_TALK && IP::isValid( $this->getTitle()->getText() ) ) {
+ if ( $this->getTitle()->getNamespace() == NS_USER_TALK
+ && IP::isValid( $this->getTitle()->getText() )
+ ) {
$this->getContext()->getOutput()->addWikiMsg( 'anontalkpagetext' );
}
@@ -1025,7 +1058,6 @@ class Article implements Page {
$patrolFooterShown = $this->showPatrolFooter();
wfRunHooks( 'ArticleViewFooter', array( $this, $patrolFooterShown ) );
-
}
/**
@@ -1045,7 +1077,9 @@ class Article implements Page {
$cache = wfGetMainCache();
$rc = false;
- if ( !$this->getTitle()->quickUserCan( 'patrol', $user ) || !( $wgUseRCPatrol || $wgUseNPPatrol ) ) {
+ if ( !$this->getTitle()->quickUserCan( 'patrol', $user )
+ || !( $wgUseRCPatrol || $wgUseNPPatrol )
+ ) {
// Patrolling is disabled or the user isn't allowed to
return false;
}
@@ -1064,7 +1098,9 @@ class Article implements Page {
return false;
}
- if ( $this->mRevision && !RecentChange::isInRCLifespan( $this->mRevision->getTimestamp(), 21600 ) ) {
+ if ( $this->mRevision
+ && !RecentChange::isInRCLifespan( $this->mRevision->getTimestamp(), 21600 )
+ ) {
// The current revision is already older than what could be in the RC table
// 6h tolerance because the RC might not be cleaned out regularly
wfProfileOut( __METHOD__ );
@@ -1079,7 +1115,9 @@ class Article implements Page {
__METHOD__
);
- if ( $oldestRevisionTimestamp && RecentChange::isInRCLifespan( $oldestRevisionTimestamp, 21600 ) ) {
+ if ( $oldestRevisionTimestamp
+ && RecentChange::isInRCLifespan( $oldestRevisionTimestamp, 21600 )
+ ) {
// 6h tolerance because the RC might not be cleaned out regularly
$rc = RecentChange::newFromConds(
array(
@@ -1153,7 +1191,9 @@ class Article implements Page {
$validUserPage = false;
# Show info in user (talk) namespace. Does the user exist? Is he blocked?
- if ( $this->getTitle()->getNamespace() == NS_USER || $this->getTitle()->getNamespace() == NS_USER_TALK ) {
+ if ( $this->getTitle()->getNamespace() == NS_USER
+ || $this->getTitle()->getNamespace() == NS_USER_TALK
+ ) {
$parts = explode( '/', $this->getTitle()->getText() );
$rootPart = $parts[0];
$user = User::newFromName( $rootPart, false /* allow IP users*/ );
@@ -1241,7 +1281,7 @@ class Article implements Page {
* If the revision requested for view is deleted, check permissions.
* Send either an error message or a warning header to the output.
*
- * @return boolean true if the view is allowed, false if not.
+ * @return bool true if the view is allowed, false if not.
*/
public function showDeletedRevisionHeader() {
if ( !$this->mRevision->isDeleted( Revision::DELETED_TEXT ) ) {
@@ -1284,7 +1324,7 @@ class Article implements Page {
* Revision as of \; view current revision
* \<- Previous version | Next Version -\>
*
- * @param int $oldid revision ID of this article revision
+ * @param int $oldid Revision ID of this article revision
*/
public function setOldSubtitle( $oldid = 0 ) {
if ( !wfRunHooks( 'DisplayOldSubtitle', array( &$this, &$oldid ) ) ) {
@@ -1409,10 +1449,10 @@ class Article implements Page {
* Chances are you should just be using the ParserOutput from
* WikitextContent::getParserOutput instead of calling this for redirects.
*
- * @param $target Title|Array of destination(s) to redirect
- * @param $appendSubtitle Boolean [optional]
- * @param $forceKnown Boolean: should the image be shown as a bluelink regardless of existence?
- * @return string containing HMTL with redirect link
+ * @param Title|array $target Destination(s) to redirect
+ * @param bool $appendSubtitle [optional]
+ * @param bool $forceKnown Should the image be shown as a bluelink regardless of existence?
+ * @return string Containing HMTL with redirect link
*/
public function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) {
$lang = $this->getTitle()->getPageLanguage();
@@ -1431,9 +1471,9 @@ class Article implements Page {
*
* @since 1.23
* @param Language $lang
- * @param Title|array $target destination(s) to redirect
+ * @param Title|array $target Destination(s) to redirect
* @param bool $forceKnown Should the image be shown as a bluelink regardless of existence?
- * @return string containing HMTL with redirect link
+ * @return string Containing HMTL with redirect link
*/
public static function getRedirectHeaderHtml( Language $lang, $target, $forceKnown = false ) {
global $wgStylePath;
@@ -1446,9 +1486,7 @@ class Article implements Page {
// the loop prepends the arrow image before the link, so the first case needs to be outside
- /**
- * @var $title Title
- */
+ /** @var $title Title */
$title = array_shift( $target );
if ( $forceKnown ) {
@@ -1459,13 +1497,27 @@ class Article implements Page {
$nextRedirect = $wgStylePath . '/common/images/nextredirect' . $imageDir . '.png';
$alt = $lang->isRTL() ? 'â' : 'â';
- // Automatically append redirect=no to each link, since most of them are redirect pages themselves.
+
+ // Automatically append redirect=no to each link, since most of them are
+ // redirect pages themselves.
+ /** @var Title $rt */
foreach ( $target as $rt ) {
$link .= Html::element( 'img', array( 'src' => $nextRedirect, 'alt' => $alt ) );
if ( $forceKnown ) {
- $link .= Linker::linkKnown( $rt, htmlspecialchars( $rt->getFullText(), array(), array( 'redirect' => 'no' ) ) );
+ $link .= Linker::linkKnown(
+ $rt,
+ htmlspecialchars( $rt->getFullText(),
+ array(),
+ array( 'redirect' => 'no' )
+ )
+ );
} else {
- $link .= Linker::link( $rt, htmlspecialchars( $rt->getFullText() ), array(), array( 'redirect' => 'no' ) );
+ $link .= Linker::link(
+ $rt,
+ htmlspecialchars( $rt->getFullText() ),
+ array(),
+ array( 'redirect' => 'no' )
+ );
}
}
@@ -1480,6 +1532,7 @@ class Article implements Page {
*/
public function render() {
$this->getContext()->getOutput()->setArticleBodyOnly( true );
+ $this->getContext()->getOutput()->enableSectionEditLinks( false );
$this->view();
}
@@ -1572,7 +1625,8 @@ class Article implements Page {
try {
$reason = $this->generateReason( $hasHistory );
} catch ( MWException $e ) {
- # if a page is horribly broken, we still want to be able to delete it. so be lenient about errors here.
+ # if a page is horribly broken, we still want to be able to
+ # delete it. So be lenient about errors here.
wfDebug( "Error while building auto delete summary: $e" );
$reason = '';
}
@@ -1594,7 +1648,11 @@ class Article implements Page {
if ( $this->mTitle->isBigDeletion() ) {
global $wgDeleteRevisionsLimit;
$this->getContext()->getOutput()->wrapWikiMsg( "\n$1\n
\n",
- array( 'delete-warning-toobig', $this->getContext()->getLanguage()->formatNum( $wgDeleteRevisionsLimit ) ) );
+ array(
+ 'delete-warning-toobig',
+ $this->getContext()->getLanguage()->formatNum( $wgDeleteRevisionsLimit )
+ )
+ );
}
}
@@ -1604,7 +1662,7 @@ class Article implements Page {
/**
* Output deletion confirmation dialog
* @todo FIXME: Move to another file?
- * @param string $reason prefilled reason
+ * @param string $reason Prefilled reason
*/
public function confirmDelete( $reason ) {
wfDebug( "Article::confirmDelete\n" );
@@ -1647,9 +1705,14 @@ class Article implements Page {
Xml::label( wfMessage( 'deletecomment' )->text(), 'wpDeleteReasonList' ) .
"
" .
- Xml::listDropDown( 'wpDeleteReasonList',
+ Xml::listDropDown(
+ 'wpDeleteReasonList',
wfMessage( 'deletereason-dropdown' )->inContentLanguage()->text(),
- wfMessage( 'deletereasonotherlist' )->inContentLanguage()->text(), '', 'wpReasonDropDown', 1 ) .
+ wfMessage( 'deletereasonotherlist' )->inContentLanguage()->text(),
+ '',
+ 'wpReasonDropDown',
+ 1
+ ) .
" |
@@ -1690,7 +1753,10 @@ class Article implements Page {
" .
Xml::closeElement( 'table' ) .
Xml::closeElement( 'fieldset' ) .
- Html::hidden( 'wpEditToken', $user->getEditToken( array( 'delete', $this->getTitle()->getPrefixedText() ) ) ) .
+ Html::hidden(
+ 'wpEditToken',
+ $user->getEditToken( array( 'delete', $this->getTitle()->getPrefixedText() ) )
+ ) .
Xml::closeElement( 'form' );
if ( $user->isAllowed( 'editinterface' ) ) {
@@ -1715,13 +1781,14 @@ class Article implements Page {
/**
* Perform a deletion and output success or failure messages
- * @param $reason
- * @param $suppress bool
+ * @param string $reason
+ * @param bool $suppress
*/
public function doDelete( $reason, $suppress = false ) {
$error = '';
$outputPage = $this->getContext()->getOutput();
$status = $this->mPage->doDeleteArticleReal( $reason, $suppress, 0, true, $error );
+
if ( $status->isGood() ) {
$deleted = $this->getTitle()->getPrefixedText();
@@ -1733,7 +1800,11 @@ class Article implements Page {
$outputPage->addWikiMsg( 'deletedtext', wfEscapeWikiText( $deleted ), $loglink );
$outputPage->returnToMain( false );
} else {
- $outputPage->setPageTitle( wfMessage( 'cannotdelete-title', $this->getTitle()->getPrefixedText() ) );
+ $outputPage->setPageTitle(
+ wfMessage( 'cannotdelete-title',
+ $this->getTitle()->getPrefixedText() )
+ );
+
if ( $error == '' ) {
$outputPage->addWikiText(
"\n" . $status->getWikiText() . "\n
"
@@ -1759,7 +1830,7 @@ class Article implements Page {
* output to the client that is necessary for this request.
* (that is, it has sent a cached version of the page)
*
- * @return boolean true if cached version send, false otherwise
+ * @return bool true if cached version send, false otherwise
*/
protected function tryFileCache() {
static $called = false;
@@ -1815,9 +1886,9 @@ class Article implements Page {
*
* @since 1.16 (r52326) for LiquidThreads
*
- * @param $oldid mixed integer Revision ID or null
- * @param $user User The relevant user
- * @return ParserOutput or false if the given revision ID is not found
+ * @param int|null $oldid Revision ID or null
+ * @param User $user The relevant user
+ * @return ParserOutput|bool ParserOutput or false if the given revision ID is not found
*/
public function getParserOutput( $oldid = null, User $user = null ) {
//XXX: bypasses mParserOptions and thus setParserOptions()
@@ -1861,7 +1932,7 @@ class Article implements Page {
/**
* Sets the context this Article is executed in
*
- * @param $context IContextSource
+ * @param IContextSource $context
* @since 1.18
*/
public function setContext( $context ) {
@@ -1878,7 +1949,8 @@ class Article implements Page {
if ( $this->mContext instanceof IContextSource ) {
return $this->mContext;
} else {
- wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" );
+ wfDebug( __METHOD__ . " called and \$mContext is null. " .
+ "Return RequestContext::getMain(); for sanity\n" );
return RequestContext::getMain();
}
}
@@ -1938,7 +2010,7 @@ class Article implements Page {
* raw WikiPage fields for backwards compatibility.
*
* @param string $fname Field name
- * @param $fvalue mixed New value
+ * @param mixed $fvalue New value
*/
public function __set( $fname, $fvalue ) {
if ( property_exists( $this->mPage, $fname ) ) {
@@ -1971,25 +2043,29 @@ class Article implements Page {
// ****** B/C functions to work-around PHP silliness with __call and references ****** //
/**
- * @param $limit array
- * @param $expiry array
- * @param $cascade bool
- * @param $reason string
- * @param $user User
+ * @param array $limit
+ * @param array $expiry
+ * @param bool $cascade
+ * @param string $reason
+ * @param User $user
* @return Status
*/
- public function doUpdateRestrictions( array $limit, array $expiry, &$cascade, $reason, User $user ) {
+ public function doUpdateRestrictions( array $limit, array $expiry, &$cascade,
+ $reason, User $user
+ ) {
return $this->mPage->doUpdateRestrictions( $limit, $expiry, $cascade, $reason, $user );
}
/**
- * @param $limit array
- * @param $reason string
- * @param $cascade int
- * @param $expiry array
+ * @param array $limit
+ * @param string $reason
+ * @param int $cascade
+ * @param array $expiry
* @return bool
*/
- public function updateRestrictions( $limit = array(), $reason = '', &$cascade = 0, $expiry = array() ) {
+ public function updateRestrictions( $limit = array(), $reason = '',
+ &$cascade = 0, $expiry = array()
+ ) {
return $this->mPage->doUpdateRestrictions(
$limit,
$expiry,
@@ -2000,24 +2076,26 @@ class Article implements Page {
}
/**
- * @param $reason string
- * @param $suppress bool
- * @param $id int
- * @param $commit bool
- * @param $error string
+ * @param string $reason
+ * @param bool $suppress
+ * @param int $id
+ * @param bool $commit
+ * @param string $error
* @return bool
*/
- public function doDeleteArticle( $reason, $suppress = false, $id = 0, $commit = true, &$error = '' ) {
+ public function doDeleteArticle( $reason, $suppress = false, $id = 0,
+ $commit = true, &$error = ''
+ ) {
return $this->mPage->doDeleteArticle( $reason, $suppress, $id, $commit, $error );
}
/**
- * @param $fromP
- * @param $summary
- * @param $token
- * @param $bot
- * @param $resultDetails
- * @param $user User
+ * @param string $fromP
+ * @param string $summary
+ * @param string $token
+ * @param bool $bot
+ * @param array $resultDetails
+ * @param User|null $user
* @return array
*/
public function doRollback( $fromP, $summary, $token, $bot, &$resultDetails, User $user = null ) {
@@ -2026,11 +2104,11 @@ class Article implements Page {
}
/**
- * @param $fromP
- * @param $summary
- * @param $bot
- * @param $resultDetails
- * @param $guser User
+ * @param string $fromP
+ * @param string $summary
+ * @param bool $bot
+ * @param array $resultDetails
+ * @param User|null $guser
* @return array
*/
public function commitRollback( $fromP, $summary, $bot, &$resultDetails, User $guser = null ) {
@@ -2039,7 +2117,7 @@ class Article implements Page {
}
/**
- * @param $hasHistory bool
+ * @param bool $hasHistory
* @return mixed
*/
public function generateReason( &$hasHistory ) {
@@ -2058,30 +2136,30 @@ class Article implements Page {
}
/**
- * @param $title Title
+ * @param Title $title
*/
public static function onArticleCreate( $title ) {
WikiPage::onArticleCreate( $title );
}
/**
- * @param $title Title
+ * @param Title $title
*/
public static function onArticleDelete( $title ) {
WikiPage::onArticleDelete( $title );
}
/**
- * @param $title Title
+ * @param Title $title
*/
public static function onArticleEdit( $title ) {
WikiPage::onArticleEdit( $title );
}
/**
- * @param $oldtext
- * @param $newtext
- * @param $flags
+ * @param string $oldtext
+ * @param string $newtext
+ * @param int $flags
* @return string
* @deprecated since 1.21, use ContentHandler::getAutosummary() instead
*/