wiki.techinc.nl/includes/ResourceLoader/SiteModule.php
Tim Starling 317b460500 Fix even more PHPStorm inspections (#3)
* Inappropriate @inheritDoc usage. Arguably all @inheritDoc is
  inappropriate but these are the ones PHPStorm flags as misleading
  due to the method not being inherited.
* Doc comment type does not match actual argument/return type.
* I replaced "@return void|never" with "@return void" since never means
  never, it doesn't make sense for it to be conditional. If a method
  can return (even if that is unlikely) then @return contains the type
  that it returns. "@return never" means that there is no such type
  because the method never returns.
* Incomplete/partial/broken doc tags

Change-Id: Ide86bd6d2b44387f37d234c2b059d6fbc42ec962
2023-03-25 00:30:15 +00:00

61 lines
1.7 KiB
PHP

<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* @author Trevor Parscal
* @author Roan Kattouw
*/
namespace MediaWiki\ResourceLoader;
use MediaWiki\MainConfigNames;
/**
* Module for site customizations.
*
* @ingroup ResourceLoader
* @internal
*/
class SiteModule extends WikiModule {
/**
* Get list of pages used by this module
*
* @param Context $context
* @return array[]
*/
protected function getPages( Context $context ) {
$pages = [];
if ( $this->getConfig()->get( MainConfigNames::UseSiteJs ) ) {
$skin = $context->getSkin();
$pages['MediaWiki:Common.js'] = [ 'type' => 'script' ];
$pages['MediaWiki:' . ucfirst( $skin ) . '.js'] = [ 'type' => 'script' ];
$this->getHookRunner()->onResourceLoaderSiteModulePages( $skin, $pages );
}
return $pages;
}
/**
* @param Context|null $context
* @return array
*/
public function getDependencies( Context $context = null ) {
return [ 'site.styles' ];
}
}
/** @deprecated since 1.39 */
class_alias( SiteModule::class, 'ResourceLoaderSiteModule' );