* @since 1.20
*/
abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper {
-
/**
* CacheHelper object to which we forward the non-SpecialPage specific caching work.
* Initialized in startCache.
$this->cacheHelper = new CacheHelper();
$this->cacheHelper->setCacheEnabled( $this->cacheEnabled );
- $this->cacheHelper->setOnInitializedHandler( array( $this, 'onCacheInitialized' ) );
+ $this->cacheHelper->setOnInitializedHandler( [ $this, 'onCacheInitialized' ] );
$keyArgs = $this->getCacheKey();
*
* @return mixed
*/
- public function getCachedValue( $computeFunction, $args = array(), $key = null ) {
+ public function getCachedValue( $computeFunction, $args = [], $key = null ) {
return $this->cacheHelper->getCachedValue( $computeFunction, $args, $key );
}
* @param array $args
* @param string|null $key
*/
- public function addCachedHTML( $computeFunction, $args = array(), $key = null ) {
- $this->getOutput()->addHTML( $this->cacheHelper->getCachedValue( $computeFunction, $args, $key ) );
+ public function addCachedHTML( $computeFunction, $args = [], $key = null ) {
+ $this->getOutput()->addHTML( $this->cacheHelper->getCachedValue(
+ $computeFunction,
+ $args,
+ $key
+ ) );
}
/**
}
/**
- * Sets the time to live for the cache, in seconds or a unix timestamp indicating the point of expiry.
+ * Sets the time to live for the cache, in seconds or a unix timestamp
+ * indicating the point of expiry.
*
* @since 1.20
*
* @return array
*/
protected function getCacheKey() {
- return array(
+ return [
$this->mName,
$this->getLanguage()->getCode()
- );
+ ];
}
/**