Simplify OutputPage constructor
authorMax Semenik <maxsem.wiki@gmail.com>
Sat, 9 Sep 2017 02:12:37 +0000 (19:12 -0700)
committerKrinkle <krinklemail@gmail.com>
Fri, 13 Oct 2017 19:48:46 +0000 (19:48 +0000)
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

RELEASE-NOTES-1.31
includes/OutputPage.php

index efadf9a..498c473 100644 (file)
@@ -45,7 +45,9 @@ changes to languages because of Phabricator reports.
 * 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
index 20b2c3c..7a2b7df 100644 (file)
@@ -314,15 +314,10 @@ class OutputPage extends ContextSource {
         * 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 );
        }
 
        /**