// These come from transclusions
$request = $this->getRequest();
- $options = array(
+ $options = [
'action' => 'help',
'nolead' => true,
'submodules' => $request->getCheck( 'submodules' ),
'recursivesubmodules' => $request->getCheck( 'recursivesubmodules' ),
'title' => $request->getVal( 'title', $this->getPageTitle( '$1' )->getPrefixedText() ),
- );
+ ];
// These are for linking from wikitext, since url parameters are a pain
// to do.
$main = new ApiMain( $this->getContext(), false );
try {
$module = $main->getModuleFromPath( $moduleName );
+ } catch ( ApiUsageException $ex ) {
+ $this->getOutput()->addHTML( Html::rawElement( 'span', [ 'class' => 'error' ],
+ $this->msg( 'apihelp-no-such-module', $moduleName )->inContentLanguage()->parse()
+ ) );
+ return;
} catch ( UsageException $ex ) {
- $this->getOutput()->addHTML( Html::rawElement( 'span', array( 'class' => 'error' ),
+ $this->getOutput()->addHTML( Html::rawElement( 'span', [ 'class' => 'error' ],
$this->msg( 'apihelp-no-such-module', $moduleName )->inContentLanguage()->parse()
) );
return;