* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @author Aaron Schulz
*/
/**
protected $liveRing;
/** @var Array (location => UNIX timestamp) */
protected $ejectionExpiries = [];
- /** @var integer UNIX timestamp */
+ /** @var int UNIX timestamp */
protected $ejectionNextExpiry = INF;
const RING_SIZE = 268435456; // 2^28
* Get the location of an item on the ring, as well as the next locations
*
* @param string $item
- * @param integer $limit Maximum number of locations to return
+ * @param int $limit Maximum number of locations to return
* @return array List of locations
*/
public function getLocations( $item, $limit ) {
* Remove a location from the "live" hash ring
*
* @param string $location
- * @param integer $ttl Seconds
+ * @param int $ttl Seconds
* @return bool Whether some non-ejected locations are left
*/
public function ejectFromLiveRing( $location, $ttl ) {
if ( $this->liveRing === null || $this->ejectionNextExpiry <= $now ) {
$this->ejectionExpiries = array_filter(
$this->ejectionExpiries,
- function( $expiry ) use ( $now ) {
+ function ( $expiry ) use ( $now ) {
return ( $expiry > $now );
}
);
* Get the location of an item on the "live" ring, as well as the next locations
*
* @param string $item
- * @param integer $limit Maximum number of locations to return
+ * @param int $limit Maximum number of locations to return
* @return array List of locations
* @throws UnexpectedValueException
*/