Completed
Push — master ( 20e65b...923e53 )
by
unknown
03:59
created
src/Backend.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 	 * Lingo\Backend constructor.
42 42
 	 * @param MessageLog|null $messages
43 43
 	 */
44
-	public function __construct( MessageLog &$messages = null ) {
44
+	public function __construct( MessageLog & $messages = null ) {
45 45
 
46 46
 		if ( !$messages ) {
47 47
 			$this->mMessageLog = new MessageLog();
Please login to merge, or discard this patch.
src/Element.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	const ELEMENT_LINK = 3;
49 49
 	const ELEMENT_STYLE = 4;
50 50
 
51
-	const ELEMENT_FIELDCOUNT = 5;  // number of fields stored for each element; (last field's index) + 1
51
+	const ELEMENT_FIELDCOUNT = 5; // number of fields stored for each element; (last field's index) + 1
52 52
 	static private $mLinkTemplate = null;
53 53
 	private $mFullDefinition = null;
54 54
 	private $mDefinitions = array();
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
 	 * @param $definition
74 74
 	 */
75 75
 	public function addDefinition( &$definition ) {
76
-		$this->mDefinitions[] = array_pad( $definition, self::ELEMENT_FIELDCOUNT, null );
76
+		$this->mDefinitions[ ] = array_pad( $definition, self::ELEMENT_FIELDCOUNT, null );
77 77
 	}
78 78
 
79 79
 	/**
80 80
 	 * @param DOMDocument $doc
81 81
 	 * @return DOMNode|DOMText
82 82
 	 */
83
-	public function getFullDefinition( DOMDocument &$doc ) {
83
+	public function getFullDefinition( DOMDocument & $doc ) {
84 84
 
85 85
 		global $wgexLingoDisplayOnce;
86 86
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 * @param DOMDocument $doc
99 99
 	 * @return DOMDocument
100 100
 	 */
101
-	private function buildFullDefinition( DOMDocument &$doc ) {
101
+	private function buildFullDefinition( DOMDocument & $doc ) {
102 102
 
103 103
 		// only create if not yet created
104 104
 		if ( $this->mFullDefinition === null || $this->mFullDefinition->ownerDocument !== $doc ) {
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 * @return DOMElement
127 127
 	 * @throws MWException
128 128
 	 */
129
-	protected function getFullDefinitionAsLink( DOMDocument &$doc ) {
129
+	protected function getFullDefinitionAsLink( DOMDocument & $doc ) {
130 130
 
131 131
 		// create Title object for target page
132 132
 		$target = Title::newFromText( $this->mDefinitions[ 0 ][ self::ELEMENT_LINK ] );
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	 * @return string
197 197
 	 * @throws MWException
198 198
 	 */
199
-	protected function getFullDefinitionAsTooltip( DOMDocument &$doc ) {
199
+	protected function getFullDefinitionAsTooltip( DOMDocument & $doc ) {
200 200
 
201 201
 		// Wrap term and definition in <span> tags
202 202
 		$span = $doc->createElement( 'span' );
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	 * @param DOMDocument $doc
240 240
 	 * @return DOMNode
241 241
 	 */
242
-	private function getLinkTemplate( DOMDocument &$doc ) {
242
+	private function getLinkTemplate( DOMDocument & $doc ) {
243 243
 		// create template if it does not yet exist
244 244
 		if ( !self::$mLinkTemplate || ( self::$mLinkTemplate->ownerDocument !== $doc ) ) {
245 245
 			global $wgScriptPath;
Please login to merge, or discard this patch.
src/Tree.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 * @param String $definition
86 86
 	 * @return Array the tree node the element was stored in
87 87
 	 */
88
-	protected function &addElement( Array &$path, &$term, &$definition ) {
88
+	protected function &addElement( array &$path, &$term, &$definition ) {
89 89
 
90 90
 		$tree = &$this->mTree;
91 91
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		}
143 143
 	}
144 144
 
145
-	public function findNextTermNoSkip( Array &$tree, &$lexemes, $index, $countLexemes ) {
145
+	public function findNextTermNoSkip( array &$tree, &$lexemes, $index, $countLexemes ) {
146 146
 
147 147
 		if ( $index + 1 < $countLexemes && array_key_exists( $currLex = $lexemes[ $index + 1 ][ 0 ], $tree ) ) {
148 148
 			$ret = $this->findNextTermNoSkip( $tree[ $currLex ], $lexemes, $index + 1, $countLexemes );
Please login to merge, or discard this patch.
src/MessageLog.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @param int $severity
54 54
 	 */
55 55
 	public function addMessage( $message, $severity = self::MESSAGE_NOTICE ) {
56
-		$this->mMessages[] = array( $message, $severity );
56
+		$this->mMessages[ ] = array( $message, $severity );
57 57
 
58 58
 		// log errors and warnings in debug log
59 59
 		if ( $severity == self::MESSAGE_WARNING ||
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * @param $message
68 68
 	 */
69 69
 	public function addError( $message ) {
70
-		$this->mMessages[] = array( $message, self::MESSAGE_ERROR );
70
+		$this->mMessages[ ] = array( $message, self::MESSAGE_ERROR );
71 71
 		wfDebug( "Error: $message\n" );
72 72
 	}
73 73
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 * @param $message
76 76
 	 */
77 77
 	public function addWarning( $message ) {
78
-		$this->mMessages[] = array( $message, self::MESSAGE_WARNING );
78
+		$this->mMessages[ ] = array( $message, self::MESSAGE_WARNING );
79 79
 		wfDebug( "Warning: $message\n" );
80 80
 	}
81 81
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * @param $message
84 84
 	 */
85 85
 	public function addNotice( $message ) {
86
-		$this->mMessages[] = array( $message, self::MESSAGE_NOTICE );
86
+		$this->mMessages[ ] = array( $message, self::MESSAGE_NOTICE );
87 87
 	}
88 88
 
89 89
 	/**
Please login to merge, or discard this patch.
src/LingoParser.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,6 @@
 block discarded – undo
29 29
 namespace Lingo;
30 30
 
31 31
 use DOMDocument;
32
-use DOMXPath;
33 32
 use Parser;
34 33
 
35 34
 /**
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
src/Lingo.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,28 +1,28 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * File containing the Lingo class
4
- *
5
- * This file is part of the MediaWiki extension Lingo.
6
- *
7
- * @copyright 2011 - 2016, Stephan Gambke
8
- * @license   GNU General Public License, version 2 (or any later version)
9
- *
10
- * The Lingo extension is free software: you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by the Free
12
- * Software Foundation; either version 2 of the License, or (at your option) any
13
- * later version.
14
- *
15
- * The Lingo extension is distributed in the hope that it will be useful, but
16
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18
- * details.
19
- *
20
- * You should have received a copy of the GNU General Public License along
21
- * with this program. If not, see <http://www.gnu.org/licenses/>.
22
- *
23
- * @file
24
- * @ingroup Lingo
25
- */
3
+	 * File containing the Lingo class
4
+	 *
5
+	 * This file is part of the MediaWiki extension Lingo.
6
+	 *
7
+	 * @copyright 2011 - 2016, Stephan Gambke
8
+	 * @license   GNU General Public License, version 2 (or any later version)
9
+	 *
10
+	 * The Lingo extension is free software: you can redistribute it and/or modify
11
+	 * it under the terms of the GNU General Public License as published by the Free
12
+	 * Software Foundation; either version 2 of the License, or (at your option) any
13
+	 * later version.
14
+	 *
15
+	 * The Lingo extension is distributed in the hope that it will be useful, but
16
+	 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
+	 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18
+	 * details.
19
+	 *
20
+	 * You should have received a copy of the GNU General Public License along
21
+	 * with this program. If not, see <http://www.gnu.org/licenses/>.
22
+	 *
23
+	 * @file
24
+	 * @ingroup Lingo
25
+	 */
26 26
 
27 27
 namespace Lingo;
28 28
 use MagicWord;
Please login to merge, or discard this patch.
src/BasicBackend.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	 * Lingo\BasicBackend constructor.
52 52
 	 * @param MessageLog|null $messages
53 53
 	 */
54
-	public function __construct( MessageLog &$messages = null ) {
54
+	public function __construct( MessageLog & $messages = null ) {
55 55
 
56 56
 		parent::__construct( $messages );
57 57
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 			if ( $term !== null ) {
95 95
 				foreach ( $definitions as $definition ) {
96
-					$ret[] = array(
96
+					$ret[ ] = array(
97 97
 						Element::ELEMENT_TERM       => $term,
98 98
 						Element::ELEMENT_DEFINITION => $definition,
99 99
 						Element::ELEMENT_LINK       => null,
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 				$term = null;
227 227
 			}
228 228
 
229
-			$definitions[] = trim( $chunks[ 1 ] );
229
+			$definitions[ ] = trim( $chunks[ 1 ] );
230 230
 		}
231 231
 
232 232
 		// found a new term?
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 * @param WikiPage $wikipage
242 242
 	 * @return Bool
243 243
 	 */
244
-	public function purgeCache( WikiPage &$wikipage ) {
244
+	public function purgeCache( WikiPage & $wikipage ) {
245 245
 
246 246
 		if ( !is_null( $wikipage ) && ( $wikipage->getTitle()->getText() === $this->getLingoPageName() ) ) {
247 247
 
Please login to merge, or discard this patch.