diff --git a/includes/Article.php b/includes/Article.php index 3bb1563f7a9..09d843d213b 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -34,85 +34,47 @@ * @internal documentation reviewed 15 Mar 2010 */ class Article implements Page { - /**@{{ - * @private - */ - - /** - * The context this Article is executed in - * @var IContextSource $mContext - */ + /** @var IContextSource The context this Article is executed in */ protected $mContext; - /** - * The WikiPage object of this instance - * @var WikiPage $mPage - */ + /** @var WikiPage The WikiPage object of this instance */ protected $mPage; - /** - * ParserOptions object for $wgUser articles - * @var ParserOptions $mParserOptions - */ + /** @var ParserOptions ParserOptions object for $wgUser articles */ public $mParserOptions; /** - * Text of the revision we are working on - * @var string $mContent + * @var string Text of the revision we are working on + * @todo BC cruft */ - var $mContent; // !< #BC cruft + public $mContent; /** - * Content of the revision we are working on - * @var Content + * @var Content Content of the revision we are working on * @since 1.21 */ - var $mContentObject; // !< + protected $mContentObject; - /** - * Is the content ($mContent) already loaded? - * @var bool $mContentLoaded - */ - var $mContentLoaded = false; // !< + /** @var bool Is the content ($mContent) already loaded? */ + protected $mContentLoaded = false; - /** - * The oldid of the article that is to be shown, 0 for the - * current revision - * @var int|null $mOldId - */ - var $mOldId; // !< + /** @var int|null The oldid of the article that is to be shown, 0 for the current revision */ + protected $mOldId; - /** - * Title from which we were redirected here - * @var Title $mRedirectedFrom - */ - var $mRedirectedFrom = null; + /** @var Title Title from which we were redirected here */ + protected $mRedirectedFrom = null; - /** - * URL to redirect to or false if none - * @var string|bool $mRedirectUrl - */ - var $mRedirectUrl = false; // !< + /** @var string|bool URL to redirect to or false if none */ + protected $mRedirectUrl = false; - /** - * Revision ID of revision we are working on - * @var int $mRevIdFetched - */ - var $mRevIdFetched = 0; // !< + /** @var int Revision ID of revision we are working on */ + protected $mRevIdFetched = 0; - /** - * Revision we are working on - * @var Revision $mRevision - */ - var $mRevision = null; + /** @var Revision Revision we are working on */ + protected $mRevision = null; - /** - * ParserOutput object - * @var ParserOutput $mParserOutput - */ - var $mParserOutput; - - /**@}}*/ + /** @var ParserOutput */ + public $mParserOutput; /** * Constructor and clear the article diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 305a8e5113b..49818e6a12e 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -21,53 +21,58 @@ */ class CategoryViewer extends ContextSource { - var $limit, $from, $until, - $articles, $articles_start_char, - $children, $children_start_char, - $showGallery, $imgsNoGalley, - $imgsNoGallery_start_char, - $imgsNoGallery; + /** @var int */ + public $limit; - /** - * @var array - */ - var $nextPage; + /** @var array */ + protected $from; - /** - * @var array - */ - var $flip; + /** @var array */ + protected $until; - /** - * @var Title - */ - var $title; + /** @var string[] */ + public $articles; - /** - * @var Collation - */ - var $collation; + /** @var array */ + public $articles_start_char; - /** - * @var ImageGallery - */ - var $gallery; + /** @var array */ + protected $children; - /** - * Category object for this page - * @var Category - */ + /** @var array */ + protected $children_start_char; + + /** @var bool */ + protected $showGallery; + + /** @var array */ + protected $imgsNoGallery_start_char; + + /** @var array */ + protected $imgsNoGallery; + + /** @var array */ + protected $nextPage; + + /** @var array */ + protected $flip; + + /** @var Title */ + protected $title; + + /** @var Collation */ + protected $collation; + + /** @var ImageGallery */ + protected $gallery; + + /** @var Category Category object for this page. */ private $cat; - /** - * The original query array, to be used in generating paging links. - * @var array - */ + /** @var array The original query array, to be used in generating paging links. */ private $query; /** - * Constructor - * * @since 1.19 $context is a second, required parameter * @param Title $title * @param IContextSource $context diff --git a/includes/DeprecatedGlobal.php b/includes/DeprecatedGlobal.php index 8a637862eed..d1fda2ebf00 100644 --- a/includes/DeprecatedGlobal.php +++ b/includes/DeprecatedGlobal.php @@ -35,7 +35,11 @@ class DeprecatedGlobal extends StubObject { $this->mVersion = $version; } + // @codingStandardsIgnoreStart + // PSR2.Methods.MethodDeclaration.Underscore + // PSR2.Classes.PropertyDeclaration.ScopeMissing function _newObject() { + /* Put the caller offset for wfDeprecated as 6, as * that gives the function that uses this object, since: * 1 = this function ( _newObject ) @@ -51,4 +55,5 @@ class DeprecatedGlobal extends StubObject { wfDeprecated( '$' . $this->mGlobal, $this->mVersion, false, 6 ); return $this->mRealValue; } + // @codingStandardsIgnoreEnd } diff --git a/includes/EditPage.php b/includes/EditPage.php index dac2d55a75d..5789a2af1f9 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -175,8 +175,9 @@ class EditPage { * The cookie will be removed instantly if the JavaScript runs. * * Otherwise, though, we don't want the cookies to accumulate. - * RFC 2109 ( https://www.ietf.org/rfc/rfc2109.txt ) specifies a possible limit of only 20 cookies per domain. - * This still applies at least to some versions of IE without full updates: + * RFC 2109 ( https://www.ietf.org/rfc/rfc2109.txt ) specifies a possible + * limit of only 20 cookies per domain. This still applies at least to some + * versions of IE without full updates: * https://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx * * A value of 20 minutes should be enough to take into account slow loads and minor @@ -184,65 +185,160 @@ class EditPage { */ const POST_EDIT_COOKIE_DURATION = 1200; - /** - * @var Article - */ - var $mArticle; + /** @var Article */ + public $mArticle; - /** - * @var Title - */ - var $mTitle; + /** @var Title */ + public $mTitle; + + /** @var null|Title */ private $mContextTitle = null; - var $action = 'submit'; - var $isConflict = false; - var $isCssJsSubpage = false; - var $isCssSubpage = false; - var $isJsSubpage = false; - var $isWrongCaseCssJsPage = false; - var $isNew = false; // new page or new section - var $deletedSinceEdit; - var $formtype; - var $firsttime; - var $lastDelete; - var $mTokenOk = false; - var $mTokenOkExceptSuffix = false; - var $mTriedSave = false; - var $incompleteForm = false; - var $tooBig = false; - var $kblength = false; - var $missingComment = false; - var $missingSummary = false; - var $allowBlankSummary = false; - var $autoSumm = ''; - var $hookError = ''; - #var $mPreviewTemplates; - /** - * @var ParserOutput - */ - var $mParserOutput; + /** @var string */ + protected $action = 'submit'; - /** - * Has a summary been preset using GET parameter &summary= ? - * @var bool - */ - var $hasPresetSummary = false; + /** @var bool */ + public $isConflict = false; - var $mBaseRevision = false; - var $mShowSummaryField = true; + /** @var bool */ + public $isCssJsSubpage = false; + + /** @var bool */ + public $isCssSubpage = false; + + /** @var bool */ + public $isJsSubpage = false; + + /** @var bool */ + protected $isWrongCaseCssJsPage = false; + + /** @var bool New page or new section */ + protected $isNew = false; + + /** @var bool */ + protected $deletedSinceEdit; + + /** @var string */ + public $formtype; + + /** @var bool */ + public $firsttime; + + /** @var bool|stdClass */ + protected $lastDelete; + + /** @var bool */ + protected $mTokenOk = false; + + /** @var bool */ + protected $mTokenOkExceptSuffix = false; + + /** @var bool */ + protected $mTriedSave = false; + + /** @var bool */ + protected $incompleteForm = false; + + /** @var bool */ + protected $tooBig = false; + + /** @var bool */ + protected $kblength = false; + + /** @var bool */ + protected $missingComment = false; + + /** @var bool */ + protected $missingSummary = false; + + /** @var bool */ + protected $allowBlankSummary = false; + + /** @var string */ + protected $autoSumm = ''; + + /** @var string */ + public $hookError = ''; + + /** @var ParserOutput */ + protected $mParserOutput; + + /** @var bool Has a summary been preset using GET parameter &summary= ? */ + protected $hasPresetSummary = false; + + /** @var bool */ + protected $mBaseRevision = false; + + /** @var bool */ + public $mShowSummaryField = true; # Form values - var $save = false, $preview = false, $diff = false; - var $minoredit = false, $watchthis = false, $recreate = false; - var $textbox1 = '', $textbox2 = '', $summary = '', $nosummary = false; - var $edittime = '', $section = '', $sectiontitle = '', $starttime = ''; - var $oldid = 0, $editintro = '', $scrolltop = null, $bot = true; - var $contentModel = null, $contentFormat = null; + + /** @var bool */ + public $save = false; + + /** @var bool */ + public $preview = false; + + /** @var bool */ + protected $diff = false; + + /** @var bool */ + public $minoredit = false; + + /** @var bool */ + protected $watchthis = false; + + /** @var bool */ + protected $recreate = false; + + /** @var string */ + public $textbox1 = ''; + + /** @var string */ + public $textbox2 = ''; + + /** @var string */ + public $summary = ''; + + /** @var bool */ + protected $nosummary = false; + + /** @var string */ + public $edittime = ''; + + /** @var string */ + public $section = ''; + + /** @var string */ + public $sectiontitle = ''; + + /** @var string */ + protected $starttime = ''; + + /** @var int */ + public $oldid = 0; + + /** @var string */ + protected $editintro = ''; + + /** @var null */ + public $scrolltop = null; + + /** @var bool */ + public $bot = true; + + /** @var null|string */ + public $contentModel = null; + + /** @var null|string */ + public $contentFormat = null; # Placeholders for text injection by hooks (must be HTML) # extensions should take care to _append_ to the present value - public $editFormPageTop = ''; // Before even the preview + + /** @var string Before even the preview */ + public $editFormPageTop = ''; public $editFormTextTop = ''; public $editFormTextBeforeContent = ''; public $editFormTextAfterWarn = ''; @@ -258,13 +354,15 @@ class EditPage { public $suppressIntro = false; - /** - * Set to true to allow editing of non-text content types. - * - * @var bool - */ + /** @var bool Set to true to allow editing of non-text content types. */ public $allowNonTextContent = false; + /** @var bool */ + protected $edit; + + /** @var bool */ + public $live; + /** * @param Article $article */ @@ -411,6 +509,7 @@ class EditPage { $this->isCssJsSubpage = $this->mTitle->isCssJsSubpage(); $this->isCssSubpage = $this->mTitle->isCssSubpage(); $this->isJsSubpage = $this->mTitle->isJsSubpage(); + // @todo FIXME: Silly assignment. $this->isWrongCaseCssJsPage = $this->isWrongCaseCssJsPage(); # Show applicable editing introductions @@ -514,7 +613,10 @@ class EditPage { wfRunHooks( 'EditPage::showReadOnlyForm:initial', array( $this, &$wgOut ) ); $wgOut->setRobotPolicy( 'noindex,nofollow' ); - $wgOut->setPageTitle( wfMessage( 'viewsource-title', $this->getContextTitle()->getPrefixedText() ) ); + $wgOut->setPageTitle( wfMessage( + 'viewsource-title', + $this->getContextTitle()->getPrefixedText() + ) ); $wgOut->addBacklinkSubtitle( $this->getContextTitle() ); $wgOut->addWikiText( $wgOut->formatPermissionsErrorMessage( $permErrors, 'edit' ) ); $wgOut->addHTML( "