static function normalizeKey( $key ) {
global $wgDefaultSkin, $wgFallbackSkin;
- $skinNames = Skin::getSkinNames();
+ $skinNames = self::getSkinNames();
// Make keys lowercase for case-insensitive matching.
$skinNames = array_change_key_case( $skinNames, CASE_LOWER );
* "<body>" tag, skins can override it if they have a need to add in any
* body attributes or classes of their own.
* @param OutputPage $out
- * @param array $bodyAttrs
+ * @param array &$bodyAttrs
*/
function addToBodyAttributes( $out, &$bodyAttrs ) {
// does nothing by default
/**
* make sure we have some title to operate on
*
- * @param Title $title
+ * @param Title &$title
* @param string $name
*/
static function checkTitle( &$title, $name ) {
function buildSidebar() {
global $wgEnableSidebarCache, $wgSidebarCacheExpiry;
- $that = $this;
- $callback = function () use ( $that ) {
+ $callback = function () {
$bar = [];
- $that->addToSidebar( $bar, 'sidebar' );
- Hooks::run( 'SkinBuildSidebar', [ $that, &$bar ] );
+ $this->addToSidebar( $bar, 'sidebar' );
+ Hooks::run( 'SkinBuildSidebar', [ $this, &$bar ] );
return $bar;
};
*
* This is just a wrapper around addToSidebarPlain() for backwards compatibility
*
- * @param array $bar
+ * @param array &$bar
* @param string $message
*/
public function addToSidebar( &$bar, $message ) {
/**
* Add content from plain text
* @since 1.17
- * @param array $bar
+ * @param array &$bar
* @param string $text
* @return array
*/
$bar[$heading][] = array_merge( [
'text' => $text,
'href' => $href,
- 'id' => 'n-' . Sanitizer::escapeId( strtr( $line[1], ' ', '-' ), 'noninitial' ),
- 'active' => false
+ 'id' => Sanitizer::escapeIdForAttribute( 'n-' . strtr( $line[1], ' ', '-' ) ),
+ 'active' => false,
], $extraAttribs );
} else {
continue;