* @param Redis $conn
* @param LoggerInterface $logger
*/
- public function __construct( RedisConnectionPool $pool, $server, Redis $conn, LoggerInterface $logger ) {
+ public function __construct(
+ RedisConnectionPool $pool, $server, Redis $conn, LoggerInterface $logger
+ ) {
$this->pool = $pool;
$this->server = $server;
$this->conn = $conn;
if ( $this->title === null ) {
global $wgTitle; # fallback to $wg till we can improve this
$this->title = $wgTitle;
- wfDebugLog( 'GlobalTitleFail', __METHOD__ . ' called by ' . wfGetAllCallers( 5 ) . ' with no title set.' );
+ wfDebugLog(
+ 'GlobalTitleFail',
+ __METHOD__ . ' called by ' . wfGetAllCallers( 5 ) . ' with no title set.'
+ );
}
return $this->title;
protected function blockHeader( $xbeg, $xlen, $ybeg, $ylen ) {
// '<!--LINE \d+ -->' get replaced by a localised line number
// in DifferenceEngine::localiseLineNumbers
- $r = '<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l' . $xbeg . '" ><!--LINE ' . $xbeg . "--></td>\n" .
- '<td colspan="2" class="diff-lineno"><!--LINE ' . $ybeg . "--></td></tr>\n";
+ $r = '<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l' .
+ $xbeg .
+ '" ><!--LINE ' .
+ $xbeg .
+ "--></td>\n" .
+ '<td colspan="2" class="diff-lineno"><!--LINE ' .
+ $ybeg .
+ "--></td></tr>\n";
return $r;
}
}
if ( $version === null ) {
- $version = isset( $_SERVER['SERVER_PROTOCOL'] ) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.0' ? '1.0' : '1.1';
+ $version = isset( $_SERVER['SERVER_PROTOCOL'] ) &&
+ $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.0' ?
+ '1.0' :
+ '1.1';
}
header( "HTTP/$version $code $message" );
parent::__construct( $params );
if ( empty( $params['caches'] ) || !is_array( $params['caches'] ) ) {
- throw new InvalidArgumentException( __METHOD__ . ': "caches" parameter must be an array of caches' );
+ throw new InvalidArgumentException(
+ __METHOD__ . ': "caches" parameter must be an array of caches'
+ );
}
$this->caches = array();
$text = ltrim( $text ) . "\n"; // make sure the preg_match may find the last line
$text = str_replace( "\n\n", "\n", $text ); // remove empty lines
preg_match( "/^(.*\n){0,$contextlines}/", $text, $match );
- $text = htmlspecialchars( substr( trim( $match[0] ), 0, $contextlines * $contextchars ) ); // trim and limit to max number of chars
+
+ // Trim and limit to max number of chars
+ $text = htmlspecialchars( substr( trim( $match[0] ), 0, $contextlines * $contextchars ) );
return str_replace( "\n", '<br>', $text );
}
}