}
/**
- * @param WANObjectCache $wanCache WAN cache instance
- * @param BagOStuff $clusterCache Cluster cache instance
- * @param BagOStuff $srvCache Server cache instance
+ * @param WANObjectCache $wanCache
+ * @param BagOStuff $clusterCache
+ * @param BagOStuff $serverCache
* @param bool $useDB Whether to look for message overrides (e.g. MediaWiki: pages)
* @param int $expiry Lifetime for cache. @see $mExpiry.
*/
public function __construct(
WANObjectCache $wanCache,
BagOStuff $clusterCache,
- BagOStuff $srvCache,
+ BagOStuff $serverCache,
$useDB,
$expiry
) {
$this->wanCache = $wanCache;
$this->clusterCache = $clusterCache;
- $this->srvCache = $srvCache;
+ $this->srvCache = $serverCache;
$this->mDisable = !$useDB;
$this->mExpiry = $expiry;
if ( !$this->mParserOptions ) {
if ( !$wgUser->isSafeToLoad() ) {
- // $wgUser isn't loaded yet, so don't try to get a
+ // $wgUser isn't unstubbable yet, so don't try to get a
// ParserOptions for it. And don't cache this ParserOptions
// either.
$po = ParserOptions::newFromAnon();
$po->setEditSection( false );
$po->setAllowUnsafeRawHtml( false );
- $po->setWrapOutputClass( false );
return $po;
}
// from malicious sources. As a precaution, disable
// the <html> parser tag when parsing messages.
$this->mParserOptions->setAllowUnsafeRawHtml( false );
- // Wrapping messages in an extra <div> is probably not expected. If
- // they're outside the content area they probably shouldn't be
- // targeted by CSS that's targeting the parser output, and if
- // they're inside they already are from the outer div.
- $this->mParserOptions->setWrapOutputClass( false );
}
return $this->mParserOptions;
* the site language.
*
* @see MessageCache::get
- * @param Language $lang Preferred language
+ * @param Language|StubObject $lang Preferred language
* @param string $lckey Lowercase key for the message (as for localisation cache)
* @param bool $useDB Whether to include messages from the wiki database
* @return string|bool The message, or false if not found
* Given a language, try and fetch messages from that language and its fallbacks.
*
* @see MessageCache::get
- * @param Language $lang Preferred language
+ * @param Language|StubObject $lang Preferred language
* @param string $lckey Lowercase key for the message (as for localisation cache)
* @param bool $useDB Whether to include messages from the wiki database
* @param bool[] $alreadyTried Contains true for each language that has been tried already
if ( $titleObj->getLatestRevID() ) {
$revision = Revision::newKnownCurrent(
$dbr,
- $titleObj->getArticleID(),
- $titleObj->getLatestRevID()
+ $titleObj
);
} else {
$revision = false;
$wgParser->firstCallInit();
# Clone it and store it
$class = $wgParserConf['class'];
- if ( $class == 'ParserDiffTest' ) {
+ if ( $class == ParserDiffTest::class ) {
# Uncloneable
$this->mParser = new $class( $wgParserConf );
} else {