From: Max Semenik Date: Sat, 9 Sep 2017 02:12:37 +0000 (-0700) Subject: Simplify OutputPage constructor X-Git-Tag: 1.31.0-rc.0~1778^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=c4145b2f087c0d8f46191456aa0e4cf83e7b1ba1 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 --- diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index efadf9abb1..498c473bb1 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -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 diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 20b2c3c32d..7a2b7dfe1a 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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 ); } /**