Completed
Push — master ( c26593...163431 )
by
unknown
04:11
created
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 1 patch
Spacing   +5 added lines, -5 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
 		// parse if
75 75
 		if ( $this->shouldParse( $parser ) ) {
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 				} else {
162 162
 
163 163
 					wfDebug( "Cache miss: Lingo tree not found in cache.\n" );
164
-					$this->mLingoTree =& $this->buildLingo();
164
+					$this->mLingoTree = & $this->buildLingo();
165 165
 					wfDebug( "Cached lingo tree.\n" );
166 166
 				}
167 167
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
 			} else {
174 174
 				wfDebug( "Caching of lingo tree disabled.\n" );
175
-				$this->mLingoTree =& $this->buildLingo();
175
+				$this->mLingoTree = & $this->buildLingo();
176 176
 			}
177 177
 
178 178
 		}
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 	 * @param Parser $parser
386 386
 	 * @return bool
387 387
 	 */
388
-	protected function shouldParse( Parser &$parser ) {
388
+	protected function shouldParse( Parser & $parser ) {
389 389
 		global $wgexLingoUseNamespaces;
390 390
 
391 391
 		$title = $parser->getTitle();
Please login to merge, or discard this patch.
src/StashingDOMDocument.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 	 * @param $key
71 71
 	 * @return bool
72 72
 	 */
73
-	public function isStashed ( $key ) {
73
+	public function isStashed( $key ) {
74 74
 		return isset( $this->mStash[ $key ] );
75 75
 	}
76 76
 
Please login to merge, or discard this patch.
src/BasicBackend.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -128,8 +128,8 @@
 block discarded – undo
128 128
 	}
129 129
 
130 130
 	/**
131
-	 * @param $definitions
132
-	 * @param $term
131
+	 * @param string[] $definitions
132
+	 * @param string $term
133 133
 	 * @return array
134 134
 	 */
135 135
 	protected function queueDefinitions( $definitions, $term ) {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 * Lingo\BasicBackend constructor.
51 51
 	 * @param MessageLog|null $messages
52 52
 	 */
53
-	public function __construct( MessageLog &$messages = null ) {
53
+	public function __construct( MessageLog & $messages = null ) {
54 54
 
55 55
 		parent::__construct( $messages );
56 56
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 				$term = null;
117 117
 			}
118 118
 
119
-			$definitions[] = trim( $chunks[ 1 ] );
119
+			$definitions[ ] = trim( $chunks[ 1 ] );
120 120
 		}
121 121
 
122 122
 		// found a new term?
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 		$ret = array();
137 137
 
138 138
 		foreach ( $definitions as $definition ) {
139
-			$ret[] = array(
139
+			$ret[ ] = array(
140 140
 				Element::ELEMENT_TERM       => $term,
141 141
 				Element::ELEMENT_DEFINITION => $definition,
142 142
 				Element::ELEMENT_LINK       => null,
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	 * @param WikiPage $wikipage
256 256
 	 * @return Bool
257 257
 	 */
258
-	public function purgeCache( WikiPage &$wikipage ) {
258
+	public function purgeCache( WikiPage & $wikipage ) {
259 259
 
260 260
 		if ( !is_null( $wikipage ) && ( $wikipage->getTitle()->getText() === $this->getLingoPageName() ) ) {
261 261
 
Please login to merge, or discard this patch.
src/Backend.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 	 * Lingo\Backend constructor.
43 43
 	 * @param MessageLog|null $messages
44 44
 	 */
45
-	public function __construct( MessageLog &$messages = null ) {
45
+	public function __construct( MessageLog & $messages = null ) {
46 46
 
47 47
 		$this->mMessageLog = $messages;
48 48
 	}
Please login to merge, or discard this patch.
src/Element.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@
 block discarded – undo
58 58
 
59 59
 	/**
60 60
 	 * Lingo\Element constructor.
61
-	 * @param $term
62
-	 * @param $definition
61
+	 * @param string $term
62
+	 * @param string $definition
63 63
 	 */
64 64
 	public function __construct( &$term, &$definition = null ) {
65 65
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	const ELEMENT_LINK = 3;
48 48
 	const ELEMENT_STYLE = 4;
49 49
 
50
-	const ELEMENT_FIELDCOUNT = 5;  // number of fields stored for each element; (last field's index) + 1
50
+	const ELEMENT_FIELDCOUNT = 5; // number of fields stored for each element; (last field's index) + 1
51 51
 
52 52
 	const LINK_TEMPLATE_ID = 'LingoLink';
53 53
 
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
 	 * @param $definition
75 75
 	 */
76 76
 	public function addDefinition( &$definition ) {
77
-		$this->mDefinitions[] = array_pad( $definition, self::ELEMENT_FIELDCOUNT, null );
77
+		$this->mDefinitions[ ] = array_pad( $definition, self::ELEMENT_FIELDCOUNT, null );
78 78
 	}
79 79
 
80 80
 	/**
81 81
 	 * @param StashingDOMDocument $doc
82 82
 	 * @return DOMNode|DOMText
83 83
 	 */
84
-	public function getFullDefinition( StashingDOMDocument &$doc ) {
84
+	public function getFullDefinition( StashingDOMDocument & $doc ) {
85 85
 
86 86
 		global $wgexLingoDisplayOnce;
87 87
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	/**
99 99
 	 * @param StashingDOMDocument $doc
100 100
 	 */
101
-	private function buildFullDefinition( StashingDOMDocument &$doc ) {
101
+	private function buildFullDefinition( StashingDOMDocument & $doc ) {
102 102
 
103 103
 		// only create if not yet created
104 104
 		if ( $this->mFullDefinition === null || $this->mFullDefinition->ownerDocument !== $doc ) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 * @return DOMElement
126 126
 	 * @throws \MWException
127 127
 	 */
128
-	protected function getFullDefinitionAsLink( StashingDOMDocument &$doc ) {
128
+	protected function getFullDefinitionAsLink( StashingDOMDocument & $doc ) {
129 129
 
130 130
 		// create Title object for target page
131 131
 		$target = Title::newFromText( $this->mDefinitions[ 0 ][ self::ELEMENT_LINK ] );
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
 		$classes = array();
167 167
 
168 168
 		if ( $this->mDefinitions[ 0 ][ self::ELEMENT_STYLE ] !== null ) {
169
-			$classes[] = $this->mDefinitions[ 0 ][ self::ELEMENT_STYLE ];
169
+			$classes[ ] = $this->mDefinitions[ 0 ][ self::ELEMENT_STYLE ];
170 170
 		}
171 171
 
172 172
 		if ( !$target->isKnown() ) {
173
-			$classes[] = 'new';
173
+			$classes[ ] = 'new';
174 174
 		}
175 175
 
176 176
 		if ( $target->isExternal() ) {
177
-			$classes[] = 'extiw';
177
+			$classes[ ] = 'extiw';
178 178
 		}
179 179
 
180
-		if ( count($classes) > 0 ) {
181
-			$link->setAttribute( 'class', join(' ', $classes ) );
180
+		if ( count( $classes ) > 0 ) {
181
+			$link->setAttribute( 'class', join( ' ', $classes ) );
182 182
 		}
183 183
 
184 184
 		return $link;
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	 * @return DOMElement
209 209
 	 * @throws \MWException
210 210
 	 */
211
-	protected function getFullDefinitionAsTooltip( StashingDOMDocument &$doc ) {
211
+	protected function getFullDefinitionAsTooltip( StashingDOMDocument & $doc ) {
212 212
 
213 213
 		// Wrap term and definition in <span> tags
214 214
 		$span = $doc->createElement( 'span' );
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	 * @param StashingDOMDocument $doc
254 254
 	 * @return DOMNode
255 255
 	 */
256
-	private function getLinkTemplate( StashingDOMDocument &$doc ) {
256
+	private function getLinkTemplate( StashingDOMDocument & $doc ) {
257 257
 
258 258
 		$mLinkTemplate = $doc->stashGet( self::LINK_TEMPLATE_ID );
259 259
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 		if ( $mLinkTemplate === null ) {
262 262
 
263 263
 			$mLinkTemplate = $doc->createElement( 'a' );
264
-			$mLinkTemplate->setAttribute( 'class', 'mw-lingo-tooltip-link');
264
+			$mLinkTemplate->setAttribute( 'class', 'mw-lingo-tooltip-link' );
265 265
 
266 266
 			$doc->stashSet( $mLinkTemplate, self::LINK_TEMPLATE_ID );
267 267
 		}
Please login to merge, or discard this patch.
src/Lingo.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public static function initExtension() {
45 45
 
46
-		$GLOBALS[ 'wgExtensionFunctions' ][] = function () {
46
+		$GLOBALS[ 'wgExtensionFunctions' ][ ] = function() {
47 47
 
48 48
 			$parser = LingoParser::getInstance();
49 49
 
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 
54 54
 			\Hooks::register( 'ParserAfterParse', array( $parser, 'parse' ) );
55 55
 
56
-			\Hooks::register('GetDoubleUnderscoreIDs', function ( array &$doubleUnderscoreIDs ) {
57
-				$doubleUnderscoreIDs[] = 'noglossary';
56
+			\Hooks::register( 'GetDoubleUnderscoreIDs', function( array &$doubleUnderscoreIDs ) {
57
+				$doubleUnderscoreIDs[ ] = 'noglossary';
58 58
 				return true;
59 59
 			} );
60 60
 
61
-			\Hooks::register( 'ParserFirstCallInit', function ( \Parser $parser ) {
61
+			\Hooks::register( 'ParserFirstCallInit', function( \Parser $parser ) {
62 62
 
63
-				$parser->setHook( 'noglossary', function ( $input, array $args, \Parser $parser, \PPFrame $frame ) {
63
+				$parser->setHook( 'noglossary', function( $input, array $args, \Parser $parser, \PPFrame $frame ) {
64 64
 					$output = $parser->recursiveTagParse( $input, $frame );
65 65
 					return '<span class="noglossary">' . $output . '</span>';
66 66
 				} );
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 				return true;
69 69
 			} );
70 70
 
71
-			\Hooks::register( 'SpecialPageBeforeExecute', function ( \SpecialPage $specialPage, $subPage ) {
71
+			\Hooks::register( 'SpecialPageBeforeExecute', function( \SpecialPage $specialPage, $subPage ) {
72 72
 
73 73
 				if ( $specialPage instanceof \SpecialVersion ) {
74 74
 					foreach ( $GLOBALS[ 'wgExtensionCredits' ][ 'parserhook' ] as $index => $description ) {
Please login to merge, or discard this patch.