| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Hook; |
| 4 | |
| 5 | use Skin; |
| 6 | |
| 7 | /** |
| 8 | * This is a hook handler interface, see docs/Hooks.md. |
| 9 | * Use the hook name "SidebarBeforeOutput" to register handlers implementing this interface. |
| 10 | * |
| 11 | * @stable to implement |
| 12 | * @ingroup Hooks |
| 13 | */ |
| 14 | interface SidebarBeforeOutputHook { |
| 15 | /** |
| 16 | * Use this hook to edit the sidebar just before it is output by skins. |
| 17 | * Warning: This hook is run on each display. You should consider using |
| 18 | * 'SkinBuildSidebar', which is aggressively cached. |
| 19 | * |
| 20 | * @since 1.35 |
| 21 | * |
| 22 | * @param Skin $skin |
| 23 | * @param array &$sidebar Sidebar content. Modify $sidebar to add or modify sidebar portlets. |
| 24 | * See {@link Skin::buildSidebar()} for the structure of $sidebar. |
| 25 | * @return void This hook must not abort; it must not return value. |
| 26 | */ |
| 27 | public function onSidebarBeforeOutput( $skin, &$sidebar ): void; |
| 28 | } |