[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Simplify OutputPage constructor

2017-09-08 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/376868 )

Change subject: Simplify OutputPage constructor
..

Simplify OutputPage constructor

Make it impossible to instantiate this class without passing it
context. This appears to be the oldest wfDeprecated() in MediaWiki.
All callers have been updated.

Change-Id: I00b9e283ad22c6274b358063b9f9e60fe93d5ee7
---
M RELEASE-NOTES-1.30
M includes/OutputPage.php
2 files changed, 4 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/376868/1

diff --git a/RELEASE-NOTES-1.30 b/RELEASE-NOTES-1.30
index a221f53..8e95953 100644
--- a/RELEASE-NOTES-1.30
+++ b/RELEASE-NOTES-1.30
@@ -215,6 +215,7 @@
 * DB_SLAVE is deprecated. DB_REPLICA should be used instead.
 * wfUsePHP() is deprecated.
 * wfFixSessionID() was removed.
+* OutputPage now can't be instantiated without passing it context.
 
 == Compatibility ==
 MediaWiki 1.30 requires PHP 5.5.9 or later. There is experimental support for
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index dd21194..b8fb14d 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -311,15 +311,10 @@
 * Constructor for OutputPage. This should not be called directly.
 * Instead a new RequestContext should be created and it will 
implicitly create
 * a OutputPage tied to that context.
-* @param IContextSource|null $context
+* @param IContextSource $context
 */
-   function __construct( IContextSource $context = null ) {
-   if ( $context === null ) {
-   # Extensions should use `new RequestContext` instead of 
`new OutputPage` now.
-   wfDeprecated( __METHOD__, '1.18' );
-   } else {
-   $this->setContext( $context );
-   }
+   function __construct( IContextSource $context ) {
+   $this->setContext( $context );
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/376868
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I00b9e283ad22c6274b358063b9f9e60fe93d5ee7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Simplify OutputPage constructor

2017-10-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/376868 )

Change subject: Simplify OutputPage constructor
..


Simplify OutputPage constructor

Make it impossible to instantiate this class without passing it
context. This appears to be the oldest wfDeprecated() in MediaWiki.
All callers have been updated.

Change-Id: I00b9e283ad22c6274b358063b9f9e60fe93d5ee7
---
M RELEASE-NOTES-1.31
M includes/OutputPage.php
2 files changed, 6 insertions(+), 9 deletions(-)

Approvals:
  Krinkle: Looks good to me, but someone else must approve
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31
index efadf9a..498c473 100644
--- a/RELEASE-NOTES-1.31
+++ b/RELEASE-NOTES-1.31
@@ -45,7 +45,9 @@
 * The global function wfBCP47 was renamed to LanguageCode::bcp47.
 * The global function wfBCP47 is now deprecated.
 * The global function wfCountDown() is now deprecated in favor of
-  Maintenance::countDown().
+  Maintenance::countDown()
+* The OutputPage class constructor now requires a context parameter,
+  (instantiating without context was deprecated in 1.18)
 
 == Compatibility ==
 MediaWiki 1.31 requires PHP 5.5.9 or later. There is experimental support for
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 20b2c3c..7a2b7df 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -314,15 +314,10 @@
 * Constructor for OutputPage. This should not be called directly.
 * Instead a new RequestContext should be created and it will 
implicitly create
 * a OutputPage tied to that context.
-* @param IContextSource|null $context
+* @param IContextSource $context
 */
-   function __construct( IContextSource $context = null ) {
-   if ( $context === null ) {
-   # Extensions should use `new RequestContext` instead of 
`new OutputPage` now.
-   wfDeprecated( __METHOD__, '1.18' );
-   } else {
-   $this->setContext( $context );
-   }
+   function __construct( IContextSource $context ) {
+   $this->setContext( $context );
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/376868
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I00b9e283ad22c6274b358063b9f9e60fe93d5ee7
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits