Background
Following T409774: Deprecate legacy "personal" and "namespaces" menu from SkinTemplate and Ifdd3f5 this method indirectly causes deprecation warnings due to access of personal_urls. Deprecating this code will allow to remove significant code in the rendering layer that is not in use in production and ultimately improve the performance of server-side rendering on skins (for logged in and logged out users) by significantly reducing the unnecessary processing required to generate template data.
Requirements
- Access to getPersonalTools should trigger a deprecation warning
Backwards compatibility code
Option 1
Use if you do not need to support user-interface-preferences menu (UniversalLanguageSelector)
/**
* Generates user tools menu
* @return string html
*/
protected function getUserLinks() {
$personaltools = $this->getSkin()->getStructuredPersonalTools();
}Option 2
/**
* Backwards compatibility method to get personal tools the "classic way" that doesn't trigger
* deprecation warnings (T422975).
*
* @return array
*/
private function getPersonalToolsClassic() {
$cNav = $this->get( 'content_navigation' );
$personalTools = array_merge(
$cNav['user-interface-preferences'],
$cNav['user-page'],
$cNav['notifications'],
$cNav['user-menu']
);
return $this->getSkin()->getPersonalToolsForMakeListItem( $personalTools );
}
/**
* Generates user tools menu
* @return string html
*/
protected function getUserLinks() {
$personaltools = $this->getPersonalToolsClassic();