mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-27 17:40:11 +00:00
Use ::class for class name resolution
Available since php5.5 Change-Id: I9b072c487b84e04fbb7e9ad8ed4b9db46d805ee8
This commit is contained in:
parent
8a546989b7
commit
f96b1eda5b
|
@ -73,7 +73,7 @@ class MathCaptcha extends SimpleCaptcha {
|
|||
* @return string
|
||||
*/
|
||||
private function fetchMath( $sum ) {
|
||||
if ( class_exists( 'MathRenderer' ) ) {
|
||||
if ( class_exists( MathRenderer::class ) ) {
|
||||
$math = MathRenderer::getRenderer( $sum, [], 'png' );
|
||||
} else {
|
||||
throw new LogicException(
|
||||
|
|
|
@ -51,5 +51,5 @@ class CountFancyCaptchas extends Maintenance {
|
|||
}
|
||||
}
|
||||
|
||||
$maintClass = "CountFancyCaptchas";
|
||||
$maintClass = CountFancyCaptchas::class;
|
||||
require_once RUN_MAINTENANCE_IF_MAIN;
|
||||
|
|
|
@ -88,5 +88,5 @@ class DeleteOldFancyCaptchas extends Maintenance {
|
|||
}
|
||||
}
|
||||
|
||||
$maintClass = "DeleteOldFancyCaptchas";
|
||||
$maintClass = DeleteOldFancyCaptchas::class;
|
||||
require_once RUN_MAINTENANCE_IF_MAIN;
|
||||
|
|
|
@ -259,5 +259,5 @@ class GenerateFancyCaptchas extends Maintenance {
|
|||
}
|
||||
}
|
||||
|
||||
$maintClass = "GenerateFancyCaptchas";
|
||||
$maintClass = GenerateFancyCaptchas::class;
|
||||
require_once RUN_MAINTENANCE_IF_MAIN;
|
||||
|
|
|
@ -9,7 +9,7 @@ class CaptchaAuthenticationRequestTest extends AuthenticationRequestTestCase {
|
|||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->setMwGlobals( [
|
||||
'wgCaptchaClass' => 'SimpleCaptcha',
|
||||
'wgCaptchaClass' => SimpleCaptcha::class,
|
||||
'wgCaptchaStorageClass' => CaptchaHashStore::class,
|
||||
] );
|
||||
CaptchaStore::unsetInstanceForTests();
|
||||
|
|
|
@ -31,7 +31,7 @@ class CaptchaPreAuthenticationProviderTest extends MediaWikiTestCase {
|
|||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
// make sure $wgCaptcha resets between tests
|
||||
TestingAccessWrapper::newFromClass( 'ConfirmEditHooks' )->instanceCreated = false;
|
||||
TestingAccessWrapper::newFromClass( ConfirmEditHooks::class )->instanceCreated = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -114,7 +114,7 @@ class CaptchaPreAuthenticationProviderTest extends MediaWikiTestCase {
|
|||
$captcha->expects( $this->any() )->method( 'isBadLoginPerUserTriggered' )
|
||||
->willReturn( $isBadLoginPerUserTriggered );
|
||||
$this->setMwGlobals( 'wgCaptcha', $captcha );
|
||||
TestingAccessWrapper::newFromClass( 'ConfirmEditHooks' )->instanceCreated = true;
|
||||
TestingAccessWrapper::newFromClass( ConfirmEditHooks::class )->instanceCreated = true;
|
||||
$provider = new CaptchaPreAuthenticationProvider();
|
||||
$provider->setManager( AuthManager::singleton() );
|
||||
|
||||
|
|
Loading…
Reference in a new issue