* @ingroup Maintenance
*/
+$optionsWithoutArgs = [ 'verbose' ];
require_once __DIR__ . '/commandLine.inc';
$wgHooks['BeforeParserFetchTemplateAndtitle'][] = 'PPFuzzTester::templateHook';
class PPFuzzTester {
- public $hairs = array(
+ public $hairs = [
'[[', ']]', '{{', '{{', '}}', '}}', '{{{', '}}}',
'<', '>', '<nowiki', '<gallery', '</nowiki>', '</gallery>', '<nOwIkI>', '</NoWiKi>',
'<!--', '-->',
// extensions
// '<ref>', '</ref>', '<references/>',
- );
+ ];
public $minLength = 0;
public $maxLength = 20;
public $maxTemplates = 5;
- // public $outputTypes = array( 'OT_HTML', 'OT_WIKI', 'OT_PREPROCESS' );
- public $entryPoints = array( 'testSrvus', 'testPst', 'testPreprocess' );
+ // public $outputTypes = [ 'OT_HTML', 'OT_WIKI', 'OT_PREPROCESS' ];
+ public $entryPoints = [ 'testSrvus', 'testPst', 'testPreprocess' ];
public $verbose = false;
+ /**
+ * @var bool|PPFuzzTest
+ */
private static $currentTest = false;
function execute() {
$this->entryPoint = $tester->pickEntryPoint();
$this->nickname = $tester->makeInputText( $wgMaxSigChars + 10 );
$this->fancySig = (bool)mt_rand( 0, 1 );
- $this->templates = array();
+ $this->templates = [];
}
/**
$text = $this->parent->makeInputText();
}
}
- $this->templates[$titleText] = array(
+ $this->templates[$titleText] = [
'text' => $text,
- 'finalTitle' => $finalTitle );
+ 'finalTitle' => $finalTitle ];
}
return $this->templates[$titleText];
$wgUser->ppfz_test = $this;
$options = ParserOptions::newFromUser( $wgUser );
- $options->setTemplateCallback( array( $this, 'templateHook' ) );
+ $options->setTemplateCallback( [ $this, 'templateHook' ] );
$options->setTimestamp( wfTimestampNow() );
$this->output = call_user_func(
- array( $wgParser, $this->entryPoint ),
+ [ $wgParser, $this->entryPoint ],
$this->mainText,
$this->title,
$options