/**
* Create a language object for a given language code
* @param string $code
- * @param $fallback boolean Whether we're going through language fallback chain
+ * @param bool $fallback Whether we're going through language fallback chain
* @throws MWException
* @return Language
*/
* YYYYMMDDHHMMSS
* 01234567890123
* @param DateTimeZone $zone Timezone of $ts
- * @param[out] int $ttl The amount of time (in seconds) the output may be cached for.
+ * @param int &$ttl The amount of time (in seconds) the output may be cached for.
* Only makes sense if $ts is the current time.
* @todo handling of "o" format character for Iranian, Hebrew, Hijri & Thai?
*
* @return int[]
*/
private static function tsToIranian( $ts ) {
- $gy = substr( $ts, 0, 4 ) -1600;
- $gm = substr( $ts, 4, 2 ) -1;
- $gd = substr( $ts, 6, 2 ) -1;
+ $gy = substr( $ts, 0, 4 ) - 1600;
+ $gm = substr( $ts, 4, 2 ) - 1;
+ $gd = substr( $ts, 6, 2 ) - 1;
# Days passed from the beginning (including leap years)
$gDayNo = 365 * $gy
(int)( ( 275 * $zm ) / 9 ) + $zd + 1729777;
}
- $zl = $zjd -1948440 + 10632;
+ $zl = $zjd - 1948440 + 10632;
$zn = (int)( ( $zl - 1 ) / 10631 );
$zl = $zl - 10631 * $zn + 354;
$zj = ( (int)( ( 10985 - $zl ) / 5316 ) ) * ( (int)( ( 50 * $zl ) / 17719 ) ) +
if ( $start < 0 ) {
$start = 0;
}
- $groupedNumber = substr( $number, $start, $end -$start ) . $groupedNumber;
+ $groupedNumber = substr( $number, $start, $end - $start ) . $groupedNumber;
$end = $start;
if ( $numMatches > 1 ) {
// use the last pattern for the rest of the number
*
* @since 1.28
* @param Language $lang
- * @return boolean
+ * @return bool
*/
public function equals( Language $lang ) {
return $lang->getCode() === $this->mCode;
/**
* @param string $code
- * @param boolean $fallback Whether we're going through language fallback chain
+ * @param bool $fallback Whether we're going through language fallback chain
* @return string Name of the language class
*/
public static function classFromCode( $code, $fallback = true ) {
public function formatExpiry( $expiry, $format = true, $infinity = 'infinity' ) {
static $dbInfinity;
if ( $dbInfinity === null ) {
- $dbInfinity = wfGetDB( DB_SLAVE )->getInfinity();
+ $dbInfinity = wfGetDB( DB_REPLICA )->getInfinity();
}
if ( $expiry == '' || $expiry === 'infinity' || $expiry == $dbInfinity ) {