Echo: Fix case mismatch for function/method calls

PHP doesn't care much about the name (in terms of case sensitivity)
but I think we should make sure the names of the method should be as
they're in their definition.

Change-Id: I6e38d8be64efaec4200471f2d3007275d7ddecec
This commit is contained in:
Derick Alangi 2019-06-11 22:43:05 +01:00
parent a334ab5d34
commit f402ecd31f
12 changed files with 21 additions and 21 deletions

View file

@ -730,7 +730,7 @@ class EchoHooks {
[
'type' => 'user-rights',
'extra' => [
'user' => $user->getID(),
'user' => $user->getId(),
'expiry-changed' => $expiryChanged,
'reason' => $reason,
],
@ -744,7 +744,7 @@ class EchoHooks {
[
'type' => 'user-rights',
'extra' => [
'user' => $user->getID(),
'user' => $user->getId(),
'add' => $reallyAdded,
'remove' => $remove,
'reason' => $reason,
@ -804,7 +804,7 @@ class EchoHooks {
continue;
}
$linkFromPageId = $linksUpdate->mTitle->getArticleId();
$linkFromPageId = $linksUpdate->mTitle->getArticleID();
EchoEvent::create( [
'type' => 'page-linked',
'title' => $title,
@ -1016,7 +1016,7 @@ class EchoHooks {
$alertLink = [
'href' => $url,
'text' => $alertText,
'active' => ( $url == $title->getLocalUrl() ),
'active' => ( $url == $title->getLocalURL() ),
'class' => $alertLinkClasses,
'data' => [
'counter-num' => $alertCount,
@ -1031,7 +1031,7 @@ class EchoHooks {
$msgLink = [
'href' => $url,
'text' => $msgText,
'active' => ( $url == $title->getLocalUrl() ),
'active' => ( $url == $title->getLocalURL() ),
'class' => $msgLinkClasses,
'data' => [
'counter-num' => $msgCount,

View file

@ -245,7 +245,7 @@ class MWEchoEmailBatch {
$dbr = $dbFactory->getEchoDb( DB_REPLICA );
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
$domainId = $dbw->getDomainId();
$domainId = $dbw->getDomainID();
$iterator = new BatchRowIterator( $dbr, 'echo_email_batch', 'eeb_event_id', $wgUpdateRowsPerQuery );
$iterator->addConditions( [ 'eeb_user_id' => $this->mUser->getId() ] );

View file

@ -236,7 +236,7 @@ class ApiEchoNotifications extends ApiQueryBase {
/** @var EchoNotification $first */
$first = reset( $notifs );
$continueId = intval( trim( strrchr( $continue, '|' ), '|' ) );
if ( $first->getEvent()->getID() !== $continueId ) {
if ( $first->getEvent()->getId() !== $continueId ) {
// notification doesn't match continue id, it must've been
// about read notifications: discard all unread ones
$notifs = [];
@ -388,7 +388,7 @@ class ApiEchoNotifications extends ApiQueryBase {
return $timestampsByWiki[$b]->getTimestamp( TS_UNIX ) - $timestampsByWiki[$a]->getTimestamp( TS_UNIX );
} );
$row = new StdClass;
$row = new stdClass;
$row->event_id = -1;
$row->event_type = 'foreign';
$row->event_variant = null;

View file

@ -101,7 +101,7 @@ class ApiEchoUnreadNotificationPages extends ApiQueryBase {
$pageName = $title->getPrefixedText();
}
$count = $pageCounts[$title->getArticleId()];
$count = $pageCounts[$title->getArticleID()];
if ( isset( $groupCounts[$pageName] ) ) {
$groupCounts[$pageName] += $count;
} else {

View file

@ -28,7 +28,7 @@ class EchoTitleLocalCache extends EchoLocalCache {
if ( $lookups ) {
$titles = Title::newFromIDs( $lookups );
foreach ( $titles as $title ) {
yield $title->getArticleId() => $title;
yield $title->getArticleID() => $title;
}
}
}

View file

@ -293,7 +293,7 @@ class EchoNotificationController {
return false;
}
$userId = $user->getID();
$userId = $user->getId();
if ( $userId === 0 ) {
return false; // anonymous user
}

View file

@ -95,7 +95,7 @@ class EchoPageLinkedPresentationModel extends EchoEventPresentationModel {
if ( isset( $extra['link-from-namespace'] ) && isset( $extra['link-from-title'] ) ) {
$title = Title::makeTitleSafe( $extra['link-from-namespace'], $extra['link-from-title'] );
if ( $title ) {
return $title->getArticleId();
return $title->getArticleID();
}
}
return 0;
@ -103,7 +103,7 @@ class EchoPageLinkedPresentationModel extends EchoEventPresentationModel {
private function getPageFrom() {
if ( !$this->pageFrom ) {
$this->pageFrom = Title::newFromId( $this->getLinkedPageId( $this->event ) );
$this->pageFrom = Title::newFromID( $this->getLinkedPageId( $this->event ) );
}
return $this->pageFrom;
}

View file

@ -200,7 +200,7 @@ class EchoNotificationMapper extends EchoAbstractMapper {
// the notification volume is in a reasonable amount for such case. The other option
// is to denormalize notification table with event_type and lookup index.
$conds = [
'notification_user' => $user->getID(),
'notification_user' => $user->getId(),
'event_type' => $eventTypes,
'event_deleted' => 0,
] + $conds;
@ -340,7 +340,7 @@ class EchoNotificationMapper extends EchoAbstractMapper {
$dbr = $this->dbFactory->getEchoDb( DB_REPLICA );
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
$domainId = $dbw->getDomainId();
$domainId = $dbw->getDomainID();
$iterator = new BatchRowIterator(
$dbr,

View file

@ -92,7 +92,7 @@ class EchoTargetPage extends EchoAbstractEntity {
*/
public function getTitle() {
if ( $this->title === false ) {
$this->title = Title::newFromId( $this->pageId );
$this->title = Title::newFromID( $this->pageId );
}
return $this->title;

View file

@ -148,6 +148,6 @@ class SpecialNotificationsMarkRead extends FormSpecialPage {
public function onSuccess() {
$page = SpecialPage::getTitleFor( 'Notifications' );
$this->getOutput()->redirect( $page->getFullUrl() );
$this->getOutput()->redirect( $page->getFullURL() );
}
}

View file

@ -329,7 +329,7 @@ class GenerateSampleNotifications extends Maintenance {
[
'type' => 'user-rights',
'extra' => [
'user' => $user->getID(),
'user' => $user->getId(),
'add' => $add,
'remove' => $remove,
'reason' => 'This is the [[reason]] for changing your user rights.',

View file

@ -324,19 +324,19 @@ class EchoAttributeManagerTest extends MediaWikiTestCase {
];
$manager = new EchoAttributeManager( $notif, $category, $defaultNotifyTypeAvailability, $notifyTypeAvailabilityByCategory );
$expected = [ 'event_one', 'event_three', 'event_four' ];
$actual = $manager->getUserEnabledEventsBySections( $this->mockUser(), 'web', [ 'alert' ] );
$actual = $manager->getUserEnabledEventsbySections( $this->mockUser(), 'web', [ 'alert' ] );
sort( $expected );
sort( $actual );
$this->assertEquals( $expected, $actual );
$expected = [ 'event_two' ];
$actual = $manager->getUserEnabledEventsBySections( $this->mockUser(), 'web', [ 'message' ] );
$actual = $manager->getUserEnabledEventsbySections( $this->mockUser(), 'web', [ 'message' ] );
sort( $expected );
sort( $actual );
$this->assertEquals( $expected, $actual );
$expected = [ 'event_one', 'event_two', 'event_three', 'event_four' ];
$actual = $manager->getUserEnabledEventsBySections( $this->mockUser(), 'web',
$actual = $manager->getUserEnabledEventsbySections( $this->mockUser(), 'web',
[ 'message', 'alert' ] );
sort( $expected );
sort( $actual );