/**
* Open a file and return a subclass instance
*
- * @param $fileName string
+ * @param string $fileName
*
* @return CdbReader
*/
/**
* Create the object and open the file
*
- * @param $fileName string
+ * @param string $fileName
*/
abstract public function __construct( $fileName );
/**
* Get a value with a given key. Only string values are supported.
*
- * @param $key string
+ * @param string $key
*/
abstract public function get( $key );
}
* Open a writer and return a subclass instance.
* The user must have write access to the directory, for temporary file creation.
*
- * @param $fileName string
+ * @param string $fileName
*
* @return CdbWriterDBA|CdbWriterPHP
*/
/**
* Create the object and open the file
*
- * @param $fileName string
+ * @param string $fileName
*/
abstract public function __construct( $fileName );
/**
* Set a key to a given value. The value will be converted to string.
- * @param $key string
- * @param $value string
+ * @param string $key
+ * @param string $value
*/
abstract public function set( $key, $value );
* 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
*/
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 ) {
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 ) {
* SIIT IPv4-translated addresses are rejected.
* Note: canonicalize() tries to convert translated addresses to IPv4.
*
- * @param string $ip possible IP address
- * @return Boolean
+ * @param string $ip Possible IP address
+ * @return bool
*/
public static function isIPAddress( $ip ) {
return (bool)preg_match( '/^' . IP_ADDRESS_STRING . '$/', $ip );
* Given a string, determine if it as valid IP in IPv6 only.
* Note: Unlike isValid(), this looks for networks too.
*
- * @param string $ip possible IP address
- * @return Boolean
+ * @param string $ip Possible IP address
+ * @return bool
*/
public static function isIPv6( $ip ) {
return (bool)preg_match( '/^' . RE_IPV6_ADD . '(?:\/' . RE_IPV6_PREFIX . ')?$/', $ip );
* Given a string, determine if it as valid IP in IPv4 only.
* Note: Unlike isValid(), this looks for networks too.
*
- * @param string $ip possible IP address
- * @return Boolean
+ * @param string $ip Possible IP address
+ * @return bool
*/
public static function isIPv4( $ip ) {
return (bool)preg_match( '/^' . RE_IP_ADD . '(?:\/' . RE_IP_PREFIX . ')?$/', $ip );
* SIIT IPv4-translated addresses are rejected.
* Note: canonicalize() tries to convert translated addresses to IPv4.
*
- * @param $ip String
- * @return Boolean: True if it is valid.
+ * @param string $ip
+ * @return bool True if it is valid
*/
public static function isValid( $ip ) {
return ( preg_match( '/^' . RE_IP_ADD . '$/', $ip )
* SIIT IPv4-translated addresses are rejected.
* Note: canonicalize() tries to convert translated addresses to IPv4.
*
- * @param $ipblock String
- * @return Boolean: True if it is valid.
+ * @param string $ipblock
+ * @return bool True if it is valid
*/
public static function isValidBlock( $ipblock ) {
return ( preg_match( '/^' . RE_IPV6_BLOCK . '$/', $ipblock )
* IPv4 addresses are just trimmed.
*
* @param string $ip IP address in quad or octet form (CIDR or not).
- * @return String
+ * @return string
*/
public static function sanitizeIP( $ip ) {
$ip = trim( $ip );
* Prettify an IP for display to end users.
* This will make it more compact and lower-case.
*
- * @param $ip string
+ * @param string $ip
* @return string
*/
public static function prettifyIP( $ip ) {
* brackets like in RFC 2732. If the port matches the default port, omit
* the port specification
*
- * @param $host string
- * @param $port int
- * @param $defaultPort bool|int
+ * @param string $host
+ * @param int $port
+ * @param bool|int $defaultPort
* @return string
*/
public static function combineHostAndPort( $host, $port, $defaultPort = false ) {
/**
* Convert an IPv4 or IPv6 hexadecimal representation back to readable format
*
- * @param string $hex number, with "v6-" prefix if it is IPv6
- * @return String: quad-dotted (IPv4) or octet notation (IPv6)
+ * @param string $hex Number, with "v6-" prefix if it is IPv6
+ * @return string Quad-dotted (IPv4) or octet notation (IPv6)
*/
public static function formatHex( $hex ) {
if ( substr( $hex, 0, 3 ) == 'v6-' ) { // IPv6
/**
* Converts a hexadecimal number to an IPv6 address in octet notation
*
- * @param $ip_hex String: pure hex (no v6- prefix)
- * @return String (of format a:b:c:d:e:f:g:h)
+ * @param string $ip_hex Pure hex (no v6- prefix)
+ * @return string (of format a:b:c:d:e:f:g:h)
*/
public static function hexToOctet( $ip_hex ) {
// Pad hex to 32 chars (128 bits)
/**
* Converts a hexadecimal number to an IPv4 address in quad-dotted notation
*
- * @param $ip_hex String: pure hex
- * @return String (of format a.b.c.d)
+ * @param string $ip_hex Pure hex
+ * @return string (of format a.b.c.d)
*/
public static function hexToQuad( $ip_hex ) {
// Pad hex to 8 chars (32 bits)
* Determine if an IP address really is an IP address, and if it is public,
* i.e. not RFC 1918 or similar
*
- * @param $ip String
- * @return Boolean
+ * @param string $ip
+ * @return bool
*/
public static function isPublic( $ip ) {
static $privateSet = null;
* function for an IPv6 address will be prefixed with "v6-", a non-
* hexadecimal string which sorts after the IPv4 addresses.
*
- * @param string $ip quad dotted/octet IP address.
- * @return String|bool false on failure
+ * @param string $ip Quad dotted/octet IP address.
+ * @return string|bool False on failure
*/
public static function toHex( $ip ) {
if ( self::isIPv6( $ip ) ) {
/**
* Given an IPv6 address in octet notation, returns a pure hex string.
*
- * @param string $ip octet ipv6 IP address.
- * @return String|bool pure hex (uppercase); false on failure
+ * @param string $ip Octet ipv6 IP address.
+ * @return string|bool Pure hex (uppercase); false on failure
*/
private static function IPv6ToRawHex( $ip ) {
$ip = self::sanitizeIP( $ip );
* Convert a network specification in IPv6 CIDR notation to an
* integer network and a number of bits
*
- * @param $range
+ * @param string $range
*
* @return array(string, int)
*/
* 2001:0db8:85a3::7344 - 2001:0db8:85a3::7344 Explicit range
* 2001:0db8:85a3::7344/96 Single IP
*
- * @param $range
+ * @param string $range
*
* @return array(string, string)
*/
/**
* Determine if a given IPv4/IPv6 address is in a given CIDR network
*
- * @param string $addr the address to check against the given range.
- * @param string $range the range to check the given address against.
- * @return Boolean: whether or not the given address is in the given range.
+ * @param string $addr The address to check against the given range.
+ * @param string $range The range to check the given address against.
+ * @return bool Whether or not the given address is in the given range.
*/
public static function isInRange( $addr, $range ) {
$hexIP = self::toHex( $addr );
* This currently only checks a few IPV4-to-IPv6 related cases. More
* unusual representations may be added later.
*
- * @param string $addr something that might be an IP address
- * @return String: valid dotted quad IPv4 address or null
+ * @param string $addr Something that might be an IP address
+ * @return string Valid dotted quad IPv4 address or null
*/
public static function canonicalize( $addr ) {
// remove zone info (bug 35738)
/**
* @param string $hash Name of hashing algorithm
* @param BagOStuff $cache
- * @param string|array $context to mix into HKDF context
+ * @param string|array $context Context to mix into HKDF context
*/
public function __construct( $secretKeyMaterial, $algorithm, $cache, $context ) {
if ( strlen( $secretKeyMaterial ) < 16 ) {
/**
* MW specific salt, cached from last run
- * @return string binary string
+ * @return string Binary string
*/
protected function getSaltUsingCache() {
if ( $this->salt == '' ) {
/**
* Produce $bytes of secure random data. As a side-effect,
* $this->lastK is set to the last hashLen block of key material.
- * @param int $bytes number of bytes of data
- * @param string $context to mix into CTXinfo
- * @return string binary string of length $bytes
+ * @param int $bytes Number of bytes of data
+ * @param string $context Context to mix into CTXinfo
+ * @return string Binary string of length $bytes
*/
protected function realGenerate( $bytes, $context = '' ) {
* N.B. http://eprint.iacr.org/2010/264.pdf seems to differ from RFC 5869 in that the test
* vectors from RFC 5869 only work if K(0) = '' and K(1) = HMAC(PRK, K(0) || CTXinfo || 1)
*
- * @param string $hash the hashing function to use (e.g., sha256)
- * @param string $ikm the input keying material
- * @param string $salt the salt to add to the ikm, to get the prk
- * @param string $info optional context (change the output without affecting
+ * @param string $hash The hashing function to use (e.g., sha256)
+ * @param string $ikm The input keying material
+ * @param string $salt The salt to add to the ikm, to get the prk
+ * @param string $info Optional context (change the output without affecting
* the randomness properties of the output)
- * @param integer $L number of bytes to return
- * @return string cryptographically secure pseudorandom binary string
+ * @param int $L Number of bytes to return
+ * @return string Cryptographically secure pseudorandom binary string
*/
public static function HKDF( $hash, $ikm, $salt, $info, $L ) {
$prk = self::HKDFExtract( $hash, $salt, $ikm );
* Note that the hmac is keyed with XTS (the salt),
* and the SKM (source key material) is the "data".
*
- * @param string $hash the hashing function to use (e.g., sha256)
- * @param string $ikm the input keying material
- * @param string $salt the salt to add to the ikm, to get the prk
- * @return string binary string (pseudorandm key) used as input to HKDFExpand
+ * @param string $hash The hashing function to use (e.g., sha256)
+ * @param string $ikm The input keying material
+ * @param string $salt The salt to add to the ikm, to get the prk
+ * @return string Binary string (pseudorandm key) used as input to HKDFExpand
*/
private static function HKDFExtract( $hash, $salt, $ikm ) {
return hash_hmac( $hash, $ikm, $salt, true );
/**
* Expand the key with the given context
*
- * @param $hash Hashing Algorithm
- * @param $prk a pseudorandom key of at least HashLen octets
- * (usually, the output from the extract step)
- * @param $info optional context and application specific information
- * (can be a zero-length string)
- * @param $bytes length of output keying material in bytes
- * (<= 255*HashLen)
- * @param &$lastK set by this function to the last block of the expansion.
+ * @param string $hash Hashing Algorithm
+ * @param string $prk A pseudorandom key of at least HashLen octets
+ * (usually, the output from the extract step)
+ * @param string $info Optional context and application specific information
+ * (can be a zero-length string)
+ * @param int $bytes Length of output keying material in bytes
+ * (<= 255*HashLen)
+ * @param string &$lastK Set by this function to the last block of the expansion.
* In MediaWiki, this is used to seed future Extractions.
- * @return string cryptographically secure random string $bytes long
+ * @return string Cryptographically secure random string $bytes long
*/
private static function HKDFExpand( $hash, $prk, $info, $bytes, &$lastK = '' ) {
$hashLen = MWCryptHKDF::$hashLength[$hash];
/**
* Generate cryptographically random data and return it in raw binary form.
*
- * @param int $bytes the number of bytes of random data to generate
- * @param string $context string to mix into HMAC context
- * @return string binary string of length $bytes
+ * @param int $bytes The number of bytes of random data to generate
+ * @param string $context String to mix into HMAC context
+ * @return string Binary string of length $bytes
*/
public static function generate( $bytes, $context ) {
return self::singleton()->realGenerate( $bytes, $context );
* Generate cryptographically random data and return it in hexadecimal string format.
* See MWCryptRand::realGenerateHex for details of the char-to-byte conversion logic.
*
- * @param int $chars the number of hex chars of random data to generate
- * @param string $context string to mix into HMAC context
- * @return string random hex characters, $chars long
+ * @param int $chars The number of hex chars of random data to generate
+ * @param string $context String to mix into HMAC context
+ * @return string Random hex characters, $chars long
*/
public static function generateHex( $chars, $context = '' ) {
$bytes = ceil( $chars / 2 );
* Randomly hash data while mixing in clock drift data for randomness
*
* @param string $data The data to randomly hash.
- * @return String The hashed bytes
+ * @return string The hashed bytes
* @author Tim Starling
*/
protected function driftHash( $data ) {
/**
* Decide on the best acceptable hash algorithm we have available for hash()
* @throws MWException
- * @return String A hash algorithm
+ * @return string A hash algorithm
*/
protected function hashAlgo() {
if ( !is_null( $this->algo ) ) {
* Generate an acceptably unstable one-way-hash of some text
* making use of the best hash algorithm that we have available.
*
- * @param $data string
- * @return String A raw hash of the data
+ * @param string $data
+ * @return string A raw hash of the data
*/
protected function hash( $data ) {
return hash( $this->hashAlgo(), $data, true );
* Generate an acceptably unstable one-way-hmac of some text
* making use of the best hash algorithm that we have available.
*
- * @param $data string
- * @param $key string
- * @return String A raw hash of the data
+ * @param string $data
+ * @param string $key
+ * @return string A raw hash of the data
*/
protected function hmac( $data, $key ) {
return hash_hmac( $this->hashAlgo(), $data, $key, true );
* You can use MWCryptRand::wasStrong() if you wish to know if the source used
* was cryptographically strong.
*
- * @param int $bytes the number of bytes of random data to generate
+ * @param int $bytes The number of bytes of random data to generate
* @param bool $forceStrong Pass true if you want generate to prefer cryptographically
* strong sources of entropy even if reading from them may steal
* more entropy from the system than optimal.
- * @return String Raw binary random data
+ * @return string Raw binary random data
*/
public static function generate( $bytes, $forceStrong = false ) {
return self::singleton()->realGenerate( $bytes, $forceStrong );
* You can use MWCryptRand::wasStrong() if you wish to know if the source used
* was cryptographically strong.
*
- * @param int $chars the number of hex chars of random data to generate
+ * @param int $chars The number of hex chars of random data to generate
* @param bool $forceStrong Pass true if you want generate to prefer cryptographically
* strong sources of entropy even if reading from them may steal
* more entropy from the system than optimal.
- * @return String Hexadecimal random data
+ * @return string Hexadecimal random data
*/
public static function generateHex( $chars, $forceStrong = false ) {
return self::singleton()->realGenerateHex( $chars, $forceStrong );
/**
* @deprecated since 1.22; use call_user_func()
- * @param $callback
+ * @param callable $callback
* @return mixed
*/
public static function call( $callback ) {
/**
* @deprecated since 1.22; use call_user_func_array()
- * @param $callback
- * @param $argsarams
+ * @param callable $callback
+ * @param array $argsarams
* @return mixed
*/
public static function callArray( $callback, $argsarams ) {
}
/**
- * @param $class
- * @param $args array
+ * @param string $class
+ * @param array $args
* @return object
*/
public static function newObj( $class, $args = array() ) {
* Beware of this when backporting code to that version of MediaWiki.
*
* @param string $value String to check
- * @param boolean $disableMbstring Whether to use the pure PHP
+ * @param bool $disableMbstring Whether to use the pure PHP
* implementation instead of trying mb_check_encoding. Intended for unit
* testing. Default: false
*
- * @return boolean Whether the given $value is a valid UTF-8 encoded string
+ * @return bool Whether the given $value is a valid UTF-8 encoded string
*/
static function isUtf8( $value, $disableMbstring = false ) {
$value = (string)$value;
* hungry and inflexible. The memory requirements are such that I don't
* recommend using it on anything but guaranteed small chunks of text.
*
- * @param $startDelim
- * @param $endDelim
- * @param $replace
- * @param $subject
+ * @param string $startDelim
+ * @param string $endDelim
+ * @param string $replace
+ * @param string $subject
*
* @return string
*/
* start, so e.g. /*\/ is not considered to be both the start and end of a
* comment. /*\/xy/*\/ is considered to be a single comment with contents /xy/.
*
- * @param string $startDelim start delimiter
- * @param string $endDelim end delimiter
- * @param $callback Callback: function to call on each match
- * @param $subject String
- * @param string $flags regular expression flags
+ * @param string $startDelim Start delimiter
+ * @param string $endDelim End delimiter
+ * @param callable $callback Function to call on each match
+ * @param string $subject
+ * @param string $flags Regular expression flags
* @throws MWException
* @return string
*/
*
* preg_replace( "!$startDelim(.*)$endDelim!$flags", $replace, $subject )
*
- * @param string $startDelim start delimiter regular expression
- * @param string $endDelim end delimiter regular expression
- * @param string $replace replacement string. May contain $1, which will be
+ * @param string $startDelim Start delimiter regular expression
+ * @param string $endDelim End delimiter regular expression
+ * @param string $replace Replacement string. May contain $1, which will be
* replaced by the text between the delimiters
- * @param string $subject to search
- * @param string $flags regular expression flags
- * @return String: The string with the matches replaced
+ * @param string $subject String to search
+ * @param string $flags Regular expression flags
+ * @return string The string with the matches replaced
*/
static function delimiterReplace( $startDelim, $endDelim, $replace, $subject, $flags = '' ) {
$replacer = new RegexlikeReplacer( $replace );
*/
class DoubleReplacer extends Replacer {
/**
- * @param $from
- * @param $to
+ * @param mixed $from
+ * @param mixed $to
* @param int $index
*/
function __construct( $from, $to, $index = 0 ) {
private $table, $index;
/**
- * @param $table
+ * @param array $table
* @param int $index
*/
function __construct( $table, $index = 0 ) {
protected $lockFile88; // string; local file path
protected $lockFile128; // string; local file path
- /** @var Array */
+ /** @var array */
protected $fileHandles = array(); // cache file handles
const QUICK_RAND = 1; // get randomness from fast and insecure sources
*
* UID generation is serialized on each server (as the node ID is for the whole machine).
*
- * @param $base integer Specifies a base other than 10
+ * @param int $base Specifies a base other than 10
* @return string Number
* @throws MWException
*/
*
* UID generation is serialized on each server (as the node ID is for the whole machine).
*
- * @param $base integer Specifies a base other than 10
+ * @param int $base Specifies a base other than 10
* @return string Number
* @throws MWException
*/
/**
* Return an RFC4122 compliant v4 UUID
*
- * @param $flags integer Bitfield (supports UIDGenerator::QUICK_RAND)
+ * @param int $flags Bitfield (supports UIDGenerator::QUICK_RAND)
* @return string
* @throws MWException
*/
/**
* Return an RFC4122 compliant v4 UUID
*
- * @param $flags integer Bitfield (supports UIDGenerator::QUICK_RAND)
+ * @param int $flags Bitfield (supports UIDGenerator::QUICK_RAND)
* @return string 32 hex characters with no hyphens
* @throws MWException
*/
* If UIDGenerator::QUICK_VOLATILE is used the counter might reset on server restart.
*
* @param string $bucket Arbitrary bucket name (should be ASCII)
- * @param integer $bits Bit size (<=48) of resulting numbers before wrap-around
- * @param integer $flags (supports UIDGenerator::QUICK_VOLATILE)
+ * @param int $bits Bit size (<=48) of resulting numbers before wrap-around
+ * @param int $flags (supports UIDGenerator::QUICK_VOLATILE)
* @return float Integer value as float
* @since 1.23
*/
*
* @see UIDGenerator::newSequentialPerNodeID()
* @param string $bucket Arbitrary bucket name (should be ASCII)
- * @param integer $bits Bit size (16 to 48) of resulting numbers before wrap-around
- * @param integer $count Number of IDs to return (1 to 10000)
- * @param integer $flags (supports UIDGenerator::QUICK_VOLATILE)
+ * @param int $bits Bit size (16 to 48) of resulting numbers before wrap-around
+ * @param int $count Number of IDs to return (1 to 10000)
+ * @param int $flags (supports UIDGenerator::QUICK_VOLATILE)
* @return array Ordered list of float integer values
* @since 1.23
*/
*
* @see UIDGenerator::newSequentialPerNodeID()
* @param string $bucket Arbitrary bucket name (should be ASCII)
- * @param integer $bits Bit size (16 to 48) of resulting numbers before wrap-around
- * @param integer $count Number of IDs to return (1 to 10000)
- * @param integer $flags (supports UIDGenerator::QUICK_VOLATILE)
+ * @param int $bits Bit size (16 to 48) of resulting numbers before wrap-around
+ * @param int $count Number of IDs to return (1 to 10000)
+ * @param int $flags (supports UIDGenerator::QUICK_VOLATILE)
* @return array Ordered list of float integer values
*/
protected function getSequentialPerNodeIDs( $bucket, $bits, $count, $flags ) {
* This is useful for making UIDs sequential on a per-node bases.
*
* @param string $lockFile Name of a local lock file
- * @param $clockSeqSize integer The number of possible clock sequence values
- * @param $counterSize integer The number of possible counter values
- * @return Array (result of UIDGenerator::millitime(), counter, clock sequence)
+ * @param int $clockSeqSize The number of possible clock sequence values
+ * @param int $counterSize The number of possible counter values
+ * @return array (result of UIDGenerator::millitime(), counter, clock sequence)
* @throws MWException
*/
protected function getTimestampAndDelay( $lockFile, $clockSeqSize, $counterSize ) {
* timestamp. This returns false if it would have to wait more than 10ms.
*
* @param array $time Result of UIDGenerator::millitime()
- * @return Array|bool UIDGenerator::millitime() result or false
+ * @return array|bool UIDGenerator::millitime() result or false
*/
protected function timeWaitUntil( array $time ) {
do {
}
/**
- * @return Array (current time in seconds, milliseconds since then)
+ * @return array (current time in seconds, milliseconds since then)
*/
protected static function millitime() {
list( $msec, $sec ) = explode( ' ', microtime() );
* valid ZIP64 file, and working out what non-ZIP64 readers will make
* of such a file is not trivial.
*
- * @return Status object. The following fatal errors are defined:
+ * @return Status A Status object. The following fatal errors are defined:
*
* - zip-file-open-error: The file could not be opened.
*
/**
* Throw an error, and log a debug message
+ * @param mixed $code
+ * @param string $debugMessage
*/
function error( $code, $debugMessage ) {
wfDebug( __CLASS__ . ": Fatal error: $debugMessage\n" );
* Find the location of the central directory, as would be seen by a
* non-ZIP64 reader.
*
- * @return List containing offset, size and end position.
+ * @return array List containing offset, size and end position.
*/
function findOldCentralDirectory() {
$size = $this->eocdr['CD size'];
/**
* Get the length of the file.
+ * @return int
*/
function getFileLength() {
if ( $this->fileLength === null ) {
* Returns a bit from a given position in an integer value, converted to
* boolean.
*
- * @param $value integer
+ * @param int $value
* @param int $bitIndex The index of the bit, where 0 is the LSB.
* @return bool
*/
/**
* Debugging helper function which dumps a string in hexdump -C format.
+ * @param string $s
*/
function hexDump( $s ) {
$n = strlen( $s );