From 571d305cceb7749a05e43debec95317c497d69c6 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Tue, 8 Oct 2019 11:24:22 -0700 Subject: [PATCH] Services: Convert BlockManager's static to a const now HHVM is gone Change-Id: I01d6e18fc30bd61ba7ea5ce1c7c646524579c4ba (cherry picked from commit 40c35286cbf11a12c855eb9ffa722b867028564b) --- includes/ServiceWiring.php | 2 +- includes/block/BlockManager.php | 6 ++---- tests/phpunit/includes/block/BlockManagerTest.php | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 2c1725ed75..7f60c663d8 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -116,7 +116,7 @@ return [ 'BlockManager' => function ( MediaWikiServices $services ) : BlockManager { return new BlockManager( new ServiceOptions( - BlockManager::$constructorOptions, $services->getMainConfig() + BlockManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig() ), $services->getPermissionManager(), LoggerFactory::getInstance( 'BlockManager' ) diff --git a/includes/block/BlockManager.php b/includes/block/BlockManager.php index 077bdca7c8..be09665cca 100644 --- a/includes/block/BlockManager.php +++ b/includes/block/BlockManager.php @@ -49,12 +49,10 @@ class BlockManager { private $options; /** - * TODO Make this a const when HHVM support is dropped (T192166) - * * @var array * @since 1.34 */ - public static $constructorOptions = [ + public const CONSTRUCTOR_OPTIONS = [ 'ApplyIpBlocksToXff', 'CookieSetOnAutoblock', 'CookieSetOnIpBlock', @@ -79,7 +77,7 @@ class BlockManager { PermissionManager $permissionManager, LoggerInterface $logger ) { - $options->assertRequiredOptions( self::$constructorOptions ); + $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS ); $this->options = $options; $this->permissionManager = $permissionManager; $this->logger = $logger; diff --git a/tests/phpunit/includes/block/BlockManagerTest.php b/tests/phpunit/includes/block/BlockManagerTest.php index 230d36a31d..ca08f673d2 100644 --- a/tests/phpunit/includes/block/BlockManagerTest.php +++ b/tests/phpunit/includes/block/BlockManagerTest.php @@ -53,7 +53,7 @@ class BlockManagerTest extends MediaWikiTestCase { return [ new LoggedServiceOptions( self::$serviceOptionsAccessLog, - BlockManager::$constructorOptions, + BlockManager::CONSTRUCTOR_OPTIONS, MediaWikiServices::getInstance()->getMainConfig() ), MediaWikiServices::getInstance()->getPermissionManager(), -- 2.20.1