Page MenuHomeWickedGov Phorge

GetConfigTrait.php
No OneTemporary

Size
722 B
Referenced Files
None
Subscribers
None

GetConfigTrait.php

<?php
declare( strict_types=1 );
namespace MediaWiki\Skins\Citizen;
use MediaWiki\Config\ConfigException;
use MediaWiki\Output\OutputPage;
trait GetConfigTrait {
/**
* getConfig() wrapper to catch exceptions.
* Returns null on exception
*
* @param string $key
* @param OutputPage|null $out
* @return mixed
* @see SkinTemplate::getConfig()
*/
protected function getConfigValue( string $key, ?OutputPage $out = null ): mixed {
if ( isset( $this->out ) ) {
$out = $this->out;
}
if ( is_callable( [ $this, 'getOutput' ] ) ) {
$out = $this->getOutput();
}
try {
$value = $out->getConfig()->get( $key );
} catch ( ConfigException $e ) {
$value = null;
}
return $value;
}
}

File Metadata

Mime Type
text/x-php
Expires
Oct 5 2026, 12:45 (6 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
22/4d/7ac0710a246ed2afacabbfa9cbc6
Default Alt Text
GetConfigTrait.php (722 B)

Event Timeline