@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @codeCoverageIgnore |
63 | 63 | * @see ApiBase::getDescription |
64 | 64 | * |
65 | - * @return array |
|
65 | + * @return string[] |
|
66 | 66 | */ |
67 | 67 | public function getDescription() { |
68 | 68 | return array( |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @codeCoverageIgnore |
75 | 75 | * @see ApiBase::getExamples |
76 | 76 | * |
77 | - * @return array |
|
77 | + * @return string[] |
|
78 | 78 | */ |
79 | 79 | protected function getExamples() { |
80 | 80 | return array( |
@@ -17,18 +17,18 @@ discard block |
||
17 | 17 | * @see ApiBase::execute |
18 | 18 | */ |
19 | 19 | public function execute() { |
20 | - $parameterFormatter = new ApiRequestParameterFormatter( $this->extractRequestParams() ); |
|
20 | + $parameterFormatter = new ApiRequestParameterFormatter($this->extractRequestParams()); |
|
21 | 21 | $parameters = $parameterFormatter->getAskApiParameters(); |
22 | 22 | |
23 | - list( $queryParams, $otherParams ) = SCQQueryProcessor::separateParams( $parameters ); |
|
24 | - list( $queryResult ) = SCQQueryProcessor::queryAndMergeResults( $queryParams, $otherParams ); |
|
23 | + list($queryParams, $otherParams) = SCQQueryProcessor::separateParams($parameters); |
|
24 | + list($queryResult) = SCQQueryProcessor::queryAndMergeResults($queryParams, $otherParams); |
|
25 | 25 | |
26 | 26 | $outputFormat = 'json'; |
27 | - if ( $this->getMain()->getPrinter() instanceof \ApiFormatXml ) { |
|
27 | + if ($this->getMain()->getPrinter() instanceof \ApiFormatXml) { |
|
28 | 28 | $outputFormat = 'xml'; |
29 | 29 | } |
30 | 30 | |
31 | - $this->addQueryResult( $queryResult, $outputFormat ); |
|
31 | + $this->addQueryResult($queryResult, $outputFormat); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | */ |
79 | 79 | protected function getExamples() { |
80 | 80 | return array( |
81 | - 'api.php?action=compoundquery&query=' . urlencode( '[[Has city::Vienna]]; ?Has coordinates|[[Has city::Graz]]; ?Has coordinates' ), |
|
82 | - 'api.php?action=compoundquery&query=' . urlencode( '|[[Has city::Vienna]]; ?Has coordinates|[[Has city::Graz]]; ?Has coordinates' ), |
|
81 | + 'api.php?action=compoundquery&query=' . urlencode('[[Has city::Vienna]]; ?Has coordinates|[[Has city::Graz]]; ?Has coordinates'), |
|
82 | + 'api.php?action=compoundquery&query=' . urlencode('|[[Has city::Vienna]]; ?Has coordinates|[[Has city::Graz]]; ?Has coordinates'), |
|
83 | 83 | ); |
84 | 84 | } |
85 | 85 |
@@ -144,9 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | if ( $c == '[' ) { |
146 | 146 | $uncompleted_square_brackets++; |
147 | - } |
|
148 | - |
|
149 | - elseif ( $c == ']' ) { |
|
147 | + } elseif ( $c == ']' ) { |
|
150 | 148 | $uncompleted_square_brackets--; |
151 | 149 | } |
152 | 150 | } |
@@ -240,8 +238,7 @@ discard block |
||
240 | 238 | foreach ( $params as $param ) { |
241 | 239 | $parameters[$param->getName()] = $param->getValue(); |
242 | 240 | } |
243 | - } |
|
244 | - else { |
|
241 | + } else { |
|
245 | 242 | $parameters = $params; |
246 | 243 | } |
247 | 244 |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @param string $param |
125 | 125 | * |
126 | - * @return array |
|
126 | + * @return string[] |
|
127 | 127 | */ |
128 | 128 | protected static function getSubParams( $param ) { |
129 | 129 | $sub_params = array(); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * Combine two arrays of SMWWikiPageValue objects into one |
172 | 172 | * |
173 | 173 | * @param array $result1 |
174 | - * @param array $result2 |
|
174 | + * @param SMWDIWikiPage[] $result2 |
|
175 | 175 | * |
176 | 176 | * @return array |
177 | 177 | */ |
@@ -195,6 +195,9 @@ discard block |
||
195 | 195 | return $result1; |
196 | 196 | } |
197 | 197 | |
198 | + /** |
|
199 | + * @param SMW\Query\PrintRequest[] $printRequests2 |
|
200 | + */ |
|
198 | 201 | protected static function mergeSMWPrintRequests( $printRequests1, $printRequests2 ) { |
199 | 202 | $existingPrintoutLabels = array(); |
200 | 203 | foreach ( $printRequests1 as $p1 ) { |
@@ -211,7 +214,7 @@ discard block |
||
211 | 214 | } |
212 | 215 | |
213 | 216 | /** |
214 | - * @param $querystring |
|
217 | + * @param string $querystring |
|
215 | 218 | * @param array $params |
216 | 219 | * @param $extraPrintouts |
217 | 220 | * @param $outputMode |
@@ -256,7 +259,7 @@ discard block |
||
256 | 259 | * |
257 | 260 | * @param SCQQueryResult $res |
258 | 261 | * @param array $params These need to be the result of a list fed to getProcessedParams as of SMW 1.6.2 |
259 | - * @param $outputmode |
|
262 | + * @param integer $outputmode |
|
260 | 263 | * @param $context |
261 | 264 | * @param string $format |
262 | 265 | * |
@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * Comparison helper function, used in sorting results. |
16 | 16 | */ |
17 | - public static function compareQueryResults( $a, $b ) { |
|
18 | - if ( $a->getSerialization() == $b->getSerialization() ) { |
|
17 | + public static function compareQueryResults($a, $b) { |
|
18 | + if ($a->getSerialization() == $b->getSerialization()) { |
|
19 | 19 | return 0; |
20 | 20 | } |
21 | - return ( $a->getSerialization() < $b->getSerialization() ) ? -1 : 1; |
|
21 | + return ($a->getSerialization() < $b->getSerialization()) ? -1 : 1; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -28,20 +28,20 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return string |
30 | 30 | */ |
31 | - public static function doCompoundQuery( Parser &$parser ) { |
|
31 | + public static function doCompoundQuery(Parser&$parser) { |
|
32 | 32 | global $smwgQEnabled, $smwgIQRunningNumber; |
33 | 33 | |
34 | - if ( !$smwgQEnabled ) { |
|
35 | - return smwfEncodeMessages( array( wfMessage( 'smw_iq_disabled' )->inContentLanguage()->text() ) ); |
|
34 | + if (!$smwgQEnabled) { |
|
35 | + return smwfEncodeMessages(array(wfMessage('smw_iq_disabled')->inContentLanguage()->text())); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $smwgIQRunningNumber++; |
39 | 39 | |
40 | 40 | $params = func_get_args(); |
41 | - array_shift( $params ); // We already know the $parser. |
|
41 | + array_shift($params); // We already know the $parser. |
|
42 | 42 | |
43 | - list( $queryParams, $otherParams ) = self::separateParams( $params ); |
|
44 | - list( $queryResult, $otherParams ) = self::queryAndMergeResults( $queryParams, $otherParams ); |
|
43 | + list($queryParams, $otherParams) = self::separateParams($params); |
|
44 | + list($queryResult, $otherParams) = self::queryAndMergeResults($queryParams, $otherParams); |
|
45 | 45 | |
46 | 46 | return self::getResultFromQueryResult( |
47 | 47 | $queryResult, |
@@ -56,25 +56,25 @@ discard block |
||
56 | 56 | * @param $params |
57 | 57 | * @return array |
58 | 58 | */ |
59 | - public static function separateParams( $params ) { |
|
59 | + public static function separateParams($params) { |
|
60 | 60 | $queryParams = array(); |
61 | 61 | $otherParams = array(); |
62 | 62 | |
63 | - foreach ( $params as $param ) { |
|
63 | + foreach ($params as $param) { |
|
64 | 64 | // Very primitive heuristic - if the parameter |
65 | 65 | // includes a square bracket, then it's a |
66 | 66 | // sub-query; otherwise it's a regular parameter. |
67 | - if ( strpos( $param, '[' ) !== false ) { |
|
67 | + if (strpos($param, '[') !== false) { |
|
68 | 68 | $queryParams[] = $param; |
69 | 69 | } else { |
70 | - $parts = explode( '=', $param, 2 ); |
|
70 | + $parts = explode('=', $param, 2); |
|
71 | 71 | |
72 | - if ( count( $parts ) >= 2 ) { |
|
73 | - $otherParams[strtolower( trim( $parts[0] ) )] = $parts[1]; // don't trim here, some params care for " " |
|
72 | + if (count($parts) >= 2) { |
|
73 | + $otherParams[strtolower(trim($parts[0]))] = $parts[1]; // don't trim here, some params care for " " |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | } |
77 | - return array( $queryParams, $otherParams ); |
|
77 | + return array($queryParams, $otherParams); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -84,36 +84,36 @@ discard block |
||
84 | 84 | * @param $otherParams |
85 | 85 | * @return array |
86 | 86 | */ |
87 | - public static function queryAndMergeResults( $queryParams, $otherParams ) { |
|
87 | + public static function queryAndMergeResults($queryParams, $otherParams) { |
|
88 | 88 | $results = array(); |
89 | 89 | $printRequests = array(); |
90 | 90 | |
91 | - foreach ( $queryParams as $param ) { |
|
92 | - $subQueryParams = self::getSubParams( $param ); |
|
91 | + foreach ($queryParams as $param) { |
|
92 | + $subQueryParams = self::getSubParams($param); |
|
93 | 93 | |
94 | - if ( array_key_exists( 'format', $otherParams ) && !array_key_exists( 'format', $subQueryParams ) ) { |
|
94 | + if (array_key_exists('format', $otherParams) && !array_key_exists('format', $subQueryParams)) { |
|
95 | 95 | $subQueryParams['format'] = $otherParams['format']; |
96 | 96 | } |
97 | 97 | |
98 | 98 | $nextResult = self::getQueryResultFromFunctionParams($subQueryParams); |
99 | 99 | |
100 | - $results = self::mergeSMWQueryResults( $results, $nextResult->getResults() ); |
|
101 | - $printRequests = self::mergeSMWPrintRequests( $printRequests, $nextResult->getPrintRequests() ); |
|
100 | + $results = self::mergeSMWQueryResults($results, $nextResult->getResults()); |
|
101 | + $printRequests = self::mergeSMWPrintRequests($printRequests, $nextResult->getPrintRequests()); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | // Sort results so that they'll show up by page name |
105 | - if( !isset($otherParams['unsorted']) || !strcmp( $otherParams['unsorted'], 'on' ) ) { |
|
106 | - uasort( $results, array( 'SCQQueryProcessor', 'compareQueryResults' ) ); |
|
105 | + if (!isset($otherParams['unsorted']) || !strcmp($otherParams['unsorted'], 'on')) { |
|
106 | + uasort($results, array('SCQQueryProcessor', 'compareQueryResults')); |
|
107 | 107 | } |
108 | 108 | |
109 | - $queryResult = new SCQQueryResult( $printRequests, new SMWQuery(), $results, smwfGetStore() ); |
|
109 | + $queryResult = new SCQQueryResult($printRequests, new SMWQuery(), $results, smwfGetStore()); |
|
110 | 110 | |
111 | - if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) { |
|
112 | - SMWQueryProcessor::addThisPrintout( $printRequests, $otherParams ); |
|
113 | - $otherParams = self::getProcessedParams( $otherParams, $printRequests ); |
|
111 | + if (version_compare(SMW_VERSION, '1.6.1', '>')) { |
|
112 | + SMWQueryProcessor::addThisPrintout($printRequests, $otherParams); |
|
113 | + $otherParams = self::getProcessedParams($otherParams, $printRequests); |
|
114 | 114 | } |
115 | 115 | |
116 | - return array( $queryResult, $otherParams ); |
|
116 | + return array($queryResult, $otherParams); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -125,31 +125,31 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @return array |
127 | 127 | */ |
128 | - protected static function getSubParams( $param ) { |
|
128 | + protected static function getSubParams($param) { |
|
129 | 129 | $sub_params = array(); |
130 | 130 | $sub_param = ''; |
131 | 131 | $uncompleted_square_brackets = 0; |
132 | 132 | |
133 | - for ( $i = 0; $i < strlen( $param ); $i++ ) { |
|
133 | + for ($i = 0; $i < strlen($param); $i++) { |
|
134 | 134 | $c = $param[$i]; |
135 | 135 | |
136 | - if ( ( $c == ';' ) && ( $uncompleted_square_brackets <= 0 ) ) { |
|
137 | - $sub_params[] = trim( $sub_param ); |
|
136 | + if (($c == ';') && ($uncompleted_square_brackets <= 0)) { |
|
137 | + $sub_params[] = trim($sub_param); |
|
138 | 138 | $sub_param = ''; |
139 | 139 | } else { |
140 | 140 | $sub_param .= $c; |
141 | 141 | |
142 | - if ( $c == '[' ) { |
|
142 | + if ($c == '[') { |
|
143 | 143 | $uncompleted_square_brackets++; |
144 | 144 | } |
145 | 145 | |
146 | - elseif ( $c == ']' ) { |
|
146 | + elseif ($c == ']') { |
|
147 | 147 | $uncompleted_square_brackets--; |
148 | 148 | } |
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | - $sub_params[] = trim( $sub_param ); |
|
152 | + $sub_params[] = trim($sub_param); |
|
153 | 153 | |
154 | 154 | return $sub_params; |
155 | 155 | } |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | * |
162 | 162 | * @return SMWQueryResult |
163 | 163 | */ |
164 | - protected static function getQueryResultFromFunctionParams( $rawparams, $context = SMWQueryProcessor::INLINE_QUERY, $showmode = false ) { |
|
164 | + protected static function getQueryResultFromFunctionParams($rawparams, $context = SMWQueryProcessor::INLINE_QUERY, $showmode = false) { |
|
165 | 165 | $printouts = array(); |
166 | - self::processFunctionParams( $rawparams, $querystring, $params, $printouts, $showmode ); |
|
167 | - return self::getQueryResultFromQueryString( $querystring, $params, $printouts, $context ); |
|
166 | + self::processFunctionParams($rawparams, $querystring, $params, $printouts, $showmode); |
|
167 | + return self::getQueryResultFromQueryString($querystring, $params, $printouts, $context); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -175,19 +175,19 @@ discard block |
||
175 | 175 | * |
176 | 176 | * @return array |
177 | 177 | */ |
178 | - protected static function mergeSMWQueryResults( $result1, $result2 ) { |
|
179 | - if ( $result1 == null ) { |
|
178 | + protected static function mergeSMWQueryResults($result1, $result2) { |
|
179 | + if ($result1 == null) { |
|
180 | 180 | return $result2; |
181 | 181 | } |
182 | 182 | |
183 | 183 | $existing_page_names = array(); |
184 | - foreach ( $result1 as $r1 ) { |
|
184 | + foreach ($result1 as $r1) { |
|
185 | 185 | $existing_page_names[] = $r1->getSerialization(); |
186 | 186 | } |
187 | 187 | |
188 | - foreach ( $result2 as $r2 ) { |
|
188 | + foreach ($result2 as $r2) { |
|
189 | 189 | $page_name = $r2->getSerialization(); |
190 | - if ( ! in_array( $page_name, $existing_page_names ) ) { |
|
190 | + if (!in_array($page_name, $existing_page_names)) { |
|
191 | 191 | $result1[] = $r2; |
192 | 192 | } |
193 | 193 | } |
@@ -195,15 +195,15 @@ discard block |
||
195 | 195 | return $result1; |
196 | 196 | } |
197 | 197 | |
198 | - protected static function mergeSMWPrintRequests( $printRequests1, $printRequests2 ) { |
|
198 | + protected static function mergeSMWPrintRequests($printRequests1, $printRequests2) { |
|
199 | 199 | $existingPrintoutLabels = array(); |
200 | - foreach ( $printRequests1 as $p1 ) { |
|
200 | + foreach ($printRequests1 as $p1) { |
|
201 | 201 | $existingPrintoutLabels[] = $p1->getLabel(); |
202 | 202 | } |
203 | 203 | |
204 | - foreach ( $printRequests2 as $p2 ) { |
|
204 | + foreach ($printRequests2 as $p2) { |
|
205 | 205 | $label = $p2->getLabel(); |
206 | - if ( ! in_array( $label, $existingPrintoutLabels ) ) { |
|
206 | + if (!in_array($label, $existingPrintoutLabels)) { |
|
207 | 207 | $printRequests1[] = $p2; |
208 | 208 | } |
209 | 209 | } |
@@ -219,21 +219,21 @@ discard block |
||
219 | 219 | * |
220 | 220 | * @return SMWQueryResult |
221 | 221 | */ |
222 | - protected static function getQueryResultFromQueryString( $querystring, array $params, $extraPrintouts, $context = SMWQueryProcessor::INLINE_QUERY ) { |
|
223 | - wfProfileIn( 'SCQQueryProcessor::getQueryResultFromQueryString' ); |
|
222 | + protected static function getQueryResultFromQueryString($querystring, array $params, $extraPrintouts, $context = SMWQueryProcessor::INLINE_QUERY) { |
|
223 | + wfProfileIn('SCQQueryProcessor::getQueryResultFromQueryString'); |
|
224 | 224 | |
225 | - if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) { |
|
226 | - SMWQueryProcessor::addThisPrintout( $extraPrintouts, $params ); |
|
227 | - $params = self::getProcessedParams( $params, $extraPrintouts, false ); |
|
225 | + if (version_compare(SMW_VERSION, '1.6.1', '>')) { |
|
226 | + SMWQueryProcessor::addThisPrintout($extraPrintouts, $params); |
|
227 | + $params = self::getProcessedParams($params, $extraPrintouts, false); |
|
228 | 228 | } |
229 | 229 | |
230 | - $query = self::createQuery( $querystring, $params, $context, null, $extraPrintouts ); |
|
231 | - $queryResult = smwfGetStore()->getQueryResult( $query ); |
|
230 | + $query = self::createQuery($querystring, $params, $context, null, $extraPrintouts); |
|
231 | + $queryResult = smwfGetStore()->getQueryResult($query); |
|
232 | 232 | |
233 | 233 | $parameters = array(); |
234 | 234 | |
235 | - if ( version_compare( SMW_VERSION, '1.7.2', '>' ) ) { |
|
236 | - foreach ( $params as $param ) { |
|
235 | + if (version_compare(SMW_VERSION, '1.7.2', '>')) { |
|
236 | + foreach ($params as $param) { |
|
237 | 237 | $parameters[$param->getName()] = $param->getValue(); |
238 | 238 | } |
239 | 239 | } |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | $parameters = $params; |
242 | 242 | } |
243 | 243 | |
244 | - foreach ( $queryResult->getResults() as $wikiPage ) { |
|
244 | + foreach ($queryResult->getResults() as $wikiPage) { |
|
245 | 245 | $wikiPage->display_options = $parameters; |
246 | 246 | } |
247 | 247 | |
248 | - wfProfileOut( 'SCQQueryProcessor::getQueryResultFromQueryString' ); |
|
248 | + wfProfileOut('SCQQueryProcessor::getQueryResultFromQueryString'); |
|
249 | 249 | |
250 | 250 | return $queryResult; |
251 | 251 | } |
@@ -262,23 +262,23 @@ discard block |
||
262 | 262 | * |
263 | 263 | * @return string |
264 | 264 | */ |
265 | - protected static function getResultFromQueryResult( SCQQueryResult $res, array $params, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY, $format = '' ) { |
|
266 | - wfProfileIn( 'SCQQueryProcessor::getResultFromQueryResult' ); |
|
265 | + protected static function getResultFromQueryResult(SCQQueryResult $res, array $params, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY, $format = '') { |
|
266 | + wfProfileIn('SCQQueryProcessor::getResultFromQueryResult'); |
|
267 | 267 | |
268 | - if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) { |
|
268 | + if (version_compare(SMW_VERSION, '1.6.1', '>')) { |
|
269 | 269 | $format = $params['format']; |
270 | 270 | |
271 | - if ( version_compare( SMW_VERSION, '1.7.2', '>' ) ) { |
|
271 | + if (version_compare(SMW_VERSION, '1.7.2', '>')) { |
|
272 | 272 | $format = $format->getValue(); |
273 | 273 | } |
274 | 274 | } else { |
275 | - $format = self::getResultFormat( $params ); |
|
275 | + $format = self::getResultFormat($params); |
|
276 | 276 | } |
277 | 277 | |
278 | - $printer = self::getResultPrinter( $format, $context ); |
|
279 | - $result = $printer->getResult( $res, $params, $outputmode ); |
|
278 | + $printer = self::getResultPrinter($format, $context); |
|
279 | + $result = $printer->getResult($res, $params, $outputmode); |
|
280 | 280 | |
281 | - wfProfileOut( 'SCQQueryProcessor::getResultFromQueryResult' ); |
|
281 | + wfProfileOut('SCQQueryProcessor::getResultFromQueryResult'); |
|
282 | 282 | |
283 | 283 | return $result; |
284 | 284 | } |
@@ -17,29 +17,29 @@ |
||
17 | 17 | * |
18 | 18 | * @param SMWQueryResult $newResult |
19 | 19 | */ |
20 | - public function addResult( SMWQueryResult $newResult ) { |
|
20 | + public function addResult(SMWQueryResult $newResult) { |
|
21 | 21 | $existingPageNames = array(); |
22 | 22 | |
23 | - while ( $row = $this->getNext() ) { |
|
24 | - if ( $row[0] instanceof SMWResultArray ) { |
|
23 | + while ($row = $this->getNext()) { |
|
24 | + if ($row[0] instanceof SMWResultArray) { |
|
25 | 25 | $content = $row[0]->getContent(); |
26 | - $existingPageNames[] = $content[0]->getLongText( SMW_OUTPUT_WIKI ); |
|
26 | + $existingPageNames[] = $content[0]->getLongText(SMW_OUTPUT_WIKI); |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | |
30 | - while ( ( $row = $newResult->getNext() ) !== false ) { |
|
31 | - if ( property_exists( $newResult, 'display_options' ) ) { |
|
30 | + while (($row = $newResult->getNext()) !== false) { |
|
31 | + if (property_exists($newResult, 'display_options')) { |
|
32 | 32 | $row[0]->display_options = $newResult->display_options; |
33 | 33 | } |
34 | 34 | $content = $row[0]->getContent(); |
35 | - $pageName = $content[0]->getLongText( SMW_OUTPUT_WIKI ); |
|
35 | + $pageName = $content[0]->getLongText(SMW_OUTPUT_WIKI); |
|
36 | 36 | |
37 | - if ( !in_array( $pageName, $existingPageNames ) ) { |
|
37 | + if (!in_array($pageName, $existingPageNames)) { |
|
38 | 38 | $this->m_content[] = $row; |
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
42 | - reset( $this->m_content ); |
|
42 | + reset($this->m_content); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | } |
@@ -15,15 +15,15 @@ discard block |
||
15 | 15 | * @defgroup SemanticCompoundQueries SemanticCompoundQueries |
16 | 16 | */ |
17 | 17 | |
18 | -if ( !defined( 'MEDIAWIKI' ) ) die(); |
|
18 | +if (!defined('MEDIAWIKI')) die(); |
|
19 | 19 | |
20 | -define( 'SCQ_VERSION', '0.4.1' ); |
|
20 | +define('SCQ_VERSION', '0.4.1'); |
|
21 | 21 | |
22 | 22 | $wgExtensionCredits['semantic'][] = array( |
23 | 23 | 'path' => __FILE__, |
24 | 24 | 'name' => 'Semantic Compound Queries', |
25 | 25 | 'version' => SCQ_VERSION, |
26 | - 'author' => array( 'Yaron Koren' ), |
|
26 | + 'author' => array('Yaron Koren'), |
|
27 | 27 | 'url' => 'https://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries', |
28 | 28 | 'descriptionmsg' => 'semanticcompoundqueries-desc', |
29 | 29 | 'license-name' => 'GPL-2.0+' |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | $wgAPIModules['compoundquery'] = '\SCQCompoundQueryApi'; |
42 | 42 | |
43 | -function scqgRegisterParser( Parser &$parser ) { |
|
44 | - $parser->setFunctionHook( 'compound_query', array( 'SCQQueryProcessor', 'doCompoundQuery' ) ); |
|
43 | +function scqgRegisterParser(Parser&$parser) { |
|
44 | + $parser->setFunctionHook('compound_query', array('SCQQueryProcessor', 'doCompoundQuery')); |
|
45 | 45 | return true; // always return true, in order not to stop MW's hook processing! |
46 | 46 | } |
@@ -15,7 +15,9 @@ |
||
15 | 15 | * @defgroup SemanticCompoundQueries SemanticCompoundQueries |
16 | 16 | */ |
17 | 17 | |
18 | -if ( !defined( 'MEDIAWIKI' ) ) die(); |
|
18 | +if ( !defined( 'MEDIAWIKI' ) ) { |
|
19 | + die(); |
|
20 | +} |
|
19 | 21 | |
20 | 22 | define( 'SCQ_VERSION', '0.4.1' ); |
21 | 23 |
@@ -7,70 +7,70 @@ |
||
7 | 7 | |
8 | 8 | /** English (English) */ |
9 | 9 | $magicWords['en'] = array( |
10 | - 'compound_query' => array( 0, 'compound_query' ), |
|
10 | + 'compound_query' => array(0, 'compound_query'), |
|
11 | 11 | ); |
12 | 12 | |
13 | 13 | /** Arabic (العربية) */ |
14 | 14 | $magicWords['ar'] = array( |
15 | - 'compound_query' => array( 0, 'استعلام_مركب' ), |
|
15 | + 'compound_query' => array(0, 'استعلام_مركب'), |
|
16 | 16 | ); |
17 | 17 | |
18 | 18 | /** Egyptian Arabic (مصرى) */ |
19 | 19 | $magicWords['arz'] = array( |
20 | - 'compound_query' => array( 0, 'استعلام_مركب' ), |
|
20 | + 'compound_query' => array(0, 'استعلام_مركب'), |
|
21 | 21 | ); |
22 | 22 | |
23 | 23 | /** Chuvash (Чӑвашла) */ |
24 | 24 | $magicWords['cv'] = array( |
25 | - 'compound_query' => array( 0, 'compound_query' ), |
|
25 | + 'compound_query' => array(0, 'compound_query'), |
|
26 | 26 | ); |
27 | 27 | |
28 | 28 | /** German (Deutsch) */ |
29 | 29 | $magicWords['de'] = array( |
30 | - 'compound_query' => array( 0, 'abfrage_zusammen', 'frage_zusammen' ), |
|
30 | + 'compound_query' => array(0, 'abfrage_zusammen', 'frage_zusammen'), |
|
31 | 31 | ); |
32 | 32 | |
33 | 33 | /** Japanese (日本語) */ |
34 | 34 | $magicWords['ja'] = array( |
35 | - 'compound_query' => array( 0, '複合クエリ', '複合クエリー' ), |
|
35 | + 'compound_query' => array(0, '複合クエリ', '複合クエリー'), |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | /** Korean (한국어) */ |
39 | 39 | $magicWords['ko'] = array( |
40 | - 'compound_query' => array( 0, '복합_쿼리' ), |
|
40 | + 'compound_query' => array(0, '복합_쿼리'), |
|
41 | 41 | ); |
42 | 42 | |
43 | 43 | /** Macedonian (македонски) */ |
44 | 44 | $magicWords['mk'] = array( |
45 | - 'compound_query' => array( 0, 'мешовито_барање' ), |
|
45 | + 'compound_query' => array(0, 'мешовито_барање'), |
|
46 | 46 | ); |
47 | 47 | |
48 | 48 | /** Low Saxon (Netherlands) (Nedersaksies) */ |
49 | 49 | $magicWords['nds-nl'] = array( |
50 | - 'compound_query' => array( 0, 'samenestelden_zeukopdrachte', 'samengestelde_zoekopdracht' ), |
|
50 | + 'compound_query' => array(0, 'samenestelden_zeukopdrachte', 'samengestelde_zoekopdracht'), |
|
51 | 51 | ); |
52 | 52 | |
53 | 53 | /** Dutch (Nederlands) */ |
54 | 54 | $magicWords['nl'] = array( |
55 | - 'compound_query' => array( 0, 'samengestelde_zoekopdracht' ), |
|
55 | + 'compound_query' => array(0, 'samengestelde_zoekopdracht'), |
|
56 | 56 | ); |
57 | 57 | |
58 | 58 | /** Brazilian Portuguese (português do Brasil) */ |
59 | 59 | $magicWords['pt-br'] = array( |
60 | - 'compound_query' => array( 0, 'consulta_composta' ), |
|
60 | + 'compound_query' => array(0, 'consulta_composta'), |
|
61 | 61 | ); |
62 | 62 | |
63 | 63 | /** Serbian (Latin script) (srpski (latinica)) */ |
64 | 64 | $magicWords['sr-el'] = array( |
65 | - 'compound_query' => array( 0, 'sastavi_upit' ), |
|
65 | + 'compound_query' => array(0, 'sastavi_upit'), |
|
66 | 66 | ); |
67 | 67 | |
68 | 68 | /** Simplified Chinese (中文(简体)) */ |
69 | 69 | $magicWords['zh-hans'] = array( |
70 | - 'compound_query' => array( 0, '组合查询' ), |
|
70 | + 'compound_query' => array(0, '组合查询'), |
|
71 | 71 | ); |
72 | 72 | |
73 | 73 | /** Traditional Chinese (中文(繁體)) */ |
74 | 74 | $magicWords['zh-hant'] = array( |
75 | - 'compound_query' => array( 0, '組合搜尋' ), |
|
75 | + 'compound_query' => array(0, '組合搜尋'), |
|
76 | 76 | ); |
77 | 77 | \ No newline at end of file |