build: Use inline ignore for MediaWiki.Usage.DeprecatedGlobalVariables
This avoids addition of new code with the deprecated global, or at least it gives extra attention on review when new code also uses the inline ignore Change-Id: I5c1bc5a1685c28f153d4fbe3525959930f54b557
This commit is contained in:
parent
4876039872
commit
c7cd5399e7
12 changed files with 12 additions and 3 deletions
|
|
@ -6,7 +6,6 @@
|
|||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
|
||||
<exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
|
||||
<exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />
|
||||
<exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle" />
|
||||
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
|
||||
</rule>
|
||||
<rule ref="MediaWiki.NamingConventions.ValidGlobalName">
|
||||
|
|
|
|||
|
|
@ -421,6 +421,7 @@ class CommentParser {
|
|||
// We should deprecate `null` as a valid value for
|
||||
// $selfLinkTarget to ensure that we can use it as
|
||||
// the title context for the external link.
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgTitle;
|
||||
$linkMarker = $this->addPageLink(
|
||||
$target,
|
||||
|
|
|
|||
|
|
@ -149,6 +149,7 @@ class WikiMap {
|
|||
* @return string|false HTML link or false if the wiki was not found
|
||||
*/
|
||||
public static function makeForeignLink( $wikiID, $page, $text = null ) {
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgTitle;
|
||||
if ( !$text ) {
|
||||
$text = $page;
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ class ActionEntryPoint extends MediaWikiEntryPoint {
|
|||
* Determine and send the response headers and body for this web request
|
||||
*/
|
||||
protected function execute() {
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgTitle;
|
||||
|
||||
// Get title from request parameters,
|
||||
|
|
@ -361,6 +362,7 @@ class ActionEntryPoint extends MediaWikiEntryPoint {
|
|||
* @return void
|
||||
*/
|
||||
protected function performRequest() {
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgTitle;
|
||||
|
||||
$context = $this->getContext();
|
||||
|
|
|
|||
|
|
@ -488,7 +488,7 @@ class ApiEditPage extends ApiBase {
|
|||
// This is kind of a hack but it's the best we can do to make extensions work
|
||||
$requestArray += $this->getRequest()->getValues();
|
||||
|
||||
// phpcs:ignore MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage
|
||||
// phpcs:ignore MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage,MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgTitle, $wgRequest;
|
||||
|
||||
$req = new DerivativeRequest( $this->getRequest(), $requestArray, true );
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ class ApiEntryPoint extends MediaWikiEntryPoint {
|
|||
* the URL.
|
||||
*/
|
||||
protected function execute() {
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgTitle;
|
||||
|
||||
$context = $this->getContext();
|
||||
|
|
|
|||
|
|
@ -253,6 +253,7 @@ class ApiParse extends ApiBase {
|
|||
// The parser needs $wgTitle to be set, apparently the
|
||||
// $title parameter in Parser::parse isn't enough *sigh*
|
||||
// TODO: Does this still need $wgTitle?
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgTitle;
|
||||
|
||||
$format = null;
|
||||
|
|
|
|||
|
|
@ -210,6 +210,7 @@ class RequestContext implements IContextSource, MutableContext {
|
|||
*/
|
||||
public function getTitle() {
|
||||
if ( $this->title === null ) {
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgTitle; # fallback to $wg till we can improve this
|
||||
$this->title = $wgTitle;
|
||||
$logger = LoggerFactory::getInstance( 'GlobalTitleFail' );
|
||||
|
|
|
|||
|
|
@ -1496,6 +1496,7 @@ class MessageCache implements LoggerAwareInterface {
|
|||
public function parse( $text, PageReference $page = null, $linestart = true,
|
||||
$interface = false, $language = null
|
||||
) {
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgTitle;
|
||||
|
||||
if ( $this->inParser ) {
|
||||
|
|
|
|||
|
|
@ -1144,6 +1144,7 @@ class Linker {
|
|||
public static function makeExternalLink( $url, $text, $escape = true,
|
||||
$linktype = '', $attribs = [], $title = null
|
||||
) {
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgTitle;
|
||||
$linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
|
||||
return $linkRenderer->makeExternalLink(
|
||||
|
|
|
|||
|
|
@ -1746,7 +1746,7 @@ class SpecialPageFactory {
|
|||
public function capturePath(
|
||||
PageReference $page, IContextSource $context, LinkRenderer $linkRenderer = null
|
||||
) {
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgUser
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgUser,MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgTitle, $wgOut, $wgRequest, $wgUser, $wgLang;
|
||||
$main = RequestContext::getMain();
|
||||
|
||||
|
|
|
|||
|
|
@ -510,6 +510,7 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
|
|||
* reset services here.
|
||||
*/
|
||||
public static function resetNonServiceCaches() {
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
|
||||
global $wgRequest, $wgJobClasses, $wgTitle;
|
||||
|
||||
/* Prevent global wgTitle state from carrying over between test cases
|
||||
|
|
|
|||
Loading…
Reference in a new issue