* Take a modulo of a signed integer as if it were an unsigned integer.
* $b must be less than 0x40000000 and greater than 0
*
- * @param $a
- * @param $b
+ * @param int $a
+ * @param int $b
*
* @return int
*/
/**
* Shift a signed integer right as if it were unsigned
- * @param $a
- * @param $b
+ * @param int $a
+ * @param int $b
* @return int
*/
public static function unsignedShiftRight( $a, $b ) {
/**
* The CDB hash function.
*
- * @param $s string
+ * @param string $s
*
* @return int
*/
*/
class CdbReaderPHP extends CdbReader {
/** The filename */
- var $fileName;
+ protected $fileName;
/* number of hash slots searched under this key */
- var $loop;
+ protected $loop;
/* initialized if loop is nonzero */
- var $khash;
+ protected $khash;
/* initialized if loop is nonzero */
- var $kpos;
+ protected $kpos;
/* initialized if loop is nonzero */
- var $hpos;
+ protected $hpos;
/* initialized if loop is nonzero */
- var $hslots;
+ protected $hslots;
/* initialized if findNext() returns true */
- var $dpos;
+ protected $dpos;
/* initialized if cdb_findnext() returns 1 */
- var $dlen;
+ protected $dlen;
/**
- * @param $fileName string
+ * @param string $fileName
* @throws CdbException
*/
public function __construct( $fileName ) {
}
/**
- * @param $key
+ * @param mixed $key
* @return bool|string
*/
public function get( $key ) {
}
/**
- * @param $key
- * @param $pos
+ * @param string $key
+ * @param int $pos
* @return bool
*/
protected function match( $key, $pos ) {
/**
* @throws CdbException
- * @param $length
- * @param $pos
+ * @param int $length
+ * @param int $pos
* @return string
*/
protected function read( $length, $pos ) {
/**
* Unpack an unsigned integer and throw an exception if it needs more than 31 bits
- * @param $s
+ * @param string $s
* @throws CdbException
* @return mixed
*/
/**
* Unpack a 32-bit signed integer
- * @param $s
+ * @param string $s
* @return int
*/
protected function unpackSigned( $s ) {
}
/**
- * @param $key
+ * @param string $key
* @return bool
*/
protected function findNext( $key ) {
}
/**
- * @param $key
+ * @param mixed $key
* @return bool
*/
protected function find( $key ) {
* CDB writer class
*/
class CdbWriterPHP extends CdbWriter {
- var $hplist;
- var $numentries, $pos;
+ protected $hplist;
+
+ protected $numentries;
+
+ protected $pos;
/**
- * @param $fileName string
+ * @param string $fileName
*/
public function __construct( $fileName ) {
$this->realFileName = $fileName;
/**
* @throws CdbException
- * @param $buf
+ * @param string $buf
*/
protected function write( $buf ) {
$len = fwrite( $this->handle, $buf );
/**
* @throws CdbException
- * @param $len
+ * @param int $len
*/
protected function posplus( $len ) {
$newpos = $this->pos + $len;
}
/**
- * @param $keylen
- * @param $datalen
- * @param $h
+ * @param int $keylen
+ * @param int $datalen
+ * @param int $h
*/
protected function addend( $keylen, $datalen, $h ) {
$this->hplist[] = array(
/**
* @throws CdbException
- * @param $keylen
- * @param $datalen
+ * @param int $keylen
+ * @param int $datalen
*/
protected function addbegin( $keylen, $datalen ) {
if ( $keylen > 0x7fffffff ) {
/**
* Clean up the temp file and throw an exception
*
- * @param $msg string
+ * @param string $msg
* @throws CdbException
*/
protected function throwException( $msg ) {