Based on current non-voting codesniffer warnings.
Change-Id: I34cbc31eda3eaa519a71fe2c04122859f2f15914
*
* See OutputPage::buildExemptModules() for use cases.
*
*
* See OutputPage::buildExemptModules() for use cases.
*
- * @param array $modules Module state keyed by module name
+ * @param array $states Module state keyed by module name
*/
public function setExemptStates( array $states ) {
$this->exemptStates = $states;
*/
public function setExemptStates( array $states ) {
$this->exemptStates = $states;
sort( $modules );
if ( $mainContext->getDebug() && count( $modules ) > 1 ) {
sort( $modules );
if ( $mainContext->getDebug() && count( $modules ) > 1 ) {
$chunks = [];
// Recursively call us for every item
foreach ( $modules as $name ) {
$chunks = [];
// Recursively call us for every item
foreach ( $modules as $name ) {
$files = $compiler->AllParsedFiles();
$this->localFileRefs = array_merge( $this->localFileRefs, $files );
$files = $compiler->AllParsedFiles();
$this->localFileRefs = array_merge( $this->localFileRefs, $files );
+ // Cache for 24 hours (86400 seconds).
$cache->set( $cacheKey, [
'css' => $css,
'files' => $files,
'hash' => FileContentsHasher::getFileContentsHash( $files ),
$cache->set( $cacheKey, [
'css' => $css,
'files' => $files,
'hash' => FileContentsHasher::getFileContentsHash( $files ),
- ], 60 * 60 * 24 ); // 86400 seconds, or 24 hours.
return $css;
}
/**
* Takes named templates by the module and returns an array mapping.
return $css;
}
/**
* Takes named templates by the module and returns an array mapping.
- * @return array of templates mapping template alias to content
+ * @return array Templates mapping template alias to content
* @throws MWException
*/
public function getTemplates() {
* @throws MWException
*/
public function getTemplates() {
* the BOM character is not valid in the middle of a string.
* We already assume UTF-8 everywhere, so this should be safe.
*
* the BOM character is not valid in the middle of a string.
* We already assume UTF-8 everywhere, so this should be safe.
*
- * @return string input minus the intial BOM char
+ * @param string $input
+ * @return string Input minus the intial BOM char
*/
protected function stripBom( $input ) {
if ( substr_compare( "\xef\xbb\xbf", $input, 0, 3 ) === 0 ) {
*/
protected function stripBom( $input ) {
if ( substr_compare( "\xef\xbb\xbf", $input, 0, 3 ) === 0 ) {
public function getExtension( $format = 'original' ) {
if ( $format === 'rasterized' && $this->extension === 'svg' ) {
return 'png';
public function getExtension( $format = 'original' ) {
if ( $format === 'rasterized' && $this->extension === 'svg' ) {
return 'png';
- } else {
- return $this->extension;
+ return $this->extension;
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
protected $targets = [ 'desktop', 'mobile' ];
protected $targets = [ 'desktop', 'mobile' ];
+ /**
+ * @return string JavaScript code
+ */
public function getScript( ResourceLoaderContext $context ) {
$config = $context->getResourceLoader()->getConfig();
return ResourceLoader::makeConfigSetScript( [
public function getScript( ResourceLoaderContext $context ) {
$config = $context->getResourceLoader()->getConfig();
return ResourceLoader::makeConfigSetScript( [
+ /**
+ * @return bool
+ */
public function enableModuleContentVersion() {
return true;
}
public function enableModuleContentVersion() {
return true;
}