/** @var int ERR_* constant for the "last error" registry */
protected $lastRelayError = self::ERR_NONE;
- /** @var integer Callback stack depth for getWithSetCallback() */
+ /** @var int Callback stack depth for getWithSetCallback() */
private $callbackDepth = 0;
/** @var mixed[] Temporary warm-up cache */
private $warmupCache = [];
- /** @var integer Key fetched */
+ /** @var int Key fetched */
private $warmupKeyMisses = 0;
/** Max time expected to pass between delete() and DB commit finishing */
const FLD_FLAGS = 4; // key to the flags bitfield
const FLD_HOLDOFF = 5; // key to any hold-off TTL
- /** @var integer Treat this value as expired-on-arrival */
+ /** @var int Treat this value as expired-on-arrival */
const FLG_STALE = 1;
const ERR_NONE = 0; // no error
*
* @param string $key Cache key
* @param mixed $value
- * @param integer $ttl Seconds to live. Special values are:
+ * @param int $ttl Seconds to live. Special values are:
* - WANObjectCache::TTL_INDEFINITE: Cache forever
* @param array $opts Options map:
* - lag : Seconds of replica DB lag. Typically, this is either the replica DB lag
* idempotence, the $ttl should not vary for different delete() calls on the same key.
*
* @param string $key Cache key
- * @param integer $ttl Tombstone TTL; Default: WANObjectCache::HOLDOFF_TTL
+ * @param int $ttl Tombstone TTL; Default: WANObjectCache::HOLDOFF_TTL
* @return bool True if the item was purged or not found, false on failure
*/
final public function delete( $key, $ttl = self::HOLDOFF_TTL ) {
* @see WANObjectCache::set()
*
* @param string $key Cache key
- * @param integer $ttl Seconds to live for key updates. Special values are:
+ * @param int $ttl Seconds to live for key updates. Special values are:
* - WANObjectCache::TTL_INDEFINITE: Cache forever
* - WANObjectCache::TTL_UNCACHEABLE: Do not cache at all
* @param callable $callback Value generation function
* @see WANObjectCache::getWithSetCallback()
*
* @param string $key
- * @param integer $ttl
+ * @param int $ttl
* @param callback $callback
* @param array $opts Options map for getWithSetCallback()
* @param float &$asOf Cache generation timestamp of returned value [returned]
* @endcode
*
* @param ArrayIterator $keyedIds Result of WANObjectCache::makeMultiKeys()
- * @param integer $ttl Seconds to live for key updates
+ * @param int $ttl Seconds to live for key updates
* @param callable $callback Callback the yields entity regeneration callbacks
* @param array $opts Options map
* @return array Map of (cache key => value) in the same order as $keyedIds
* @endcode
*
* @param ArrayIterator $keyedIds Result of WANObjectCache::makeMultiKeys()
- * @param integer $ttl Seconds to live for key updates
+ * @param int $ttl Seconds to live for key updates
* @param callable $callback Callback the yields entity regeneration callbacks
* @param array $opts Options map
* @return array Map of (cache key => value) in the same order as $keyedIds
/**
* @see BagOStuff::makeKey()
- * @param string ... Key component
+ * @param string $keys,... Key component
* @return string
* @since 1.27
*/
/**
* @see BagOStuff::makeGlobalKey()
- * @param string ... Key component
+ * @param string $keys,... Key component
* @return string
* @since 1.27
*/
}
/**
- * @param integer $flag ATTR_* class constant
- * @return integer QOS_* class constant
+ * @param int $flag ATTR_* class constant
+ * @return int QOS_* class constant
* @since 1.28
*/
public function getQoS( $flag ) {
* $ttl = $cache->adaptiveTTL( $mtime, $cache::TTL_DAY );
* @endcode
*
- * @param integer|float $mtime UNIX timestamp
- * @param integer $maxTTL Maximum TTL (seconds)
- * @param integer $minTTL Minimum TTL (seconds); Default: 30
+ * @param int|float $mtime UNIX timestamp
+ * @param int $maxTTL Maximum TTL (seconds)
+ * @param int $minTTL Minimum TTL (seconds); Default: 30
* @param float $factor Value in the range (0,1); Default: .2
- * @return integer Adaptive TTL
+ * @return int Adaptive TTL
* @since 1.28
*/
- public function adaptiveTTL( $mtime, $maxTTL, $minTTL = 30, $factor = .2 ) {
+ public function adaptiveTTL( $mtime, $maxTTL, $minTTL = 30, $factor = 0.2 ) {
if ( is_float( $mtime ) || ctype_digit( $mtime ) ) {
$mtime = (int)$mtime; // handle fractional seconds and string integers
}
}
/**
- * @return integer Number of warmup key cache misses last round
+ * @return int Number of warmup key cache misses last round
* @since 1.30
*/
public function getWarmupKeyMisses() {
* This must set the key to "PURGED:<UNIX timestamp>:<holdoff>"
*
* @param string $key Cache key
- * @param integer $ttl How long to keep the tombstone [seconds]
- * @param integer $holdoff HOLDOFF_* constant controlling how long to ignore sets for this key
+ * @param int $ttl How long to keep the tombstone [seconds]
+ * @param int $holdoff HOLDOFF_* constant controlling how long to ignore sets for this key
* @return bool Success
*/
protected function relayPurge( $key, $ttl, $holdoff ) {
* and get hits too. Similar to worthRefreshExpiring(), randomization is used.
*
* @param float $asOf UNIX timestamp of the value
- * @param integer $ageNew Age of key when this might recommend refreshing (seconds)
- * @param integer $timeTillRefresh Age of key when it should be refreshed if popular (seconds)
+ * @param int $ageNew Age of key when this might recommend refreshing (seconds)
+ * @param int $timeTillRefresh Age of key when it should be refreshed if popular (seconds)
* @param float $now The current UNIX timestamp
* @return bool
*/
* Do not use this method outside WANObjectCache
*
* @param mixed $value
- * @param integer $ttl [0=forever]
+ * @param int $ttl [0=forever]
* @param float $now Unix Current timestamp just before calling set()
* @return array
*/