Skip to content

Commit 6fdd200

Browse files
committed
Fix deprecations
1 parent 364f4da commit 6fdd200

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/ResourceLoaderSCSSModule.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525

2626
namespace SCSS;
2727

28-
use BagOStuff;
2928
use CSSJanus;
3029
use Exception;
30+
use MediaWiki\MediaWikiServices;
3131
use MediaWiki\ResourceLoader\Context;
3232
use MediaWiki\ResourceLoader\FileModule;
3333
use MediaWiki\ResourceLoader\FilePath;
34-
use ObjectCache;
34+
use ObjectCacheFactory;
3535
use ScssPhp\ScssPhp\Compiler;
36+
use Wikimedia\ObjectCache\BagOStuff;
3637

3738
/**
3839
* ResourceLoader module based on local JavaScript/SCSS files.
@@ -138,12 +139,16 @@ protected function retrieveStylesFromCache( Context $context ): void {
138139

139140
protected function getCache(): BagOStuff {
140141
if ( $this->cache === null ) {
141-
$this->cache = ObjectCache::getInstance( $this->getCacheType() );
142+
$this->cache = $this->getObjectCacheFactory()->getInstance( $this->getCacheType() );
142143
}
143144

144145
return $this->cache;
145146
}
146147

148+
private function getObjectCacheFactory(): ObjectCacheFactory {
149+
return MediaWikiServices::getInstance()->getObjectCacheFactory();
150+
}
151+
147152
private function getCacheType(): int {
148153
return array_key_exists( 'egScssCacheType', $GLOBALS ) ? (int)$GLOBALS[ 'egScssCacheType' ] : -1;
149154
}
@@ -168,7 +173,7 @@ protected function getCacheKey( Context $context ): string {
168173
// have to hash the module config, else it may become too long
169174
$configHash = md5( $styles . $vars );
170175

171-
$this->cacheKey = ObjectCache::getLocalClusterInstance()->makeKey(
176+
$this->cacheKey = $this->getObjectCacheFactory()->getLocalClusterInstance()->makeKey(
172177
'ext',
173178
'scss',
174179
$configHash,

0 commit comments

Comments
 (0)