X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=blobdiff_plain;f=includes%2Flibs%2Fobjectcache%2Fwancache%2FWANObjectCache.php;h=2ce216d08a131c9f9871bad4f68f88b866350c57;hb=4cc031607c9b8e17265e51372b94399399254966;hp=b88b49697ad0105a3964bcbc07a9cf3b4bec77f7;hpb=529143e4aa1bf708bb749857c2e03358ee67fe65;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/objectcache/wancache/WANObjectCache.php b/includes/libs/objectcache/wancache/WANObjectCache.php index b88b49697a..2ce216d08a 100644 --- a/includes/libs/objectcache/wancache/WANObjectCache.php +++ b/includes/libs/objectcache/wancache/WANObjectCache.php @@ -578,10 +578,14 @@ class WANObjectCache implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInt * - version: Integer version number signifiying the format of the value. * Default: null * - walltime: How long the value took to generate in seconds. Default: 0.0 + * @codingStandardsIgnoreStart + * @phan-param array{lag?:int,since?:int,pending?:bool,lockTSE?:int,staleTTL?:int,creating?:bool,version?:?string,walltime?:int|float} $opts + * @codingStandardsIgnoreEnd * @note Options added in 1.28: staleTTL * @note Options added in 1.33: creating * @note Options added in 1.34: version, walltime * @return bool Success + * @suppress PhanTypeInvalidDimOffset */ final public function set( $key, $value, $ttl = self::TTL_INDEFINITE, array $opts = [] ) { $now = $this->getCurrentTime(); @@ -1246,11 +1250,15 @@ class WANObjectCache implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInt * most sense for values that are moderately to highly expensive to regenerate and easy * to query for dependency timestamps. The use of "pcTTL" reduces timestamp queries. * Default: null. + * @codingStandardsIgnoreStart + * @phan-param array{checkKeys?:string[],graceTTL?:int,lockTSE?:int,busyValue?:mixed,pcTTL?:int,pcGroup?:string,version?:int,minAsOf?:int,hotTTR?:int,lowTTL?:int,ageNew?:int,staleTTL?:int,touchedCallback?:callable} $opts + * @codingStandardsIgnoreEnd * @return mixed Value found or written to the key * @note Options added in 1.28: version, busyValue, hotTTR, ageNew, pcGroup, minAsOf * @note Options added in 1.31: staleTTL, graceTTL * @note Options added in 1.33: touchedCallback * @note Callable type hints are not used to avoid class-autoloading + * @suppress PhanTypeInvalidDimOffset */ final public function getWithSetCallback( $key, $ttl, $callback, array $opts = [] ) { $version = $opts['version'] ?? null; @@ -1305,6 +1313,7 @@ class WANObjectCache implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInt * - Cached or regenerated value version number or null if not versioned * - Timestamp of the current cached value at the key or null if there is no value * @note Callable type hints are not used to avoid class-autoloading + * @suppress PhanTypeArraySuspicious */ private function fetchOrRegenerate( $key, $ttl, $callback, array $opts ) { $checkKeys = $opts['checkKeys'] ?? []; @@ -1441,6 +1450,7 @@ class WANObjectCache implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInt $this->setInterimValue( $key, $value, $lockTSE, $version, $walltime ); } else { $finalSetOpts = [ + // @phan-suppress-next-line PhanTypeInvalidDimOffset 'since' => $setOpts['since'] ?? $preCallbackTime, 'version' => $version, 'staleTTL' => $staleTTL, @@ -2421,6 +2431,7 @@ class WANObjectCache implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInt * - curTTL: remaining time-to-live (negative if tombstoned) or null if there is no value * - version: value version number or null if the if there is no value * - tombAsOf: UNIX timestamp of the tombstone or null if there is no tombstone + * @phan-return array{0:mixed,1:array{asOf:?mixed,curTTL:?int|float,version:?mixed,tombAsOf:?mixed}} */ private function unwrap( $wrapped, $now ) { $value = false;