@@ -58,8 +58,8 @@ discard block |
||
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 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | /** |
188 | 188 | * @param Title $target |
189 | 189 | * @param DOMElement $link |
190 | - * @return mixed |
|
190 | + * @return DOMElement |
|
191 | 191 | */ |
192 | 192 | protected function &addTitleAttributeToLink( $target, &$link ) { |
193 | 193 |
@@ -47,7 +47,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |