Fix method/function names case mismatch in core files
authorDerick Alangi <alangiderick@gmail.com>
Sat, 31 Aug 2019 20:59:45 +0000 (21:59 +0100)
committerKrinkle <krinklemail@gmail.com>
Sat, 31 Aug 2019 23:17:51 +0000 (23:17 +0000)
PHP doesn't care much but I think we humans do because we should
call methods by the name we give them. Method fixed are;

- isOk() -> isOK()
- setOk() -> setOK()
- teardown() -> tearDown()

Change-Id: I6b3f0cf3902887058efa426968da380803869e0b

12 files changed:
includes/MovePage.php
includes/Title.php
includes/api/ApiMove.php
includes/installer/CliInstaller.php
includes/installer/Installer.php
includes/jobqueue/Job.php
includes/jobqueue/JobRunner.php
includes/libs/http/MultiHttpClient.php
includes/specials/SpecialMovepage.php
tests/phpunit/includes/api/ApiBaseTest.php
tests/phpunit/includes/auth/UserDataAuthenticationRequestTest.php
tests/phpunit/includes/specials/pagers/BlockListPagerTest.php

index e6faace..5f2aceb 100644 (file)
@@ -446,7 +446,7 @@ class MovePage {
                                $status = Status::newFatal( 'movepage-max-pages', $wgMaximumMovedPages );
                                $perTitleStatus[$oldSubpage->getPrefixedText()] = $status;
                                $topStatus->merge( $status );
-                               $topStatus->setOk( true );
+                               $topStatus->setOK( true );
                                break;
                        }
 
@@ -479,7 +479,7 @@ class MovePage {
                        }
                        $perTitleStatus[$oldSubpage->getPrefixedText()] = $status;
                        $topStatus->merge( $status );
-                       $topStatus->setOk( true );
+                       $topStatus->setOK( true );
                }
 
                $topStatus->value = $perTitleStatus;
index 3bf87c2..1acc7af 100644 (file)
@@ -3532,7 +3532,7 @@ class Title implements LinkTarget, IDBAccessObject {
                $method = $auth ? 'moveSubpagesIfAllowed' : 'moveSubpages';
                $result = $mp->$method( $wgUser, $reason, $createRedirect, $changeTags );
 
-               if ( !$result->isOk() ) {
+               if ( !$result->isOK() ) {
                        return $result->getErrorsArray();
                }
 
index d8f48b8..4cbed21 100644 (file)
@@ -207,7 +207,7 @@ class ApiMove extends ApiBase {
                $mp = new MovePage( $fromTitle, $toTitle );
                $result =
                        $mp->moveSubpagesIfAllowed( $this->getUser(), $reason, !$noredirect, $changeTags );
-               if ( !$result->isOk() ) {
+               if ( !$result->isOK() ) {
                        // This means the whole thing failed
                        return [ 'errors' => $this->getErrorFormatter()->arrayFromStatus( $result ) ];
                }
index 99d594d..424c9d7 100644 (file)
@@ -190,7 +190,7 @@ class CliInstaller extends Installer {
                // PerformInstallation bails on a fatal, so make sure the last item
                // completed before giving 'next.' Likewise, only provide back on failure
                $lastStepStatus = end( $result );
-               if ( $lastStepStatus->isOk() ) {
+               if ( $lastStepStatus->isOK() ) {
                        return Status::newGood();
                } else {
                        return $lastStepStatus;
index de15456..a3951a1 100644 (file)
@@ -1607,11 +1607,11 @@ abstract class Installer {
 
                        // If we've hit some sort of fatal, we need to bail.
                        // Callback already had a chance to do output above.
-                       if ( !$status->isOk() ) {
+                       if ( !$status->isOK() ) {
                                break;
                        }
                }
-               if ( $status->isOk() ) {
+               if ( $status->isOK() ) {
                        $this->showMessage(
                                'config-install-db-success'
                        );
index c87dedc..29086e6 100644 (file)
@@ -135,7 +135,7 @@ abstract class Job implements RunnableJob {
                        // When constructing this class for submitting to the queue,
                        // normalise the $title arg of old job classes as part of $params.
                        $params['namespace'] = $title->getNamespace();
-                       $params['title'] = $title->getDBKey();
+                       $params['title'] = $title->getDBkey();
                }
 
                $this->command = $command;
index adb4221..709a67b 100644 (file)
@@ -309,7 +309,7 @@ class JobRunner implements LoggerAwareInterface {
                }
                // Always attempt to call teardown() even if Job throws exception.
                try {
-                       $job->teardown( $status );
+                       $job->tearDown( $status );
                } catch ( Exception $e ) {
                        MWExceptionHandler::logException( $e );
                }
index ed81a79..5e233ae 100644 (file)
@@ -499,7 +499,7 @@ class MultiHttpClient implements LoggerAwareInterface {
                                'error' => '',
                        ];
 
-                       if ( !$sv->isOk() ) {
+                       if ( !$sv->isOK() ) {
                                $svErrors = $sv->getErrors();
                                if ( isset( $svErrors[0] ) ) {
                                        $req['response']['error'] = $svErrors[0]['message'];
index 85f65bb..0cb3bba 100644 (file)
@@ -749,7 +749,7 @@ class MovePageForm extends UnlistedSpecialPage {
 
                        $mp = new MovePage( $oldSubpage, $newSubpage );
                        # This was copy-pasted from Renameuser, bleh.
-                       if ( $newSubpage->exists() && !$mp->isValidMove()->isOk() ) {
+                       if ( $newSubpage->exists() && !$mp->isValidMove()->isOK() ) {
                                $link = $linkRenderer->makeKnownLink( $newSubpage );
                                $extraOutput[] = $this->msg( 'movepage-page-exists' )->rawParams( $link )->escaped();
                        } else {
index 6a44ff3..3adf1b6 100644 (file)
@@ -1443,7 +1443,7 @@ class ApiBaseTest extends ApiTestCase {
                }
 
                $status = StatusValue::newGood();
-               $status->setOk( false );
+               $status->setOK( false );
                try {
                        $mock->dieStatus( $status );
                        $this->fail( 'Expected exception not thrown' );
index fc1930a..8c9a88f 100644 (file)
@@ -32,7 +32,7 @@ class UserDataAuthenticationRequestTest extends AuthenticationRequestTestCase {
                $req->email = $email;
                $req->realname = $realname;
                $this->assertEquals( $expect, $req->populateUser( $user ) );
-               if ( $expect->isOk() ) {
+               if ( $expect->isOK() ) {
                        $this->assertSame( $email ?: 'default@example.com', $user->getEmail() );
                        $this->assertSame( $realname ?: 'Fake Name', $user->getRealName() );
                }
index c0eadac..37c29ab 100644 (file)
@@ -248,7 +248,7 @@ class BlockListPagerTest extends MediaWikiTestCase {
                $restriction = $restrictions[0];
                $this->assertEquals( $page->getId(), $restriction->getValue() );
                $this->assertEquals( $page->getId(), $restriction->getTitle()->getArticleID() );
-               $this->assertEquals( $title->getDBKey(), $restriction->getTitle()->getDBKey() );
+               $this->assertEquals( $title->getDBkey(), $restriction->getTitle()->getDBkey() );
                $this->assertEquals( $title->getNamespace(), $restriction->getTitle()->getNamespace() );
 
                // Delete the block and the restrictions.