@@ -50,7 +50,6 @@ |
||
50 | 50 | /** |
51 | 51 | * Lingo\BasicBackend constructor. |
52 | 52 | * @param MessageLog|null $messages |
53 | - * @param LingoParser $lingoParser |
|
54 | 53 | */ |
55 | 54 | public function __construct( MessageLog &$messages = null ) { |
56 | 55 |
@@ -30,7 +30,6 @@ |
||
30 | 30 | use ApprovedRevs; |
31 | 31 | use ContentHandler; |
32 | 32 | use Hooks; |
33 | -use Page; |
|
34 | 33 | use Parser; |
35 | 34 | use ParserOptions; |
36 | 35 | use Revision; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param MessageLog|null $messages |
53 | 53 | * @param LingoParser $lingoParser |
54 | 54 | */ |
55 | - public function __construct( MessageLog &$messages = null ) { |
|
55 | + public function __construct( MessageLog & $messages = null ) { |
|
56 | 56 | |
57 | 57 | parent::__construct( $messages ); |
58 | 58 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $term = null; |
108 | 108 | } |
109 | 109 | |
110 | - $definitions[] = trim( $chunks[ 1 ] ); |
|
110 | + $definitions[ ] = trim( $chunks[ 1 ] ); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | // found a new term? |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | if ( $term !== null ) { |
119 | 119 | foreach ( $definitions as $definition ) { |
120 | - $ret[] = array( |
|
120 | + $ret[ ] = array( |
|
121 | 121 | Element::ELEMENT_TERM => $term, |
122 | 122 | Element::ELEMENT_DEFINITION => $definition, |
123 | 123 | Element::ELEMENT_LINK => null, |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * @param WikiPage $wikipage |
159 | 159 | * @return Bool |
160 | 160 | */ |
161 | - public function purgeCache( WikiPage &$wikipage ) { |
|
161 | + public function purgeCache( WikiPage & $wikipage ) { |
|
162 | 162 | |
163 | 163 | $page = $this->getLingoPage(); |
164 | 164 |
@@ -29,7 +29,6 @@ |
||
29 | 29 | namespace Lingo; |
30 | 30 | |
31 | 31 | use DOMDocument; |
32 | -use DOMXPath; |
|
33 | 32 | use Parser; |
34 | 33 | |
35 | 34 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * Lingo\LingoParser constructor. |
58 | 58 | * @param MessageLog|null $messages |
59 | 59 | */ |
60 | - public function __construct( MessageLog &$messages = null ) { |
|
60 | + public function __construct( MessageLog & $messages = null ) { |
|
61 | 61 | // The RegEx to split a chunk of text into words |
62 | 62 | // Words are: placeholders for stripped items, sequences of letters and numbers, single characters that are neither letter nor number |
63 | 63 | $this->regex = '/' . preg_quote( Parser::MARKER_PREFIX, '/' ) . '.*?' . preg_quote( Parser::MARKER_SUFFIX, '/' ) . '|[\p{L}\p{N}]+|[^\p{L}\p{N}]/u'; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param string $text |
70 | 70 | * @return Boolean |
71 | 71 | */ |
72 | - public function parse( Parser &$parser, &$text ) { |
|
72 | + public function parse( Parser & $parser, &$text ) { |
|
73 | 73 | |
74 | 74 | global $wgexLingoUseNamespaces; |
75 | 75 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | } else { |
173 | 173 | |
174 | 174 | wfDebug( "Cache miss: Lingo tree not found in cache.\n" ); |
175 | - $this->mLingoTree =& $this->buildLingo(); |
|
175 | + $this->mLingoTree = & $this->buildLingo(); |
|
176 | 176 | wfDebug( "Cached lingo tree.\n" ); |
177 | 177 | } |
178 | 178 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | } else { |
185 | 185 | wfDebug( "Caching of lingo tree disabled.\n" ); |
186 | - $this->mLingoTree =& $this->buildLingo(); |
|
186 | + $this->mLingoTree = & $this->buildLingo(); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public static function initExtension() { |
46 | 46 | |
47 | - $GLOBALS[ 'wgExtensionFunctions' ][] = function () { |
|
47 | + $GLOBALS[ 'wgExtensionFunctions' ][ ] = function() { |
|
48 | 48 | |
49 | 49 | $parser = LingoParser::getInstance(); |
50 | 50 | |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | |
55 | 55 | \Hooks::register( 'ParserAfterParse', array( $parser, 'parse' ) ); |
56 | 56 | |
57 | - \Hooks::register( 'ParserFirstCallInit', function ( \Parser $parser ) { |
|
57 | + \Hooks::register( 'ParserFirstCallInit', function( \Parser $parser ) { |
|
58 | 58 | |
59 | - $parser->setHook( 'noglossary', function ( $input, array $args, Parser $parser, PPFrame $frame ) { |
|
59 | + $parser->setHook( 'noglossary', function( $input, array $args, Parser $parser, PPFrame $frame ) { |
|
60 | 60 | $output = $parser->recursiveTagParse( $input, $frame ); |
61 | 61 | return '<span class="noglossary">' . $output . '</span>'; |
62 | 62 | } ); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | return true; |
65 | 65 | } ); |
66 | 66 | |
67 | - MagicWord::$mDoubleUnderscoreIDs[] = 'noglossary'; |
|
67 | + MagicWord::$mDoubleUnderscoreIDs[ ] = 'noglossary'; |
|
68 | 68 | |
69 | 69 | foreach ( $GLOBALS[ 'wgExtensionCredits' ][ 'parserhook' ] as $index => $description ) { |
70 | 70 |