From f09e458d397bd1f7fe461c4f4d07a94bfa8939d6 Mon Sep 17 00:00:00 2001 From: Stephan Gambke Date: Sun, 3 Aug 2014 01:48:54 +0200 Subject: [PATCH] Fix for Ia9baaf0b: Make previously public variables public again Change Ia9baaf0b changed the visibility of member variables (many of which are not otherwise exposed, e.g. by a method) and by that introduced a major API change breaking extensions. This patch explicitly marks affected variables as public again, keeping the intent of the original patch of making phpcs-strict pass on includes/ directory. Bug: 67522 Bug: 67984 Change-Id: I498512b2a1e615365bb477c1fd210aaa3241ca03 --- includes/CategoryViewer.php | 24 ++++++++--------- includes/EditPage.php | 53 +++++++++++++++++-------------------- includes/Export.php | 20 +++++++------- includes/Feed.php | 14 +++++----- includes/HistoryBlob.php | 12 ++++----- includes/Import.php | 30 ++++++++++----------- includes/Linker.php | 2 +- includes/page/Article.php | 14 +++++----- 8 files changed, 82 insertions(+), 87 deletions(-) diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 60694c95e3..7581ae40d4 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -25,10 +25,10 @@ class CategoryViewer extends ContextSource { public $limit; /** @var array */ - protected $from; + public $from; /** @var array */ - protected $until; + public $until; /** @var string[] */ public $articles; @@ -37,37 +37,37 @@ class CategoryViewer extends ContextSource { public $articles_start_char; /** @var array */ - protected $children; + public $children; /** @var array */ - protected $children_start_char; + public $children_start_char; /** @var bool */ - protected $showGallery; + public $showGallery; /** @var array */ - protected $imgsNoGallery_start_char; + public $imgsNoGallery_start_char; /** @var array */ - protected $imgsNoGallery; + public $imgsNoGallery; /** @var array */ - protected $nextPage; + public $nextPage; /** @var array */ protected $prevPage; /** @var array */ - protected $flip; + public $flip; /** @var Title */ - protected $title; + public $title; /** @var Collation */ - protected $collation; + public $collation; /** @var ImageGallery */ - protected $gallery; + public $gallery; /** @var Category Category object for this page. */ private $cat; diff --git a/includes/EditPage.php b/includes/EditPage.php index c3b0dadec7..b4f914eba4 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -185,7 +185,7 @@ class EditPage { private $mContextTitle = null; /** @var string */ - protected $action = 'submit'; + public $action = 'submit'; /** @var bool */ public $isConflict = false; @@ -200,13 +200,13 @@ class EditPage { public $isJsSubpage = false; /** @var bool */ - protected $isWrongCaseCssJsPage = false; + public $isWrongCaseCssJsPage = false; /** @var bool New page or new section */ - protected $isNew = false; + public $isNew = false; /** @var bool */ - protected $deletedSinceEdit; + public $deletedSinceEdit; /** @var string */ public $formtype; @@ -215,39 +215,34 @@ class EditPage { public $firsttime; /** @var bool|stdClass */ - protected $lastDelete; + public $lastDelete; - /** @var bool - * This is public because SemanticForms uses it (bug 67522). - * However, please consider using this property publicly - * to be deprecated. - * @protected - */ + /** @var bool */ public $mTokenOk = false; /** @var bool */ - protected $mTokenOkExceptSuffix = false; + public $mTokenOkExceptSuffix = false; /** @var bool */ - protected $mTriedSave = false; + public $mTriedSave = false; /** @var bool */ - protected $incompleteForm = false; + public $incompleteForm = false; /** @var bool */ - protected $tooBig = false; + public $tooBig = false; /** @var bool */ - protected $kblength = false; + public $kblength = false; /** @var bool */ - protected $missingComment = false; + public $missingComment = false; /** @var bool */ - protected $missingSummary = false; + public $missingSummary = false; /** @var bool */ - protected $allowBlankSummary = false; + public $allowBlankSummary = false; /** @var bool */ protected $blankArticle = false; @@ -256,19 +251,19 @@ class EditPage { protected $allowBlankArticle = false; /** @var string */ - protected $autoSumm = ''; + public $autoSumm = ''; /** @var string */ public $hookError = ''; /** @var ParserOutput */ - protected $mParserOutput; + public $mParserOutput; /** @var bool Has a summary been preset using GET parameter &summary= ? */ - protected $hasPresetSummary = false; + public $hasPresetSummary = false; /** @var bool */ - protected $mBaseRevision = false; + public $mBaseRevision = false; /** @var bool */ public $mShowSummaryField = true; @@ -282,16 +277,16 @@ class EditPage { public $preview = false; /** @var bool */ - protected $diff = false; + public $diff = false; /** @var bool */ public $minoredit = false; /** @var bool */ - protected $watchthis = false; + public $watchthis = false; /** @var bool */ - protected $recreate = false; + public $recreate = false; /** @var string */ public $textbox1 = ''; @@ -303,7 +298,7 @@ class EditPage { public $summary = ''; /** @var bool */ - protected $nosummary = false; + public $nosummary = false; /** @var string */ public $edittime = ''; @@ -315,13 +310,13 @@ class EditPage { public $sectiontitle = ''; /** @var string */ - protected $starttime = ''; + public $starttime = ''; /** @var int */ public $oldid = 0; /** @var string */ - protected $editintro = ''; + public $editintro = ''; /** @var null */ public $scrolltop = null; diff --git a/includes/Export.php b/includes/Export.php index 43dfd17195..48a814d322 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -41,7 +41,7 @@ class WikiExporter { public $dumpUploadFileContents = false; /** @var string */ - protected $author_list = ""; + public $author_list = ""; const FULL = 1; const CURRENT = 2; @@ -56,13 +56,13 @@ class WikiExporter { const STUB = 1; /** @var int */ - protected $buffer; + public $buffer; /** @var int */ - protected $text; + public $text; /** @var DumpOutput */ - protected $sink; + public $sink; /** * Returns the export schema version. @@ -1370,10 +1370,10 @@ class DumpNotalkFilter extends DumpFilter { */ class DumpNamespaceFilter extends DumpFilter { /** @var bool */ - protected $invert = false; + public $invert = false; /** @var array */ - protected $namespaces = array(); + public $namespaces = array(); /** * @param DumpOutput $sink @@ -1437,13 +1437,13 @@ class DumpNamespaceFilter extends DumpFilter { * @ingroup Dump */ class DumpLatestFilter extends DumpFilter { - protected $page; + public $page; - protected $pageString; + public $pageString; - protected $rev; + public $rev; - protected $revString; + public $revString; /** * @param object $page diff --git a/includes/Feed.php b/includes/Feed.php index 03dd7f5c88..2fdfa424c4 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -37,19 +37,19 @@ */ class FeedItem { /** @var Title */ - protected $title; + public $title; - protected $description; + public $description; - protected $url; + public $url; - protected $date; + public $date; - protected $author; + public $author; - protected $uniqueId; + public $uniqueId; - protected $comments; + public $comments; public $rssIsPermalink = false; diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index d2be9e93b0..69f1120d43 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -351,10 +351,10 @@ class HistoryBlobCurStub { */ class DiffHistoryBlob implements HistoryBlob { /** @var array Uncompressed item cache */ - protected $mItems = array(); + public $mItems = array(); /** @var int Total uncompressed size */ - protected $mSize = 0; + public $mSize = 0; /** * @var array Array of diffs. If a diff D from A to B is notated D = B - A, @@ -364,20 +364,20 @@ class DiffHistoryBlob implements HistoryBlob { * diff[i] = { * { item[map[i]] - Z where i = 0 */ - protected $mDiffs; + public $mDiffs; /** @var array The diff map, see above */ - protected $mDiffMap; + public $mDiffMap; /** @var int The key for getText() */ - protected $mDefaultKey; + public $mDefaultKey; /** @var string Compressed storage */ public $mCompressed; /** @var bool True if the object is locked against further writes */ - protected $mFrozen = false; + public $mFrozen = false; /** * @var int The maximum uncompressed size before the object becomes sad diff --git a/includes/Import.php b/includes/Import.php index b3ca041635..5319076e82 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -891,7 +891,7 @@ class WikiImporter { /** This is a horrible hack used to keep source compatibility */ class UploadSourceAdapter { /** @var array */ - private static $sourceRegistrations = array(); + public static $sourceRegistrations = array(); /** @var string */ private $mSource; @@ -1015,13 +1015,13 @@ class UploadSourceAdapter { */ class WikiRevision { /** @todo Unused? */ - private $importer = null; + public $importer = null; /** @var Title */ public $title = null; /** @var int */ - private $id = 0; + public $id = 0; /** @var string */ public $timestamp = "20010115000000"; @@ -1035,10 +1035,10 @@ class WikiRevision { public $user_text = ""; /** @var string */ - protected $model = null; + public $model = null; /** @var string */ - protected $format = null; + public $format = null; /** @var string */ public $text = ""; @@ -1047,7 +1047,7 @@ class WikiRevision { protected $size; /** @var Content */ - protected $content = null; + public $content = null; /** @var ContentHandler */ protected $contentHandler = null; @@ -1056,31 +1056,31 @@ class WikiRevision { public $comment = ""; /** @var bool */ - protected $minor = false; + public $minor = false; /** @var string */ - protected $type = ""; + public $type = ""; /** @var string */ - protected $action = ""; + public $action = ""; /** @var string */ - protected $params = ""; + public $params = ""; /** @var string */ - protected $fileSrc = ''; + public $fileSrc = ''; /** @var bool|string */ - protected $sha1base36 = false; + public $sha1base36 = false; /** * @var bool * @todo Unused? */ - private $isTemp = false; + public $isTemp = false; /** @var string */ - protected $archiveName = ''; + public $archiveName = ''; protected $filename; @@ -1088,7 +1088,7 @@ class WikiRevision { protected $src; /** @todo Unused? */ - private $fileIsTemp; + public $fileIsTemp; /** @var bool */ private $mNoUpdates = false; diff --git a/includes/Linker.php b/includes/Linker.php index f0b16ab981..d9f4255e68 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -2151,7 +2151,7 @@ class Linker { return $tooltip; } - private static $accesskeycache; + public static $accesskeycache; /** * Given the id of an interface element, constructs the appropriate diff --git a/includes/page/Article.php b/includes/page/Article.php index 8970539934..748c14e4cd 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -53,25 +53,25 @@ class Article implements Page { * @var Content Content of the revision we are working on * @since 1.21 */ - protected $mContentObject; + public $mContentObject; /** @var bool Is the content ($mContent) already loaded? */ - protected $mContentLoaded = false; + public $mContentLoaded = false; /** @var int|null The oldid of the article that is to be shown, 0 for the current revision */ - protected $mOldId; + public $mOldId; /** @var Title Title from which we were redirected here */ - protected $mRedirectedFrom = null; + public $mRedirectedFrom = null; /** @var string|bool URL to redirect to or false if none */ - protected $mRedirectUrl = false; + public $mRedirectUrl = false; /** @var int Revision ID of revision we are working on */ - protected $mRevIdFetched = 0; + public $mRevIdFetched = 0; /** @var Revision Revision we are working on */ - protected $mRevision = null; + public $mRevision = null; /** @var ParserOutput */ public $mParserOutput; -- 2.20.1