'stubthreshold' => true,
'printable' => true,
'userlang' => true,
- 'wrapclass' => true,
];
/**
/**
* CSS class to use to wrap output from Parser::parse()
* @since 1.30
- * @param string|bool $className Set false to disable wrapping.
+ * @param string $className Class name to use for wrapping.
+ * Passing false to indicate "no wrapping" was deprecated in MediaWiki 1.31.
* @return string|bool Current value
*/
public function setWrapOutputClass( $className ) {
if ( $className === true ) { // DWIM, they probably want the default class name
$className = 'mw-parser-output';
}
+ if ( $className === false ) {
+ wfDeprecated( __METHOD__ . '( false )', '1.31' );
+ }
return $this->setOption( 'wrapclass', $className );
}
/**
* Create "edit section" links?
+ * @deprecated since 1.31, use ParserOutput::getText() options instead.
* @return bool
*/
public function getEditSection() {
/**
* Create "edit section" links?
+ * @deprecated since 1.31, use ParserOutput::getText() options instead.
* @param bool|null $x New value (null is no change)
* @return bool Old value
*/
}
if ( $lang === null ) {
global $wgLang;
+ if ( !StubObject::isRealObject( $wgLang ) ) {
+ $wgLang->_unstub();
+ }
$lang = $wgLang;
}
$this->initialiseFromUser( $user, $lang );
*
* @since 1.30
* @param User|null $user
- * @param Language|null $lang
+ * @param Language|StubObject|null $lang
* @return ParserOptions
*/
public static function newCanonical( User $user = null, $lang = null ) {
'printable' => false,
'allowUnsafeRawHtml' => true,
'wrapclass' => 'mw-parser-output',
- 'currentRevisionCallback' => [ 'Parser', 'statelessFetchRevision' ],
- 'templateCallback' => [ 'Parser', 'statelessFetchTemplate' ],
+ 'currentRevisionCallback' => [ Parser::class, 'statelessFetchRevision' ],
+ 'templateCallback' => [ Parser::class, 'statelessFetchTemplate' ],
'speculativeRevIdCallback' => null,
];
- // @codingStandardsIgnoreStart Squiz.WhiteSpace.OperatorSpacing.NoSpaceAfterAmp
Hooks::run( 'ParserOptionsRegister', [
&self::$defaults,
&self::$inCacheKey,
&self::$lazyOptions,
] );
- // @codingStandardsIgnoreEnd
ksort( self::$inCacheKey );
}