@@ -48,11 +48,11 @@ discard block |
||
| 48 | 48 | * @param Title $title |
| 49 | 49 | * @param array $params Job parameters |
| 50 | 50 | */ |
| 51 | - public function __construct( Title $title, array $params ) { |
|
| 52 | - parent::__construct( 'parsePage', $title, $params ); |
|
| 51 | + public function __construct(Title $title, array $params) { |
|
| 52 | + parent::__construct('parsePage', $title, $params); |
|
| 53 | 53 | |
| 54 | - $this->user = isset( $params[ 'user' ] ) ? $params[ 'user' ] : null; |
|
| 55 | - $this->language = isset( $params[ 'lang' ] ) ? Language::factory( $params[ 'lang' ] ) : null; |
|
| 54 | + $this->user = isset($params['user']) ? $params['user'] : null; |
|
| 55 | + $this->language = isset($params['lang']) ? Language::factory($params['lang']) : null; |
|
| 56 | 56 | |
| 57 | 57 | // this does NOT protect against recursion, it only discards duplicate |
| 58 | 58 | // calls to {{#purge}} on the same page |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $title = $this->getTitle(); |
| 69 | 69 | |
| 70 | - if ( $title !== null && $title->isContentPage() && $title->exists() ) { |
|
| 70 | + if ($title !== null && $title->isContentPage() && $title->exists()) { |
|
| 71 | 71 | |
| 72 | - $wikiPage = WikiPage::factory( $title ); |
|
| 73 | - $parserOptions = new ParserOptions( $this->user, $this->language ); |
|
| 72 | + $wikiPage = WikiPage::factory($title); |
|
| 73 | + $parserOptions = new ParserOptions($this->user, $this->language); |
|
| 74 | 74 | |
| 75 | - $pool = new PoolWorkArticleView( $wikiPage, $parserOptions, $wikiPage->getLatest(), false ); |
|
| 75 | + $pool = new PoolWorkArticleView($wikiPage, $parserOptions, $wikiPage->getLatest(), false); |
|
| 76 | 76 | $pool->execute(); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -9,28 +9,28 @@ |
||
| 9 | 9 | class PurgePage { |
| 10 | 10 | |
| 11 | 11 | public static function init() { |
| 12 | - $GLOBALS[ 'wgExtensionMessagesFiles' ][ 'PurgePageMagic' ] = __DIR__ . '/PurgePage.magic.php'; |
|
| 13 | - $GLOBALS[ 'wgJobClasses' ][ 'parsePage' ] = 'PurgePage\\PageParseJob'; |
|
| 12 | + $GLOBALS['wgExtensionMessagesFiles']['PurgePageMagic'] = __DIR__ . '/PurgePage.magic.php'; |
|
| 13 | + $GLOBALS['wgJobClasses']['parsePage'] = 'PurgePage\\PageParseJob'; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | - public static function registerParserFunction( \Parser &$parser ) { |
|
| 16 | + public static function registerParserFunction(\Parser&$parser) { |
|
| 17 | 17 | |
| 18 | - $parser->setFunctionHook( 'purge', function () { |
|
| 18 | + $parser->setFunctionHook('purge', function() { |
|
| 19 | 19 | |
| 20 | 20 | $params = func_get_args(); |
| 21 | 21 | |
| 22 | - if ( isset( $params[ 1 ] ) ) { |
|
| 22 | + if (isset($params[1])) { |
|
| 23 | 23 | |
| 24 | - $parser = $params[ 0 ]; |
|
| 25 | - $pageName = $params[ 1 ]; |
|
| 24 | + $parser = $params[0]; |
|
| 25 | + $pageName = $params[1]; |
|
| 26 | 26 | |
| 27 | - $title = Title::newFromText( $pageName ); |
|
| 27 | + $title = Title::newFromText($pageName); |
|
| 28 | 28 | |
| 29 | - if ( $title !== null && $title->isContentPage() && $title->exists() ) { |
|
| 29 | + if ($title !== null && $title->isContentPage() && $title->exists()) { |
|
| 30 | 30 | /** @var \ParserOptions $parserOptions */ |
| 31 | 31 | $parserOptions = $parser->getOptions(); |
| 32 | - $job = Job::factory( 'parsePage', $title, [ 'user' => $parserOptions->getUser(), 'lang' => $parserOptions->getUserLang() ] ); |
|
| 33 | - JobQueueGroup::singleton()->lazyPush( $job ); |
|
| 32 | + $job = Job::factory('parsePage', $title, ['user' => $parserOptions->getUser(), 'lang' => $parserOptions->getUserLang()]); |
|
| 33 | + JobQueueGroup::singleton()->lazyPush($job); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |