if ( $deprecationInfo ) {
$name = $this->getName();
$warning = 'This page is using the deprecated ResourceLoader module "' . $name . '".';
- if ( !is_bool( $deprecationInfo ) && isset( $deprecationInfo['message'] ) ) {
- $warning .= "\n" . $deprecationInfo['message'];
+ if ( is_string( $deprecationInfo ) ) {
+ $warning .= "\n" . $deprecationInfo;
}
return Xml::encodeJsCall(
'mw.log.warn',
*/
final protected function buildContent( ResourceLoaderContext $context ) {
$rl = $context->getResourceLoader();
- $stats = RequestContext::getMain()->getStats();
+ $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
$statStart = microtime( true );
// Only include properties that are relevant to this context (e.g. only=scripts)
&& substr( rtrim( $scripts ), -1 ) !== ';'
) {
// Append semicolon to prevent weird bugs caused by files not
- // terminating their statements right (bug 27054)
+ // terminating their statements right (T29054)
$scripts .= ";\n";
}
}
if ( $context->shouldIncludeStyles() ) {
$styles = [];
// Don't create empty stylesheets like [ '' => '' ] for modules
- // that don't *have* any stylesheets (bug 38024).
+ // that don't *have* any stylesheets (T40024).
$stylePairs = $this->getStyles( $context );
if ( count( $stylePairs ) ) {
// If we are in debug mode without &only= set, we'll want to return an array of URLs
*/
public function getDefinitionSummary( ResourceLoaderContext $context ) {
return [
- '_class' => get_class( $this ),
+ '_class' => static::class,
'_cacheEpoch' => $this->getConfig()->get( 'CacheEpoch' ),
];
}