diff --git a/src/ParameterProvider.php b/src/ParameterProvider.php index 2c4722c..ad5b7d3 100644 --- a/src/ParameterProvider.php +++ b/src/ParameterProvider.php @@ -62,7 +62,7 @@ public function getEscapedUploadPageText() { } /** - * @param string $key + * @param int $key * @return string */ private function getEscapedParameter( $key ) { diff --git a/src/SimpleBatchUpload.php b/src/SimpleBatchUpload.php index 62a59b7..fa0b7a9 100644 --- a/src/SimpleBatchUpload.php +++ b/src/SimpleBatchUpload.php @@ -61,10 +61,12 @@ public function getConfiguration() { /** * @param \Parser $parser + * * @return bool + * @throws \MWException */ public function registerParserFunction( &$parser ) { - $parser->setFunctionHook( 'batchupload', [ new UploadButtonRenderer( $parser->getOutput() ), 'renderParserFunction' ], SFH_OBJECT_ARGS ); + $parser->setFunctionHook( 'batchupload', [ new UploadButtonRenderer(), 'renderParserFunction' ], SFH_OBJECT_ARGS ); return true; } diff --git a/src/SpecialBatchUpload.php b/src/SpecialBatchUpload.php index 50283fc..5a9e451 100644 --- a/src/SpecialBatchUpload.php +++ b/src/SpecialBatchUpload.php @@ -69,7 +69,7 @@ public function execute( $subpage ) { * @param string|null $subpage */ private function addPageContentToOutput( $subpage ) { - $renderer = new UploadButtonRenderer( $this->getOutput() ); + $renderer = new UploadButtonRenderer(); $renderer->renderSpecialPage( $this, $subpage ); } diff --git a/src/UploadButtonRenderer.php b/src/UploadButtonRenderer.php index 8a6c540..a0a890e 100644 --- a/src/UploadButtonRenderer.php +++ b/src/UploadButtonRenderer.php @@ -23,6 +23,8 @@ */ namespace SimpleBatchUpload; +use Parser; +use PPFrame; /** @@ -31,15 +33,13 @@ */ class UploadButtonRenderer { - private $output; - /** - * @param \Parser $parser - * @param \PPFrame $frame + * @param Parser $parser + * @param PPFrame $frame * @param $args * @return array */ - public function renderParserFunction( \Parser $parser, \PPFrame $frame, $args ) { + public function renderParserFunction( Parser $parser, PPFrame $frame, $args ) { $args = array_map( [ $frame, 'expand' ], $args ); $output = $parser->getOutput();