Update for MediaWiki 1.42.0

master
落雨楓 1 month ago
parent 9aad5ec459
commit 3284475efa

@ -4,7 +4,7 @@ namespace Isekai\UserPoints\Quests;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use MediaWiki\Session\SessionManager; use MediaWiki\Session\SessionManager;
use OutputPage; use MediaWiki\Output\OutputPage;
class Hooks { class Hooks {
/** /**

@ -3,7 +3,7 @@
namespace Isekai\UserPoints\Quests; namespace Isekai\UserPoints\Quests;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use User; use MediaWiki\User\User;
use Isekai\UserPoints\Service\IsekaiUserPointsFactory; use Isekai\UserPoints\Service\IsekaiUserPointsFactory;
use Isekai\UserPoints\Utils; use Isekai\UserPoints\Utils;

@ -3,7 +3,7 @@ namespace Isekai\UserPoints\Api;
use ApiQueryBase; use ApiQueryBase;
use ApiQuery; use ApiQuery;
use Config; use MediaWiki\Config\Config;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use WANObjectCache; use WANObjectCache;
use Isekai\UserPoints\Service\IsekaiUserPointsFactory; use Isekai\UserPoints\Service\IsekaiUserPointsFactory;

@ -3,11 +3,10 @@ namespace Isekai\UserPoints\Api;
use ApiQueryBase; use ApiQueryBase;
use ApiQuery; use ApiQuery;
use Config; use MediaWiki\Config\Config;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use WANObjectCache; use WANObjectCache;
use Wikimedia\ParamValidator\ParamValidator; use Wikimedia\ParamValidator\ParamValidator;
use User;
use Isekai\UserPoints\Service\IsekaiUserPointsFactory; use Isekai\UserPoints\Service\IsekaiUserPointsFactory;
use Isekai\UserPoints\Utils; use Isekai\UserPoints\Utils;
@ -82,6 +81,10 @@ class ApiQueryUsersPoints extends ApiQueryBase {
$result = $this->getResult(); $result = $this->getResult();
foreach ($userPointsInstances as $userPointsTuple) { foreach ($userPointsInstances as $userPointsTuple) {
if ( !$userPointsTuple ) {
continue;
}
list($user, $type, $userPoint) = $userPointsTuple; list($user, $type, $userPoint) = $userPointsTuple;
$result->addValue( $result->addValue(
[ 'query', $this->getModuleName(), "pointdata", $user->getId() ], [ 'query', $this->getModuleName(), "pointdata", $user->getId() ],

@ -2,7 +2,6 @@
namespace Isekai\UserPoints\Api; namespace Isekai\UserPoints\Api;
use ApiBase; use ApiBase;
use Isekai\UserPoints\Service\IsekaiUserPointsFactory;
use Isekai\UserPoints\Service\IsekaiUserDailySignFactory; use Isekai\UserPoints\Service\IsekaiUserDailySignFactory;
use Isekai\UserPoints\Utils; use Isekai\UserPoints\Utils;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;

@ -2,13 +2,13 @@
namespace Isekai\UserPoints; namespace Isekai\UserPoints;
use DatabaseUpdater;
use DateTime; use DateTime;
use DateTimeZone; use DateTimeZone;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use OutputPage; use MediaWiki\Output\OutputPage;
use MediaWiki\User\User;
use MediaWiki\Installer\DatabaseUpdater;
use Skin; use Skin;
use User;
class Hooks { class Hooks {
/** /**

@ -2,7 +2,7 @@
namespace Isekai\UserPoints\Service; namespace Isekai\UserPoints\Service;
use stdClass; use stdClass;
use User; use MediaWiki\User\User;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
/** /**

@ -1,8 +1,8 @@
<?php <?php
namespace Isekai\UserPoints\Service; namespace Isekai\UserPoints\Service;
use Config; use MediaWiki\Config\Config;
use User; use MediaWiki\User\User;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
class IsekaiUserDailySignFactory { class IsekaiUserDailySignFactory {

@ -2,7 +2,7 @@
namespace Isekai\UserPoints\Service; namespace Isekai\UserPoints\Service;
use Isekai\UserPoints\Utils; use Isekai\UserPoints\Utils;
use User; use MediaWiki\User\User;
use stdClass; use stdClass;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;

@ -2,7 +2,7 @@
namespace Isekai\UserPoints\Service; namespace Isekai\UserPoints\Service;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use User; use MediaWiki\User\User;
class IsekaiUserPointsFactory { class IsekaiUserPointsFactory {
/** @var MediaWikiServices */ /** @var MediaWikiServices */
@ -67,7 +67,7 @@ class IsekaiUserPointsFactory {
} }
/** /**
* @return array{0: User, 1: string, 2: IsekaiUserPoints} (user, instance) * @return array{User, string, IsekaiUserPoints}[]
*/ */
public function newFromUsers(array $users, array $pointTypes) { public function newFromUsers(array $users, array $pointTypes) {
$userids = []; $userids = [];

@ -1,7 +1,7 @@
<?php <?php
namespace Isekai\UserPoints; namespace Isekai\UserPoints;
use Html; use MediaWiki\Html\Html;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
class Utils { class Utils {

Loading…
Cancel
Save