Skip to content

Commit

Permalink
Some clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
s7eph4n committed Mar 30, 2018
1 parent 74b6f92 commit c92ab12
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/ParameterProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getEscapedUploadPageText() {
}

/**
* @param string $key
* @param int $key
* @return string
*/
private function getEscapedParameter( $key ) {
Expand Down
4 changes: 3 additions & 1 deletion src/SimpleBatchUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/SpecialBatchUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down
10 changes: 5 additions & 5 deletions src/UploadButtonRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/

namespace SimpleBatchUpload;
use Parser;
use PPFrame;


/**
Expand All @@ -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();
Expand Down

0 comments on commit c92ab12

Please sign in to comment.