X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialCachedPage.php;h=14c84e9d97b0a53f43e1cda17f17abebae1a053a;hb=e65f8ac5110804067366f9f239c13f4f29b66c3d;hp=7763166ac61835f373918b44a5d18639594ca78c;hpb=96764fbc9a67fa6040c6123d31ac3746fc6fd98f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialCachedPage.php b/includes/specials/SpecialCachedPage.php index 7763166ac6..14c84e9d97 100644 --- a/includes/specials/SpecialCachedPage.php +++ b/includes/specials/SpecialCachedPage.php @@ -38,7 +38,6 @@ * @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. @@ -93,7 +92,7 @@ abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper { $this->cacheHelper = new CacheHelper(); $this->cacheHelper->setCacheEnabled( $this->cacheEnabled ); - $this->cacheHelper->setOnInitializedHandler( array( $this, 'onCacheInitialized' ) ); + $this->cacheHelper->setOnInitializedHandler( [ $this, 'onCacheInitialized' ] ); $keyArgs = $this->getCacheKey(); @@ -125,7 +124,7 @@ abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper { * * @return mixed */ - public function getCachedValue( $computeFunction, $args = array(), $key = null ) { + public function getCachedValue( $computeFunction, $args = [], $key = null ) { return $this->cacheHelper->getCachedValue( $computeFunction, $args, $key ); } @@ -141,8 +140,12 @@ abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper { * @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 + ) ); } /** @@ -158,7 +161,8 @@ abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper { } /** - * 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 * @@ -176,10 +180,10 @@ abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper { * @return array */ protected function getCacheKey() { - return array( + return [ $this->mName, $this->getLanguage()->getCode() - ); + ]; } /**