@@ -2,5 +2,5 @@ |
||
2 | 2 | $magicWords = array(); |
3 | 3 | |
4 | 4 | $magicWords['en'] = array( |
5 | - 'purge' => array( 0, 'purge' ), |
|
5 | + 'purge' => array(0, 'purge'), |
|
6 | 6 | ); |
@@ -7,25 +7,25 @@ |
||
7 | 7 | class PurgePage { |
8 | 8 | |
9 | 9 | public static function init() { |
10 | - $GLOBALS[ 'wgExtensionMessagesFiles' ][ 'PurgePageMagic' ] = __DIR__ . '/PurgePage.magic.php'; |
|
11 | - $GLOBALS[ 'wgJobClasses' ][ 'parsePage' ] = 'PurgePage\\PageParseJob'; |
|
10 | + $GLOBALS['wgExtensionMessagesFiles']['PurgePageMagic'] = __DIR__ . '/PurgePage.magic.php'; |
|
11 | + $GLOBALS['wgJobClasses']['parsePage'] = 'PurgePage\\PageParseJob'; |
|
12 | 12 | } |
13 | 13 | |
14 | - public static function registerParserFunction( \Parser &$parser ) { |
|
14 | + public static function registerParserFunction(\Parser&$parser) { |
|
15 | 15 | |
16 | - $parser->setFunctionHook( 'purge', function () { |
|
16 | + $parser->setFunctionHook('purge', function() { |
|
17 | 17 | |
18 | 18 | $params = func_get_args(); |
19 | 19 | |
20 | - if ( isset( $params[ 1 ] ) ) { |
|
20 | + if (isset($params[1])) { |
|
21 | 21 | |
22 | - $parser = $params[ 0 ]; |
|
23 | - $pageName = $params[ 1 ]; |
|
22 | + $parser = $params[0]; |
|
23 | + $pageName = $params[1]; |
|
24 | 24 | |
25 | - $title = \Title::newFromText( $pageName ); |
|
26 | - $job = \Job::factory( 'parsePage', $title, [ 'parseroptions' => $parser->getOptions() ] ); |
|
25 | + $title = \Title::newFromText($pageName); |
|
26 | + $job = \Job::factory('parsePage', $title, ['parseroptions' => $parser->getOptions()]); |
|
27 | 27 | |
28 | - \JobQueueGroup::singleton()->lazyPush( [ $job ] ); |
|
28 | + \JobQueueGroup::singleton()->lazyPush([$job]); |
|
29 | 29 | |
30 | 30 | } |
31 | 31 |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | * @param Title $title |
47 | 47 | * @param array $params Job parameters |
48 | 48 | */ |
49 | - public function __construct( Title $title, array $params ) { |
|
50 | - parent::__construct( 'pageParse', $title, $params ); |
|
49 | + public function __construct(Title $title, array $params) { |
|
50 | + parent::__construct('pageParse', $title, $params); |
|
51 | 51 | |
52 | - $this->mParserOptions = isset( $params[ 'parseroptions' ] ) ? $params[ 'parseroptions' ] : new ParserOptions(); |
|
52 | + $this->mParserOptions = isset($params['parseroptions']) ? $params['parseroptions'] : new ParserOptions(); |
|
53 | 53 | |
54 | 54 | // this does NOT protect against recursion, it only discards duplicate |
55 | 55 | // calls to {{#purge}} on the same page |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | |
65 | 65 | $title = $this->getTitle(); |
66 | 66 | |
67 | - if ( $title->isContentPage() && $title->exists() ) { |
|
67 | + if ($title->isContentPage() && $title->exists()) { |
|
68 | 68 | |
69 | - $wikiPage = \WikiPage::factory( $title ); |
|
70 | - $pool = new PoolWorkArticleView( $wikiPage, $this->mParserOptions, $wikiPage->getLatest(), false ); |
|
69 | + $wikiPage = \WikiPage::factory($title); |
|
70 | + $pool = new PoolWorkArticleView($wikiPage, $this->mParserOptions, $wikiPage->getLatest(), false); |
|
71 | 71 | $pool->execute(); |
72 | 72 | } |
73 | 73 |