Use ::class for class name resolution

Available since php5.5

Change-Id: I9b072c487b84e04fbb7e9ad8ed4b9db46d805ee8
This commit is contained in:
Umherirrender 2019-03-02 19:39:36 +01:00
parent 8a546989b7
commit f96b1eda5b
6 changed files with 7 additions and 7 deletions

View file

@ -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(

View file

@ -51,5 +51,5 @@ class CountFancyCaptchas extends Maintenance {
}
}
$maintClass = "CountFancyCaptchas";
$maintClass = CountFancyCaptchas::class;
require_once RUN_MAINTENANCE_IF_MAIN;

View file

@ -88,5 +88,5 @@ class DeleteOldFancyCaptchas extends Maintenance {
}
}
$maintClass = "DeleteOldFancyCaptchas";
$maintClass = DeleteOldFancyCaptchas::class;
require_once RUN_MAINTENANCE_IF_MAIN;

View file

@ -259,5 +259,5 @@ class GenerateFancyCaptchas extends Maintenance {
}
}
$maintClass = "GenerateFancyCaptchas";
$maintClass = GenerateFancyCaptchas::class;
require_once RUN_MAINTENANCE_IF_MAIN;

View file

@ -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();

View file

@ -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() );