*/
public function getMatchedLanguage( $userPreferredLanguage ) {
$handler = $this->getHandler();
- if ( $handler && method_exists( $handler, 'getMatchedLanguage' ) ) {
+ if ( $handler ) {
return $handler->getMatchedLanguage(
$userPreferredLanguage,
$handler->getAvailableLanguages( $this )
);
- } else {
- return null;
}
+
+ return null;
}
/**
$lang->getCode(),
md5( $this->getName() )
);
+ $fname = __METHOD__;
return $cache->getWithSetCallback(
$key,
$this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,
- function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl ) {
+ function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl, $fname ) {
wfDebug( "Fetching shared description from $renderUrl\n" );
- $res = Http::get( $renderUrl, [], __METHOD__ );
+ $res = Http::get( $renderUrl, [], $fname );
if ( !$res ) {
$ttl = WANObjectCache::TTL_UNCACHEABLE;
}